@strictly/define 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.out/tsconfig.tsbuildinfo +1 -1
- package/.out/types/specs/flattened_accessors_of_type.tests.js +1 -2
- package/.out/types/specs/flattened_types_of_type.tests.js +8 -16
- package/.out/types/specs/flattened_validators_of_validating_type.tests.js +2 -4
- package/.out/types/specs/flattened_values_of_type.tests.js +2 -4
- package/.out/types/specs/partial_type_of_type.tests.js +6 -12
- package/.out/types/specs/paths_of_type.tests.js +23 -39
- package/.out/types/specs/readonly_type_of_type.tests.js +7 -14
- package/.out/types/specs/strict_definitions.tests.js +2 -4
- package/.out/types/specs/type_of_type.tests.js +3 -6
- package/.out/types/specs/value_of_type.tests.js +13 -26
- package/.out/types/specs/value_to_type_paths_of_type.tests.js +8 -16
- package/.out/validation/specs/errors_of_validators.tests.js +1 -2
- package/.out/validation/specs/validators_of_values.tests.js +3 -6
- package/.turbo/turbo-build.log +5 -5
- package/.turbo/turbo-check-types.log +1 -1
- package/package.json +1 -1
- package/types/specs/flattened_accessors_of_type.tests.ts +2 -2
- package/types/specs/flattened_types_of_type.tests.ts +16 -16
- package/types/specs/flattened_validators_of_validating_type.tests.ts +4 -4
- package/types/specs/flattened_values_of_type.tests.ts +4 -4
- package/types/specs/partial_type_of_type.tests.ts +12 -12
- package/types/specs/paths_of_type.tests.ts +39 -39
- package/types/specs/readonly_type_of_type.tests.ts +14 -14
- package/types/specs/strict_definitions.tests.ts +6 -6
- package/types/specs/type_of_type.tests.ts +6 -6
- package/types/specs/value_of_type.tests.ts +26 -26
- package/types/specs/value_to_type_paths_of_type.tests.ts +16 -16
- package/validation/specs/errors_of_validators.tests.ts +2 -2
- package/validation/specs/validators_of_values.tests.ts +6 -6
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
import { booleanType, list, nullable, numberType, object, record, stringType, union, } from 'types/builders';
|
|
2
2
|
describe('ValueToTypePathsOfType', function () {
|
|
3
3
|
describe('literal', function () {
|
|
4
|
-
let t;
|
|
5
4
|
it('equals expected type', function () {
|
|
6
|
-
expectTypeOf(
|
|
5
|
+
expectTypeOf().toEqualTypeOf();
|
|
7
6
|
});
|
|
8
7
|
});
|
|
9
8
|
describe('list', function () {
|
|
10
9
|
const builder = list(list(numberType));
|
|
11
|
-
let t;
|
|
12
10
|
it('equals expected type', function () {
|
|
13
|
-
expectTypeOf(
|
|
11
|
+
expectTypeOf().toEqualTypeOf();
|
|
14
12
|
});
|
|
15
13
|
});
|
|
16
14
|
describe('record', function () {
|
|
17
15
|
const l = list(numberType);
|
|
18
16
|
const builder = record(l);
|
|
19
|
-
let t;
|
|
20
17
|
it('equals expected type', function () {
|
|
21
|
-
expectTypeOf(
|
|
18
|
+
expectTypeOf().toEqualTypeOf();
|
|
22
19
|
});
|
|
23
20
|
it('allows lookup of type path', function () {
|
|
24
21
|
expectTypeOf().toEqualTypeOf();
|
|
@@ -30,9 +27,8 @@ describe('ValueToTypePathsOfType', function () {
|
|
|
30
27
|
.optionalField('b', booleanType)
|
|
31
28
|
.readonlyField('c', stringType)
|
|
32
29
|
.readonlyOptionalField('d', stringType);
|
|
33
|
-
let t;
|
|
34
30
|
it('equals expected type', function () {
|
|
35
|
-
expectTypeOf(
|
|
31
|
+
expectTypeOf().toEqualTypeOf();
|
|
36
32
|
});
|
|
37
33
|
it('has the same value paths', function () {
|
|
38
34
|
expectTypeOf().toEqualTypeOf();
|
|
@@ -46,18 +42,16 @@ describe('ValueToTypePathsOfType', function () {
|
|
|
46
42
|
const builder = union()
|
|
47
43
|
.or('1', list(numberType))
|
|
48
44
|
.or('2', stringType);
|
|
49
|
-
let t;
|
|
50
45
|
it('equals expected type', function () {
|
|
51
|
-
expectTypeOf(
|
|
46
|
+
expectTypeOf().toEqualTypeOf();
|
|
52
47
|
});
|
|
53
48
|
});
|
|
54
49
|
describe('discriminated', function () {
|
|
55
50
|
const builder = union('d')
|
|
56
51
|
.or('1', object().field('a', booleanType).field('b', numberType))
|
|
57
52
|
.or('2', object().field('x', numberType).field('y', stringType));
|
|
58
|
-
let t;
|
|
59
53
|
it('equals expected type', function () {
|
|
60
|
-
expectTypeOf(
|
|
54
|
+
expectTypeOf().toEqualTypeOf();
|
|
61
55
|
});
|
|
62
56
|
it('has the same value paths', function () {
|
|
63
57
|
expectTypeOf().toEqualTypeOf();
|
|
@@ -69,16 +63,14 @@ describe('ValueToTypePathsOfType', function () {
|
|
|
69
63
|
});
|
|
70
64
|
describe('readonly', function () {
|
|
71
65
|
const builder = list(list(numberType)).readonly();
|
|
72
|
-
let t;
|
|
73
66
|
it('equals expected type', function () {
|
|
74
|
-
expectTypeOf(
|
|
67
|
+
expectTypeOf().toEqualTypeOf();
|
|
75
68
|
});
|
|
76
69
|
});
|
|
77
70
|
describe('nullable', function () {
|
|
78
71
|
const builder = nullable(list(nullable(list(numberType))));
|
|
79
|
-
let t;
|
|
80
72
|
it('equals expected type', function () {
|
|
81
|
-
expectTypeOf(
|
|
73
|
+
expectTypeOf().toEqualTypeOf();
|
|
82
74
|
});
|
|
83
75
|
it('has the same value paths', function () {
|
|
84
76
|
expectTypeOf().toEqualTypeOf();
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
describe('FlattenedValidatorsOfType', function () {
|
|
2
2
|
describe('literal', function () {
|
|
3
|
-
let t;
|
|
4
3
|
it('has the expected type', function () {
|
|
5
|
-
expectTypeOf().toEqualTypeOf(
|
|
4
|
+
expectTypeOf().toEqualTypeOf();
|
|
6
5
|
});
|
|
7
6
|
});
|
|
8
7
|
describe('list', function () {
|
|
9
|
-
let t;
|
|
10
8
|
it('has the expected type', function () {
|
|
11
|
-
expectTypeOf().toEqualTypeOf(
|
|
9
|
+
expectTypeOf().toEqualTypeOf();
|
|
12
10
|
});
|
|
13
11
|
});
|
|
14
12
|
describe('with defaults', function () {
|
|
15
|
-
let t;
|
|
16
13
|
it('has the expected type', function () {
|
|
17
|
-
expectTypeOf().toEqualTypeOf(
|
|
14
|
+
expectTypeOf().toEqualTypeOf();
|
|
18
15
|
});
|
|
19
16
|
});
|
|
20
17
|
});
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -7,12 +7,12 @@ $ tsup
|
|
|
7
7
|
[34mCLI[39m Target: esnext
|
|
8
8
|
[34mCJS[39m Build start
|
|
9
9
|
[34mESM[39m Build start
|
|
10
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m26.92 KB[39m
|
|
11
|
-
[32mCJS[39m ⚡️ Build success in 59ms
|
|
12
10
|
[32mESM[39m [1mdist/index.js [22m[32m24.72 KB[39m
|
|
13
|
-
[32mESM[39m ⚡️ Build success in
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 65ms
|
|
12
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m26.92 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 66ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
|
-
[32mDTS[39m ⚡️ Build success in
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 5516ms
|
|
16
16
|
[32mDTS[39m [1mdist/index.d.cts [22m[32m38.05 KB[39m
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m38.05 KB[39m
|
|
18
|
-
Done in 6.
|
|
18
|
+
Done in 6.38s.
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ describe('FlattenedAccessorsOfType', function () {
|
|
|
10
10
|
const builder = record<typeof numberType, string>(numberType)
|
|
11
11
|
type V = FlattenedAccessorsOfType<typeof builder>
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
type C = {
|
|
14
14
|
readonly $: {
|
|
15
15
|
readonly value: Record<string, number>,
|
|
16
16
|
set: (v: Record<string, number>) => void,
|
|
@@ -21,7 +21,7 @@ describe('FlattenedAccessorsOfType', function () {
|
|
|
21
21
|
},
|
|
22
22
|
}
|
|
23
23
|
it('equals expected type', function () {
|
|
24
|
-
expectTypeOf(
|
|
24
|
+
expectTypeOf<C>().toEqualTypeOf<V>()
|
|
25
25
|
})
|
|
26
26
|
})
|
|
27
27
|
})
|
|
@@ -15,7 +15,7 @@ describe('FlattenedTypesOfType', function () {
|
|
|
15
15
|
describe('literal', function () {
|
|
16
16
|
type T = FlattenedTypesOfType<typeof numberType._type, null>
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
type C = {
|
|
19
19
|
readonly $: {
|
|
20
20
|
readonly definition: {
|
|
21
21
|
readonly type: TypeDefType.Literal,
|
|
@@ -24,7 +24,7 @@ describe('FlattenedTypesOfType', function () {
|
|
|
24
24
|
},
|
|
25
25
|
}
|
|
26
26
|
it('equals expected type', function () {
|
|
27
|
-
expectTypeOf(
|
|
27
|
+
expectTypeOf<C>().toEqualTypeOf<T>()
|
|
28
28
|
})
|
|
29
29
|
})
|
|
30
30
|
|
|
@@ -32,7 +32,7 @@ describe('FlattenedTypesOfType', function () {
|
|
|
32
32
|
const builder = list(numberType)
|
|
33
33
|
type T = SimplifyDeep<FlattenedTypesOfType<typeof builder._type, '*'>>
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
type C = {
|
|
36
36
|
readonly $: SimplifyDeep<typeof builder._type>,
|
|
37
37
|
readonly ['$.*']: {
|
|
38
38
|
readonly definition: {
|
|
@@ -42,7 +42,7 @@ describe('FlattenedTypesOfType', function () {
|
|
|
42
42
|
},
|
|
43
43
|
}
|
|
44
44
|
it('equals expected type', function () {
|
|
45
|
-
expectTypeOf(
|
|
45
|
+
expectTypeOf<C>().toEqualTypeOf<T>()
|
|
46
46
|
})
|
|
47
47
|
})
|
|
48
48
|
|
|
@@ -50,7 +50,7 @@ describe('FlattenedTypesOfType', function () {
|
|
|
50
50
|
const builder = record<typeof numberType, 'a' | 'b'>(numberType)
|
|
51
51
|
type T = SimplifyDeep<FlattenedTypesOfType<typeof builder._type, '*'>>
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
type C = {
|
|
54
54
|
readonly $: SimplifyDeep<typeof builder._type>,
|
|
55
55
|
readonly ['$.*']: {
|
|
56
56
|
readonly definition: {
|
|
@@ -60,7 +60,7 @@ describe('FlattenedTypesOfType', function () {
|
|
|
60
60
|
},
|
|
61
61
|
}
|
|
62
62
|
it('equals expected type', function () {
|
|
63
|
-
expectTypeOf<
|
|
63
|
+
expectTypeOf<C>().toEqualTypeOf<T>()
|
|
64
64
|
})
|
|
65
65
|
})
|
|
66
66
|
|
|
@@ -72,7 +72,7 @@ describe('FlattenedTypesOfType', function () {
|
|
|
72
72
|
.readonlyField('c', booleanType)
|
|
73
73
|
.readonlyOptionalField('d', stringType)
|
|
74
74
|
type T = SimplifyDeep<FlattenedTypesOfType<typeof builder._type, null>>
|
|
75
|
-
|
|
75
|
+
type C = {
|
|
76
76
|
readonly $: SimplifyDeep<typeof builder._type>,
|
|
77
77
|
readonly ['$.a']: {
|
|
78
78
|
readonly definition: {
|
|
@@ -120,7 +120,7 @@ describe('FlattenedTypesOfType', function () {
|
|
|
120
120
|
},
|
|
121
121
|
}
|
|
122
122
|
it('equals expected type', function () {
|
|
123
|
-
expectTypeOf(
|
|
123
|
+
expectTypeOf<C>().toEqualTypeOf<T>()
|
|
124
124
|
})
|
|
125
125
|
})
|
|
126
126
|
|
|
@@ -128,7 +128,7 @@ describe('FlattenedTypesOfType', function () {
|
|
|
128
128
|
const builder = object().optionalField('a', stringType)
|
|
129
129
|
type T = SimplifyDeep<FlattenedTypesOfType<typeof builder._type, null>>
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
type C = {
|
|
132
132
|
readonly $: SimplifyDeep<typeof builder._type>,
|
|
133
133
|
readonly '$.a': {
|
|
134
134
|
readonly definition: {
|
|
@@ -149,7 +149,7 @@ describe('FlattenedTypesOfType', function () {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
it('equals expected type', function () {
|
|
152
|
-
expectTypeOf(
|
|
152
|
+
expectTypeOf<C>().toEqualTypeOf<T>()
|
|
153
153
|
})
|
|
154
154
|
})
|
|
155
155
|
})
|
|
@@ -163,7 +163,7 @@ describe('union', function () {
|
|
|
163
163
|
.or('y', object().field('b', numberType))
|
|
164
164
|
type T = SimplifyDeep<FlattenedTypesOfType<typeof builder._type, null>>
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
type C = {
|
|
167
167
|
readonly $: SimplifyDeep<typeof builder._type>,
|
|
168
168
|
readonly ['$.a']: {
|
|
169
169
|
readonly definition: {
|
|
@@ -180,7 +180,7 @@ describe('union', function () {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
it('equals expected type', function () {
|
|
183
|
-
expectTypeOf(
|
|
183
|
+
expectTypeOf<C>().toEqualTypeOf<T>()
|
|
184
184
|
})
|
|
185
185
|
})
|
|
186
186
|
|
|
@@ -190,7 +190,7 @@ describe('union', function () {
|
|
|
190
190
|
.or('2', object().field('a', numberType))
|
|
191
191
|
type T = SimplifyDeep<FlattenedTypesOfType<typeof builder._type, null>>
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
type C = {
|
|
194
194
|
readonly $: SimplifyDeep<typeof builder._type>,
|
|
195
195
|
readonly ['$.1:a']: {
|
|
196
196
|
readonly definition: {
|
|
@@ -206,7 +206,7 @@ describe('union', function () {
|
|
|
206
206
|
},
|
|
207
207
|
}
|
|
208
208
|
it('equals expected type', function () {
|
|
209
|
-
expectTypeOf(
|
|
209
|
+
expectTypeOf<C>().toEqualTypeOf<T>()
|
|
210
210
|
})
|
|
211
211
|
})
|
|
212
212
|
|
|
@@ -225,7 +225,7 @@ describe('union', function () {
|
|
|
225
225
|
.or('s', object().field('c', stringType)),
|
|
226
226
|
)
|
|
227
227
|
type T = SimplifyDeep<FlattenedTypesOfType<typeof builder._type, null>>
|
|
228
|
-
|
|
228
|
+
type C = {
|
|
229
229
|
readonly $: SimplifyDeep<typeof builder._type>,
|
|
230
230
|
readonly ['$.1:p:a']: {
|
|
231
231
|
readonly definition: {
|
|
@@ -253,7 +253,7 @@ describe('union', function () {
|
|
|
253
253
|
},
|
|
254
254
|
}
|
|
255
255
|
it('equals expected type', function () {
|
|
256
|
-
expectTypeOf(
|
|
256
|
+
expectTypeOf<C>().toEqualTypeOf<T>()
|
|
257
257
|
})
|
|
258
258
|
})
|
|
259
259
|
})
|
|
@@ -17,12 +17,12 @@ describe('FlattenedValidatorsOfValidatingType', function () {
|
|
|
17
17
|
Reverse<ValueToTypePathsOfType<typeof literalType>>
|
|
18
18
|
>
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
type C = {
|
|
21
21
|
readonly $: Validator<number, 'a', '$', number>,
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
it('equals expected type', function () {
|
|
25
|
-
expectTypeOf<T>().toEqualTypeOf(
|
|
25
|
+
expectTypeOf<T>().toEqualTypeOf<C>()
|
|
26
26
|
})
|
|
27
27
|
})
|
|
28
28
|
|
|
@@ -35,13 +35,13 @@ describe('FlattenedValidatorsOfValidatingType', function () {
|
|
|
35
35
|
})
|
|
36
36
|
type T = FlattenedValidatorsOfValidatingType<typeof listType, Reverse<ValueToTypePathsOfType<typeof listType>>>
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
type C = {
|
|
39
39
|
readonly $: Validator<readonly number[], 'y', '$', readonly number[]>,
|
|
40
40
|
readonly '$.*': Validator<number, 'x', `$.${number}`, readonly number[]>,
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
it('equals expected type', function () {
|
|
44
|
-
expectTypeOf<T>().toEqualTypeOf(
|
|
44
|
+
expectTypeOf<T>().toEqualTypeOf<C>()
|
|
45
45
|
})
|
|
46
46
|
})
|
|
47
47
|
})
|
|
@@ -12,12 +12,12 @@ describe('FlattenedValuesOfType', function () {
|
|
|
12
12
|
const builder = record<typeof numberType, string>(numberType)
|
|
13
13
|
type V = FlattenedValuesOfType<typeof builder.narrow>
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
type C = {
|
|
16
16
|
readonly $: Record<string, number>,
|
|
17
17
|
readonly [_: `$.${string}`]: number,
|
|
18
18
|
}
|
|
19
19
|
it('equals expected type', function () {
|
|
20
|
-
expectTypeOf(
|
|
20
|
+
expectTypeOf<C>().toEqualTypeOf<V>()
|
|
21
21
|
})
|
|
22
22
|
})
|
|
23
23
|
|
|
@@ -25,7 +25,7 @@ describe('FlattenedValuesOfType', function () {
|
|
|
25
25
|
const builder = object().optionalField('a', stringType)
|
|
26
26
|
type V = FlattenedValuesOfType<typeof builder>
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
type C = {
|
|
29
29
|
readonly $: {
|
|
30
30
|
a?: string | undefined,
|
|
31
31
|
},
|
|
@@ -33,7 +33,7 @@ describe('FlattenedValuesOfType', function () {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
it('equals expected type', function () {
|
|
36
|
-
expectTypeOf(
|
|
36
|
+
expectTypeOf<C>().toEqualTypeOf<V>()
|
|
37
37
|
})
|
|
38
38
|
})
|
|
39
39
|
})
|
|
@@ -14,7 +14,7 @@ describe('PartialTypeDefOf', function () {
|
|
|
14
14
|
describe('literal', function () {
|
|
15
15
|
type T = PartialTypeOfType<typeof numberType._type>
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
type C = {
|
|
18
18
|
readonly typeDef: {
|
|
19
19
|
readonly type: TypeDefType.Union,
|
|
20
20
|
readonly discriminator: null,
|
|
@@ -32,7 +32,7 @@ describe('PartialTypeDefOf', function () {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
it('equals expected type', function () {
|
|
35
|
-
expectTypeOf(
|
|
35
|
+
expectTypeOf<C>().toEqualTypeOf<T>()
|
|
36
36
|
})
|
|
37
37
|
})
|
|
38
38
|
|
|
@@ -40,7 +40,7 @@ describe('PartialTypeDefOf', function () {
|
|
|
40
40
|
const builder = list(numberType)
|
|
41
41
|
type T = PartialTypeOfType<typeof builder._type>
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
type C = {
|
|
44
44
|
readonly typeDef: {
|
|
45
45
|
readonly type: TypeDefType.Union,
|
|
46
46
|
readonly discriminator: null,
|
|
@@ -70,7 +70,7 @@ describe('PartialTypeDefOf', function () {
|
|
|
70
70
|
},
|
|
71
71
|
}
|
|
72
72
|
it('equals expected type', function () {
|
|
73
|
-
expectTypeOf(
|
|
73
|
+
expectTypeOf<C>().toEqualTypeOf<T>()
|
|
74
74
|
})
|
|
75
75
|
})
|
|
76
76
|
|
|
@@ -78,7 +78,7 @@ describe('PartialTypeDefOf', function () {
|
|
|
78
78
|
const builder = record<typeof numberType, 'a' | 'b'>(numberType)
|
|
79
79
|
type T = SimplifyDeep<PartialTypeOfType<typeof builder._type>>
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
type C = {
|
|
82
82
|
readonly typeDef: {
|
|
83
83
|
readonly type: TypeDefType.Union,
|
|
84
84
|
readonly discriminator: null,
|
|
@@ -110,7 +110,7 @@ describe('PartialTypeDefOf', function () {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
it('equals expected type', function () {
|
|
113
|
-
expectTypeOf(
|
|
113
|
+
expectTypeOf<C>().toEqualTypeOf<T>()
|
|
114
114
|
})
|
|
115
115
|
})
|
|
116
116
|
|
|
@@ -120,7 +120,7 @@ describe('PartialTypeDefOf', function () {
|
|
|
120
120
|
.readonlyField('b', stringType)
|
|
121
121
|
type T = PartialTypeOfType<typeof builder._type>
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
type C = {
|
|
124
124
|
readonly typeDef: {
|
|
125
125
|
readonly type: TypeDefType.Union,
|
|
126
126
|
readonly discriminator: null,
|
|
@@ -167,7 +167,7 @@ describe('PartialTypeDefOf', function () {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
it('equals expected type', function () {
|
|
170
|
-
expectTypeOf(
|
|
170
|
+
expectTypeOf<C>().toEqualTypeOf<T>()
|
|
171
171
|
})
|
|
172
172
|
})
|
|
173
173
|
|
|
@@ -178,7 +178,7 @@ describe('PartialTypeDefOf', function () {
|
|
|
178
178
|
.or('2', stringType)
|
|
179
179
|
type T = PartialTypeOfType<typeof builder._type>
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
type C = {
|
|
182
182
|
readonly typeDef: {
|
|
183
183
|
readonly type: TypeDefType.Union,
|
|
184
184
|
readonly discriminator: null,
|
|
@@ -206,7 +206,7 @@ describe('PartialTypeDefOf', function () {
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
it('equals expected type', function () {
|
|
209
|
-
expectTypeOf(
|
|
209
|
+
expectTypeOf<C>().toEqualTypeOf<T>()
|
|
210
210
|
})
|
|
211
211
|
})
|
|
212
212
|
})
|
|
@@ -215,7 +215,7 @@ describe('PartialTypeDefOf', function () {
|
|
|
215
215
|
const builder = list(numberType).readonly()
|
|
216
216
|
type T = PartialTypeOfType<typeof builder._type>
|
|
217
217
|
|
|
218
|
-
|
|
218
|
+
type C = {
|
|
219
219
|
readonly typeDef: {
|
|
220
220
|
readonly type: TypeDefType.Union,
|
|
221
221
|
readonly discriminator: null,
|
|
@@ -245,7 +245,7 @@ describe('PartialTypeDefOf', function () {
|
|
|
245
245
|
},
|
|
246
246
|
}
|
|
247
247
|
it('equals expected type', function () {
|
|
248
|
-
expectTypeOf(
|
|
248
|
+
expectTypeOf<C>().toEqualTypeOf<T>()
|
|
249
249
|
})
|
|
250
250
|
})
|
|
251
251
|
})
|