@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
|
@@ -3,9 +3,8 @@ describe('FlattenedAccessorsOfType', function () {
|
|
|
3
3
|
// note we only test a small example since most of the work is done in flatten
|
|
4
4
|
describe('record', function () {
|
|
5
5
|
const builder = record(numberType);
|
|
6
|
-
let v;
|
|
7
6
|
it('equals expected type', function () {
|
|
8
|
-
expectTypeOf(
|
|
7
|
+
expectTypeOf().toEqualTypeOf();
|
|
9
8
|
});
|
|
10
9
|
});
|
|
11
10
|
});
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { booleanType, list, numberType, object, record, stringType, union, } from 'types/builders';
|
|
2
2
|
describe('FlattenedTypesOfType', 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(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 builder = record(numberType);
|
|
18
|
-
let t;
|
|
19
16
|
it('equals expected type', function () {
|
|
20
|
-
expectTypeOf(
|
|
17
|
+
expectTypeOf().toEqualTypeOf();
|
|
21
18
|
});
|
|
22
19
|
});
|
|
23
20
|
describe('object', function () {
|
|
@@ -27,16 +24,14 @@ describe('FlattenedTypesOfType', function () {
|
|
|
27
24
|
.optionalField('b', stringType)
|
|
28
25
|
.readonlyField('c', booleanType)
|
|
29
26
|
.readonlyOptionalField('d', stringType);
|
|
30
|
-
let t;
|
|
31
27
|
it('equals expected type', function () {
|
|
32
|
-
expectTypeOf(
|
|
28
|
+
expectTypeOf().toEqualTypeOf();
|
|
33
29
|
});
|
|
34
30
|
});
|
|
35
31
|
describe('optional', function () {
|
|
36
32
|
const builder = object().optionalField('a', stringType);
|
|
37
|
-
let t;
|
|
38
33
|
it('equals expected type', function () {
|
|
39
|
-
expectTypeOf(
|
|
34
|
+
expectTypeOf().toEqualTypeOf();
|
|
40
35
|
});
|
|
41
36
|
});
|
|
42
37
|
});
|
|
@@ -47,18 +42,16 @@ describe('union', function () {
|
|
|
47
42
|
const builder = union()
|
|
48
43
|
.or('x', object().field('a', booleanType))
|
|
49
44
|
.or('y', object().field('b', numberType));
|
|
50
|
-
let t;
|
|
51
45
|
it('equals expected type', function () {
|
|
52
|
-
expectTypeOf(
|
|
46
|
+
expectTypeOf().toEqualTypeOf();
|
|
53
47
|
});
|
|
54
48
|
});
|
|
55
49
|
describe('discriminated', function () {
|
|
56
50
|
const builder = union('x')
|
|
57
51
|
.or('1', object().field('a', booleanType))
|
|
58
52
|
.or('2', object().field('a', numberType));
|
|
59
|
-
let t;
|
|
60
53
|
it('equals expected type', function () {
|
|
61
|
-
expectTypeOf(
|
|
54
|
+
expectTypeOf().toEqualTypeOf();
|
|
62
55
|
});
|
|
63
56
|
});
|
|
64
57
|
describe('nested discriminated', function () {
|
|
@@ -69,9 +62,8 @@ describe('union', function () {
|
|
|
69
62
|
.or('2', union('z')
|
|
70
63
|
.or('r', object().field('b', numberType))
|
|
71
64
|
.or('s', object().field('c', stringType)));
|
|
72
|
-
let t;
|
|
73
65
|
it('equals expected type', function () {
|
|
74
|
-
expectTypeOf(
|
|
66
|
+
expectTypeOf().toEqualTypeOf();
|
|
75
67
|
});
|
|
76
68
|
});
|
|
77
69
|
});
|
|
@@ -4,9 +4,8 @@ describe('FlattenedValidatorsOfValidatingType', function () {
|
|
|
4
4
|
const literalType = numberType.enforce(function () {
|
|
5
5
|
return 'a';
|
|
6
6
|
});
|
|
7
|
-
let t;
|
|
8
7
|
it('equals expected type', function () {
|
|
9
|
-
expectTypeOf().toEqualTypeOf(
|
|
8
|
+
expectTypeOf().toEqualTypeOf();
|
|
10
9
|
});
|
|
11
10
|
});
|
|
12
11
|
describe('list', function () {
|
|
@@ -16,9 +15,8 @@ describe('FlattenedValidatorsOfValidatingType', function () {
|
|
|
16
15
|
const listType = list(literalType.narrow).enforce(function () {
|
|
17
16
|
return 'y';
|
|
18
17
|
});
|
|
19
|
-
let t;
|
|
20
18
|
it('equals expected type', function () {
|
|
21
|
-
expectTypeOf().toEqualTypeOf(
|
|
19
|
+
expectTypeOf().toEqualTypeOf();
|
|
22
20
|
});
|
|
23
21
|
});
|
|
24
22
|
});
|
|
@@ -3,16 +3,14 @@ describe('FlattenedValuesOfType', function () {
|
|
|
3
3
|
// note we only test a small example since most of the work is done in flatten
|
|
4
4
|
describe('record', function () {
|
|
5
5
|
const builder = record(numberType);
|
|
6
|
-
let v;
|
|
7
6
|
it('equals expected type', function () {
|
|
8
|
-
expectTypeOf(
|
|
7
|
+
expectTypeOf().toEqualTypeOf();
|
|
9
8
|
});
|
|
10
9
|
});
|
|
11
10
|
describe('object', function () {
|
|
12
11
|
const builder = object().optionalField('a', stringType);
|
|
13
|
-
let v;
|
|
14
12
|
it('equals expected type', function () {
|
|
15
|
-
expectTypeOf(
|
|
13
|
+
expectTypeOf().toEqualTypeOf();
|
|
16
14
|
});
|
|
17
15
|
});
|
|
18
16
|
});
|
|
@@ -1,32 +1,28 @@
|
|
|
1
1
|
import { list, numberType, object, record, stringType, union, } from 'types/builders';
|
|
2
2
|
describe('PartialTypeDefOf', 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(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 builder = record(numberType);
|
|
18
|
-
let t;
|
|
19
16
|
it('equals expected type', function () {
|
|
20
|
-
expectTypeOf(
|
|
17
|
+
expectTypeOf().toEqualTypeOf();
|
|
21
18
|
});
|
|
22
19
|
});
|
|
23
20
|
describe('object', function () {
|
|
24
21
|
const builder = object()
|
|
25
22
|
.field('a', numberType)
|
|
26
23
|
.readonlyField('b', stringType);
|
|
27
|
-
let t;
|
|
28
24
|
it('equals expected type', function () {
|
|
29
|
-
expectTypeOf(
|
|
25
|
+
expectTypeOf().toEqualTypeOf();
|
|
30
26
|
});
|
|
31
27
|
});
|
|
32
28
|
describe('union', function () {
|
|
@@ -34,17 +30,15 @@ describe('PartialTypeDefOf', function () {
|
|
|
34
30
|
const builder = union()
|
|
35
31
|
.or('1', numberType)
|
|
36
32
|
.or('2', stringType);
|
|
37
|
-
let t;
|
|
38
33
|
it('equals expected type', function () {
|
|
39
|
-
expectTypeOf(
|
|
34
|
+
expectTypeOf().toEqualTypeOf();
|
|
40
35
|
});
|
|
41
36
|
});
|
|
42
37
|
});
|
|
43
38
|
describe('readonly', function () {
|
|
44
39
|
const builder = list(numberType).readonly();
|
|
45
|
-
let t;
|
|
46
40
|
it('equals expected type', function () {
|
|
47
|
-
expectTypeOf(
|
|
41
|
+
expectTypeOf().toEqualTypeOf();
|
|
48
42
|
});
|
|
49
43
|
});
|
|
50
44
|
});
|
|
@@ -1,92 +1,85 @@
|
|
|
1
1
|
import { booleanType, list, nullable, numberType, object, record, stringType, union, } from 'types/builders';
|
|
2
2
|
describe('PathsOfType', function () {
|
|
3
3
|
describe('literal', function () {
|
|
4
|
-
let path;
|
|
5
4
|
describe('regular', function () {
|
|
6
5
|
it('equals expected type', function () {
|
|
7
|
-
expectTypeOf(
|
|
6
|
+
expectTypeOf().toEqualTypeOf();
|
|
8
7
|
});
|
|
9
8
|
});
|
|
10
9
|
describe('nullable', function () {
|
|
11
10
|
const builder = nullable(stringType);
|
|
12
11
|
it('equals expected type', function () {
|
|
13
|
-
expectTypeOf(
|
|
12
|
+
expectTypeOf().toEqualTypeOf();
|
|
14
13
|
});
|
|
15
14
|
});
|
|
16
15
|
});
|
|
17
16
|
describe('list', function () {
|
|
18
|
-
let path;
|
|
19
17
|
describe('mutable', function () {
|
|
20
18
|
const builder = list(stringType);
|
|
21
19
|
it('equals expected type', function () {
|
|
22
|
-
expectTypeOf(
|
|
20
|
+
expectTypeOf().toEqualTypeOf();
|
|
23
21
|
});
|
|
24
22
|
});
|
|
25
23
|
describe('readonly', function () {
|
|
26
24
|
const builder = list(stringType).readonly();
|
|
27
25
|
it('equals expected type', function () {
|
|
28
|
-
expectTypeOf(
|
|
26
|
+
expectTypeOf().toEqualTypeOf();
|
|
29
27
|
});
|
|
30
28
|
});
|
|
31
29
|
describe('nullable', function () {
|
|
32
30
|
const builder = nullable(list(stringType));
|
|
33
31
|
it('equals expected type', function () {
|
|
34
|
-
expectTypeOf(
|
|
32
|
+
expectTypeOf().toEqualTypeOf();
|
|
35
33
|
});
|
|
36
34
|
});
|
|
37
35
|
describe('override', function () {
|
|
38
36
|
const builder = list(stringType);
|
|
39
|
-
let path;
|
|
40
37
|
it('equals expected type', function () {
|
|
41
|
-
expectTypeOf(
|
|
38
|
+
expectTypeOf().toEqualTypeOf();
|
|
42
39
|
});
|
|
43
40
|
});
|
|
44
41
|
});
|
|
45
42
|
describe('record', function () {
|
|
46
|
-
let path;
|
|
47
43
|
describe('mutable', function () {
|
|
48
44
|
const builder = record(stringType);
|
|
49
45
|
it('equals expected type', function () {
|
|
50
|
-
expectTypeOf(
|
|
46
|
+
expectTypeOf().toEqualTypeOf();
|
|
51
47
|
});
|
|
52
48
|
});
|
|
53
49
|
describe('mutable with exact keys', function () {
|
|
54
50
|
const builder = record(stringType);
|
|
55
|
-
let path;
|
|
56
51
|
it('equals expected type', function () {
|
|
57
|
-
expectTypeOf(
|
|
52
|
+
expectTypeOf().toEqualTypeOf();
|
|
58
53
|
});
|
|
59
54
|
});
|
|
60
55
|
describe('mutable with numeric keys', function () {
|
|
61
56
|
const builder = record(stringType);
|
|
62
|
-
let path;
|
|
63
57
|
it('equals expected type', function () {
|
|
64
|
-
expectTypeOf(
|
|
58
|
+
expectTypeOf().toEqualTypeOf();
|
|
65
59
|
});
|
|
66
60
|
});
|
|
67
61
|
describe('readonly', function () {
|
|
68
62
|
const builder = record(stringType).readonly();
|
|
69
63
|
it('equals expected type', function () {
|
|
70
|
-
expectTypeOf(
|
|
64
|
+
expectTypeOf().toEqualTypeOf();
|
|
71
65
|
});
|
|
72
66
|
});
|
|
73
67
|
describe('partial', function () {
|
|
74
68
|
const builder = record(stringType).partialKeys();
|
|
75
69
|
it('equals expected type', function () {
|
|
76
|
-
expectTypeOf(
|
|
70
|
+
expectTypeOf().toEqualTypeOf();
|
|
77
71
|
});
|
|
78
72
|
});
|
|
79
73
|
describe('nullable', function () {
|
|
80
74
|
const builder = nullable(record(stringType));
|
|
81
75
|
it('equals expected type', function () {
|
|
82
|
-
expectTypeOf(
|
|
76
|
+
expectTypeOf().toEqualTypeOf();
|
|
83
77
|
});
|
|
84
78
|
});
|
|
85
79
|
describe('override', function () {
|
|
86
80
|
const builder = record(stringType);
|
|
87
|
-
let path;
|
|
88
81
|
it('equals expected type', function () {
|
|
89
|
-
expectTypeOf(
|
|
82
|
+
expectTypeOf().toEqualTypeOf();
|
|
90
83
|
});
|
|
91
84
|
});
|
|
92
85
|
});
|
|
@@ -96,9 +89,8 @@ describe('PathsOfType', function () {
|
|
|
96
89
|
.field('n', numberType)
|
|
97
90
|
.field('b', booleanType)
|
|
98
91
|
.field('s', stringType);
|
|
99
|
-
let path;
|
|
100
92
|
it('equals expected type', function () {
|
|
101
|
-
expectTypeOf(
|
|
93
|
+
expectTypeOf().toEqualTypeOf();
|
|
102
94
|
});
|
|
103
95
|
it('can be used in a record', function () {
|
|
104
96
|
expectTypeOf({
|
|
@@ -109,31 +101,28 @@ describe('PathsOfType', function () {
|
|
|
109
101
|
}).toEqualTypeOf();
|
|
110
102
|
});
|
|
111
103
|
it('ignores override', function () {
|
|
112
|
-
expectTypeOf(
|
|
104
|
+
expectTypeOf().toEqualTypeOf();
|
|
113
105
|
});
|
|
114
106
|
});
|
|
115
107
|
describe('nested', function () {
|
|
116
108
|
const builder = object()
|
|
117
109
|
.field('s1', object().field('a1', booleanType))
|
|
118
110
|
.field('s2', object().field('a2', stringType));
|
|
119
|
-
let path;
|
|
120
111
|
it('equals expected type', function () {
|
|
121
|
-
expectTypeOf(
|
|
112
|
+
expectTypeOf().toEqualTypeOf();
|
|
122
113
|
});
|
|
123
114
|
});
|
|
124
115
|
describe('object of list', function () {
|
|
125
116
|
const builder = object()
|
|
126
117
|
.field('l', list(numberType));
|
|
127
118
|
describe('no override', function () {
|
|
128
|
-
let path;
|
|
129
119
|
it('equals expected type', function () {
|
|
130
|
-
expectTypeOf(
|
|
120
|
+
expectTypeOf().toEqualTypeOf();
|
|
131
121
|
});
|
|
132
122
|
});
|
|
133
123
|
describe('passes override', function () {
|
|
134
|
-
let path;
|
|
135
124
|
it('equals expected type', function () {
|
|
136
|
-
expectTypeOf(
|
|
125
|
+
expectTypeOf().toEqualTypeOf();
|
|
137
126
|
});
|
|
138
127
|
});
|
|
139
128
|
});
|
|
@@ -143,9 +132,8 @@ describe('PathsOfType', function () {
|
|
|
143
132
|
const builder = union()
|
|
144
133
|
.or('1', numberType)
|
|
145
134
|
.or('2', stringType);
|
|
146
|
-
let path;
|
|
147
135
|
it('equals expected type', function () {
|
|
148
|
-
expectTypeOf(
|
|
136
|
+
expectTypeOf().toEqualTypeOf();
|
|
149
137
|
});
|
|
150
138
|
});
|
|
151
139
|
describe('with overlapping record', function () {
|
|
@@ -153,18 +141,16 @@ describe('PathsOfType', function () {
|
|
|
153
141
|
.or('1', object().field('a', numberType).field('b', stringType))
|
|
154
142
|
.or('2', object().field('b', stringType).field('c', stringType))
|
|
155
143
|
.or('3', object().field('c', stringType).field('a', stringType));
|
|
156
|
-
let path;
|
|
157
144
|
it('equals expected type', function () {
|
|
158
|
-
expectTypeOf(
|
|
145
|
+
expectTypeOf().toEqualTypeOf();
|
|
159
146
|
});
|
|
160
147
|
});
|
|
161
148
|
describe('nested', function () {
|
|
162
149
|
const builder = union()
|
|
163
150
|
.or('1', object().field('a', union().or('x', object().field('aa', stringType))))
|
|
164
151
|
.or('2', object().field('b', union().or('y', object().field('bb', stringType))));
|
|
165
|
-
let path;
|
|
166
152
|
it('equals expected type', function () {
|
|
167
|
-
expectTypeOf(
|
|
153
|
+
expectTypeOf().toEqualTypeOf();
|
|
168
154
|
});
|
|
169
155
|
});
|
|
170
156
|
});
|
|
@@ -172,18 +158,16 @@ describe('PathsOfType', function () {
|
|
|
172
158
|
const builder = union('x')
|
|
173
159
|
.or('1', object().field('a', booleanType))
|
|
174
160
|
.or('2', object().field('b', numberType));
|
|
175
|
-
let path;
|
|
176
161
|
it('equals expected type', function () {
|
|
177
|
-
expectTypeOf(
|
|
162
|
+
expectTypeOf().toEqualTypeOf();
|
|
178
163
|
});
|
|
179
164
|
});
|
|
180
165
|
describe('with nested discriminator', function () {
|
|
181
166
|
const builder = union('x')
|
|
182
167
|
.or('1', union('y').or('p', object().field('a', booleanType)))
|
|
183
168
|
.or('2', union('z').or('q', object().field('b', numberType)));
|
|
184
|
-
let path;
|
|
185
169
|
it('equals expected type', function () {
|
|
186
|
-
expectTypeOf(
|
|
170
|
+
expectTypeOf().toEqualTypeOf();
|
|
187
171
|
});
|
|
188
172
|
});
|
|
189
173
|
// breaks linting
|
|
@@ -1,55 +1,48 @@
|
|
|
1
1
|
import { list, numberType, object, record, stringType, union, } from 'types/builders';
|
|
2
2
|
describe('ReadonlyTypeDefOf', 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(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 builder = record(numberType);
|
|
18
|
-
let t;
|
|
19
16
|
it('equals expected type', function () {
|
|
20
|
-
expectTypeOf(
|
|
17
|
+
expectTypeOf().toEqualTypeOf();
|
|
21
18
|
});
|
|
22
19
|
});
|
|
23
20
|
describe('object', function () {
|
|
24
21
|
const builder = object()
|
|
25
22
|
.field('a', numberType)
|
|
26
23
|
.optionalField('b', stringType);
|
|
27
|
-
let t;
|
|
28
24
|
it('equals expected type', function () {
|
|
29
|
-
expectTypeOf(
|
|
25
|
+
expectTypeOf().toEqualTypeOf();
|
|
30
26
|
});
|
|
31
27
|
});
|
|
32
28
|
describe('union', function () {
|
|
33
29
|
const builder = union()
|
|
34
30
|
.or('1', record(numberType))
|
|
35
31
|
.or('2', stringType);
|
|
36
|
-
let t;
|
|
37
32
|
it('equals expected type', function () {
|
|
38
|
-
expectTypeOf(
|
|
33
|
+
expectTypeOf().toEqualTypeOf();
|
|
39
34
|
});
|
|
40
35
|
});
|
|
41
36
|
describe('partial', function () {
|
|
42
37
|
const builder = record(numberType).partialKeys();
|
|
43
|
-
let t;
|
|
44
38
|
it('equals expected type', function () {
|
|
45
|
-
expectTypeOf(
|
|
39
|
+
expectTypeOf().toEqualTypeOf();
|
|
46
40
|
});
|
|
47
41
|
});
|
|
48
42
|
describe('readonly', function () {
|
|
49
43
|
const builder = record(numberType).readonlyKeys();
|
|
50
|
-
let t;
|
|
51
44
|
it('equals expected type', function () {
|
|
52
|
-
expectTypeOf(
|
|
45
|
+
expectTypeOf().toEqualTypeOf();
|
|
53
46
|
});
|
|
54
47
|
});
|
|
55
48
|
});
|
|
@@ -26,16 +26,14 @@ describe('Strict Definitions', function () {
|
|
|
26
26
|
});
|
|
27
27
|
describe('assignment', function () {
|
|
28
28
|
describe('can be assigned to a non-strict equivalent type', function () {
|
|
29
|
-
let t;
|
|
30
29
|
it('equals type', function () {
|
|
31
|
-
expectTypeOf(
|
|
30
|
+
expectTypeOf().toEqualTypeOf();
|
|
32
31
|
});
|
|
33
32
|
});
|
|
34
33
|
});
|
|
35
34
|
describe('cannot be assigned to an invalid non-strict equivalent type', function () {
|
|
36
|
-
let t;
|
|
37
35
|
it('equals type', function () {
|
|
38
|
-
expectTypeOf().not.toMatchTypeOf(
|
|
36
|
+
expectTypeOf().not.toMatchTypeOf();
|
|
39
37
|
});
|
|
40
38
|
});
|
|
41
39
|
});
|
|
@@ -2,24 +2,21 @@ import { list, numberType, } from 'types/builders';
|
|
|
2
2
|
describe('TypeOfType', function () {
|
|
3
3
|
describe('literal', function () {
|
|
4
4
|
const literalType = numberType;
|
|
5
|
-
let t;
|
|
6
5
|
it('equals expected type', function () {
|
|
7
|
-
expectTypeOf().toEqualTypeOf(
|
|
6
|
+
expectTypeOf().toEqualTypeOf();
|
|
8
7
|
});
|
|
9
8
|
});
|
|
10
9
|
describe('list', function () {
|
|
11
10
|
describe('mutable', function () {
|
|
12
11
|
const listType = list(numberType);
|
|
13
|
-
let t;
|
|
14
12
|
it('equals expected type', function () {
|
|
15
|
-
expectTypeOf().toEqualTypeOf(
|
|
13
|
+
expectTypeOf().toEqualTypeOf();
|
|
16
14
|
});
|
|
17
15
|
});
|
|
18
16
|
describe('readonly', function () {
|
|
19
17
|
const listType = list(numberType).readonlyElements();
|
|
20
|
-
let t;
|
|
21
18
|
it('equals expected type', function () {
|
|
22
|
-
expectTypeOf().toEqualTypeOf(
|
|
19
|
+
expectTypeOf().toEqualTypeOf();
|
|
23
20
|
});
|
|
24
21
|
});
|
|
25
22
|
});
|
|
@@ -1,89 +1,76 @@
|
|
|
1
1
|
describe('ValueOfType', function () {
|
|
2
2
|
describe('literal', function () {
|
|
3
|
-
let t;
|
|
4
3
|
it('equals expected type', function () {
|
|
5
|
-
expectTypeOf(
|
|
4
|
+
expectTypeOf().toEqualTypeOf();
|
|
6
5
|
});
|
|
7
6
|
});
|
|
8
7
|
describe('list', function () {
|
|
9
8
|
describe('simple', function () {
|
|
10
9
|
describe('mutable', function () {
|
|
11
|
-
let a;
|
|
12
10
|
it('equals expected type', function () {
|
|
13
|
-
expectTypeOf(
|
|
11
|
+
expectTypeOf().toEqualTypeOf();
|
|
14
12
|
});
|
|
15
13
|
});
|
|
16
14
|
describe('readonly', function () {
|
|
17
|
-
let a;
|
|
18
15
|
it('equals expected type', function () {
|
|
19
|
-
expectTypeOf(
|
|
16
|
+
expectTypeOf().toEqualTypeOf();
|
|
20
17
|
});
|
|
21
18
|
});
|
|
22
19
|
});
|
|
23
20
|
});
|
|
24
21
|
describe('record', function () {
|
|
25
22
|
describe('mutable', function () {
|
|
26
|
-
let t;
|
|
27
23
|
it('equals expected type', function () {
|
|
28
|
-
expectTypeOf(
|
|
24
|
+
expectTypeOf().toEqualTypeOf();
|
|
29
25
|
});
|
|
30
26
|
});
|
|
31
27
|
describe('readonly', function () {
|
|
32
|
-
let r;
|
|
33
28
|
it('equals expected type', function () {
|
|
34
|
-
expectTypeOf(
|
|
29
|
+
expectTypeOf().toEqualTypeOf();
|
|
35
30
|
});
|
|
36
31
|
});
|
|
37
32
|
describe('partial', function () {
|
|
38
|
-
let t;
|
|
39
33
|
it('equals expected type', function () {
|
|
40
|
-
expectTypeOf(
|
|
34
|
+
expectTypeOf().toEqualTypeOf();
|
|
41
35
|
});
|
|
42
36
|
});
|
|
43
37
|
describe('partial readonly', function () {
|
|
44
|
-
let t;
|
|
45
38
|
it('equals expected type', function () {
|
|
46
|
-
expectTypeOf(
|
|
39
|
+
expectTypeOf().toEqualTypeOf();
|
|
47
40
|
});
|
|
48
41
|
});
|
|
49
42
|
});
|
|
50
43
|
describe('object', function () {
|
|
51
44
|
describe('mutable', function () {
|
|
52
|
-
let value;
|
|
53
45
|
it('equals expected type', function () {
|
|
54
|
-
expectTypeOf(
|
|
46
|
+
expectTypeOf().toEqualTypeOf();
|
|
55
47
|
});
|
|
56
48
|
});
|
|
57
49
|
describe('readonly', function () {
|
|
58
|
-
let value;
|
|
59
50
|
it('equals expected type', function () {
|
|
60
|
-
expectTypeOf(
|
|
51
|
+
expectTypeOf().toEqualTypeOf();
|
|
61
52
|
});
|
|
62
53
|
});
|
|
63
54
|
describe('partial', function () {
|
|
64
|
-
let v;
|
|
65
55
|
it('equals expected type', function () {
|
|
66
|
-
expectTypeOf(
|
|
56
|
+
expectTypeOf().toEqualTypeOf();
|
|
67
57
|
});
|
|
68
58
|
});
|
|
69
59
|
});
|
|
70
60
|
describe('union', function () {
|
|
71
61
|
describe('non-discriminated', function () {
|
|
72
|
-
let t;
|
|
73
62
|
it('equals expected type', function () {
|
|
74
|
-
expectTypeOf(
|
|
63
|
+
expectTypeOf().toEqualTypeOf();
|
|
75
64
|
});
|
|
76
65
|
});
|
|
77
66
|
describe('implicitly discriminated', function () {
|
|
78
|
-
let t;
|
|
79
67
|
it('equals expected type', function () {
|
|
80
|
-
expectTypeOf(
|
|
68
|
+
expectTypeOf().toEqualTypeOf();
|
|
81
69
|
});
|
|
82
70
|
});
|
|
83
71
|
describe('explicitly discriminated', function () {
|
|
84
|
-
let t;
|
|
85
72
|
it('equals expected type', function () {
|
|
86
|
-
expectTypeOf(
|
|
73
|
+
expectTypeOf().toEqualTypeOf();
|
|
87
74
|
});
|
|
88
75
|
});
|
|
89
76
|
});
|