File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " typical-data" ,
3
- "version" : " 0.4.1 " ,
3
+ "version" : " 0.4.2 " ,
4
4
"description" : " Test data factory" ,
5
5
"homepage" : " https://github.com/davidtkramer/typical-data" ,
6
6
"main" : " ./dist/index.js" ,
Original file line number Diff line number Diff line change @@ -265,6 +265,7 @@ describe('DSL', () => {
265
265
interface BaseContact {
266
266
id : number ;
267
267
phone : string ;
268
+ meta ?: string ;
268
269
}
269
270
const baseFactory = createFactory ( ( factory ) =>
270
271
factory
@@ -275,6 +276,7 @@ describe('DSL', () => {
275
276
id : 1 ,
276
277
phone : ( { transientParams } ) =>
277
278
`(${ transientParams . areaCode } ) 123-4567` ,
279
+ meta : undefined ,
278
280
} )
279
281
. trait ( 'invalidPhone' , { phone : 'asdf' } )
280
282
. trait ( 'withCountryCode' , ( trait ) =>
Original file line number Diff line number Diff line change @@ -9,10 +9,11 @@ export type TransientParamsForTraits<
9
9
/**
10
10
* Converts a union of values to an intersection of values.
11
11
*/
12
- export type Intersect < U > = {
13
- [ K in GetKeys < U > ] : U extends Record < K , infer T > ? T : never ;
14
- } ;
15
- type GetKeys < U > = U extends Record < infer K , any > ? K : never ;
12
+ export type Intersect < T > = ( T extends any ? ( x : T ) => any : never ) extends (
13
+ x : infer R
14
+ ) => any
15
+ ? R
16
+ : never ;
16
17
17
18
/**
18
19
* Makes optional the keys on Child that also exist on Parent.
You can’t perform that action at this time.
0 commit comments