Skip to content
This repository was archived by the owner on Feb 7, 2021. It is now read-only.

Commit ed00b42

Browse files
jordanpowell88wesleygrimes
authored andcommitted
fix: rename inMemoryDb to inMemoryDB (#109)
Correct typo
1 parent b3470ef commit ed00b42

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Now we can make use of our new `interface` when injecting the `InMemoryDBService
9999

100100
In order to use the `InMemoryDBService<T>` we need to do the following:
101101

102-
- Add `private readonly inMemoryDb: InMemoryDBService<T>` to the `constructor` of each controller and/or service that you would like to use it in.
102+
- Add `private readonly inMemoryDB: InMemoryDBService<T>` to the `constructor` of each controller and/or service that you would like to use it in.
103103
- Begin using `InMemoryDBService` as expected.
104104

105105
An example of injecting `InMemoryDBService` into a `UserController` for the `UserEntity` we defined earlier would look something like this:
@@ -171,15 +171,15 @@ Using this decorator ensures that the correct instance is injected.
171171

172172
## Entity Controller
173173

174-
In order to prevent code duplication and boilerplate for each controller, we have created two base entity controllers `InMemoryDbEntityController` and `InMemoryDbEntityAsyncController`. This allows you to quickly provide endpoints to make requests without having to manually implement each action.
174+
In order to prevent code duplication and boilerplate for each controller, we have created two base entity controllers `InMemoryDBEntityController` and `InMemoryDBEntityAsyncController`. This allows you to quickly provide endpoints to make requests without having to manually implement each action.
175175

176176

177177
To use the controllers, simply create a new controller and extend it with one of the provided base controllers.
178178

179179

180180
```typescript
181181
@Controller('api/users')
182-
class UsersController extends InMemoryDbController<UserEntity> {
182+
class UsersController extends InMemoryDBEntityController<UserEntity> {
183183

184184
constructor(protected dbService: InMemoryDBService<UserEntity>) {
185185
super(dbService);
@@ -193,7 +193,7 @@ In order to have an Entity Controller use a feature-specific instance of the ser
193193

194194
```typescript
195195
@Controller('api/users')
196-
class UsersController extends InMemoryDbController<UserEntity> {
196+
class UsersController extends InMemoryDBEntityController<UserEntity> {
197197

198198
constructor(@InjectInMemoryDBService('customer') protected readonly inMemoryDBService: InMemoryDBService<UserEntity>) {
199199
super(inMemoryDBService);

e2e/test-app/src/customer/customer.controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Controller } from '@nestjs/common';
2-
import { InMemoryDBService, InjectInMemoryDBService, InMemoryDbEntityController } from '../../../../lib';
2+
import { InMemoryDBService, InjectInMemoryDBService, InMemoryDBEntityController as InMemoryDBEntityController } from '../../../../lib';
33
import { Customer } from './customer';
44

55
@Controller('api/customers')
6-
export class CustomerController extends InMemoryDbEntityController<Customer> {
6+
export class CustomerController extends InMemoryDBEntityController<Customer> {
77

88
constructor(
99
@InjectInMemoryDBService('customer') protected readonly inMemoryDBService: InMemoryDBService<Customer>

lib/controllers/in-memory-db-async.controller.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { InMemoryDBEntity } from '../interfaces';
22
import { inMemoryDBServiceFactory } from '../factories';
3-
import { InMemoryDbEntityAsyncController } from './in-memory-db-async.controller';
3+
import { InMemoryDBEntityAsyncController } from './in-memory-db-async.controller';
44
import { InMemoryDBService } from '../services';
55

66
describe('In Memory DB Async Controller', () => {
77
interface TestEntity extends InMemoryDBEntity {
88
someField: string;
99
}
1010

11-
let controller: InMemoryDbEntityAsyncController<TestEntity>;
11+
let controller: InMemoryDBEntityAsyncController<TestEntity>;
1212
let service: InMemoryDBService<TestEntity>;
1313

1414
const sampleRecords: TestEntity[] = [
@@ -17,7 +17,7 @@ describe('In Memory DB Async Controller', () => {
1717
{ id: 3, someField: 'CCC' },
1818
];
1919

20-
class MockController extends InMemoryDbEntityAsyncController<TestEntity> {
20+
class MockController extends InMemoryDBEntityAsyncController<TestEntity> {
2121
constructor(protected dbService: InMemoryDBService<TestEntity>) {
2222
super(dbService);
2323
}

lib/controllers/in-memory-db-async.controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Observable } from 'rxjs';
88
*
99
* ```ts
1010
* @Controller('api/user')
11-
* class UsersController extends InMemoryDbEntityAsyncController<User> {
11+
* class UsersController extends InMemoryDBEntityAsyncController<User> {
1212
*
1313
* constructor(protected dbService: InMemoryDBService<User>) {
1414
* super(dbService);
@@ -18,7 +18,7 @@ import { Observable } from 'rxjs';
1818
*
1919
* ```
2020
*/
21-
export abstract class InMemoryDbEntityAsyncController<
21+
export abstract class InMemoryDBEntityAsyncController<
2222
T extends InMemoryDBEntity
2323
> {
2424
constructor(protected readonly dbService: InMemoryDBService<T>) {}

lib/controllers/in-memory-db.controller.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { InMemoryDBEntity } from '../interfaces';
22
import { inMemoryDBServiceFactory } from '../factories';
3-
import { InMemoryDbEntityController } from './in-memory-db.controller';
3+
import { InMemoryDBEntityController } from './in-memory-db.controller';
44
import { InMemoryDBService } from '../services';
55

66
describe('In Memory DB Controller', () => {
77
interface TestEntity extends InMemoryDBEntity {
88
someField: string;
99
}
1010

11-
let controller: InMemoryDbEntityController<TestEntity>;
11+
let controller: InMemoryDBEntityController<TestEntity>;
1212
let service: InMemoryDBService<TestEntity>;
1313

1414
const sampleRecords: TestEntity[] = [
@@ -17,7 +17,7 @@ describe('In Memory DB Controller', () => {
1717
{ id: 3, someField: 'CCC' },
1818
];
1919

20-
class MockController extends InMemoryDbEntityController<TestEntity> {
20+
class MockController extends InMemoryDBEntityController<TestEntity> {
2121
constructor(protected dbService: InMemoryDBService<TestEntity>) {
2222
super(dbService);
2323
}

lib/controllers/in-memory-db.controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { InMemoryDBEntity } from '../interfaces';
77
*
88
* ```ts
99
* @Controller('api/user')
10-
* class UsersController extends InMemoryDbController<User> {
10+
* class UsersController extends InMemoryDBController<User> {
1111
*
1212
* constructor(protected dbService: InMemoryDBService<User>) {
1313
* super(dbService);
@@ -17,7 +17,7 @@ import { InMemoryDBEntity } from '../interfaces';
1717
*
1818
* ```
1919
*/
20-
export abstract class InMemoryDbEntityController<T extends InMemoryDBEntity> {
20+
export abstract class InMemoryDBEntityController<T extends InMemoryDBEntity> {
2121
constructor(protected readonly dbService: InMemoryDBService<T>) {}
2222

2323
@Post()

0 commit comments

Comments
 (0)