@@ -233,7 +233,7 @@ For all entities we want to create, we need to define a factory. To do so we giv
233233
234234| Types | Description |
235235| --------------- | ------------------------------------------------------------------------------- |
236- | ` Entity ` | TypeORM Entity like the user or the pet in the samples. |
236+ | ` Entity ` | TypeORM Entity like the user or the pet in the samples. |
237237| ` Context ` | Argument to pass some static data into the factory function. |
238238| ` EntityFactory ` | This object is used to make new filled entities or create it into the database. |
239239
@@ -242,7 +242,7 @@ For all entities we want to create, we need to define a factory. To do so we giv
242242The define function creates a new entity factory.
243243
244244``` typescript
245- define : <Entity , Context >(entity : Entity , factoryFn : FactoryFunction <Entity , Context >) => void ;
245+ define : <Entity extends ObjectLiteral , Context >(entity : Entity , factoryFn : FactoryFunction <Entity , Context >) => void ;
246246```
247247
248248``` typescript
@@ -258,7 +258,7 @@ define(User, (faker: typeof Faker, context: { roles: string[] }) => { ... })
258258Factory retrieves the defined factory function and returns the EntityFactory to start creating new enities.
259259
260260``` typescript
261- factory : (entity : Entity ) => (context ? : Context ) => EntityFactory < Entity , Context >
261+ factory : (entity : Entity extends ObjectLiteral ) => (context ? : Context ) => EntityFactory <Entity , Context >
262262` ` `
263263
264264` ` ` typescript
@@ -273,7 +273,7 @@ factory(Pet)({ name: 'Balou' })
273273Use the ` .map ()` function to alter the generated value before they get persisted.
274274
275275` ` ` typescript
276- map (mapFunction : (entity : Entity ) => Promise < Entity > ): EntityFactory < Entity , Context >
276+ map (mapFunction : (entity : Entity extends ObjectLiteral ) => Promise <Entity >): EntityFactory <Entity , Context >
277277` ` `
278278
279279` ` ` typescript
0 commit comments