@markuplint/types 3.5.1 → 3.7.0
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/lib/check-multi-types.d.ts +1 -1
- package/lib/check.spec.js +61 -61
- package/lib/css-syntax.spec.js +151 -149
- package/lib/get-candidate.d.ts +1 -4
- package/lib/list.spec.js +117 -117
- package/lib/match-result.d.ts +1 -1
- package/lib/primitive/index.spec.js +52 -52
- package/lib/primitive/is-quantity.d.ts +1 -5
- package/lib/primitive/is-uint.d.ts +3 -6
- package/lib/primitive/split-unit.d.ts +2 -2
- package/lib/rfc/is-bcp-47.spec.js +8 -8
- package/lib/token/token-collection.d.ts +1 -1
- package/lib/token/token-collection.spec.js +155 -134
- package/lib/token/token.d.ts +1 -1
- package/lib/types.d.ts +55 -79
- package/lib/types.schema.d.ts +31 -1084
- package/lib/types.schema.js +0 -1
- package/lib/w3c/check-serialized-permissions-policy.spec.js +30 -28
- package/lib/whatwg/check-autocomplete.spec.js +360 -360
- package/lib/whatwg/check-datetime/datetime-tokens.d.ts +1 -21
- package/lib/whatwg/check-datetime/index.spec.js +277 -276
- package/lib/whatwg/check-datetime/time-zone-offset-string.d.ts +1 -1
- package/lib/whatwg/check-mime-type.d.ts +4 -4
- package/lib/whatwg/check-mime-type.spec.js +52 -52
- package/lib/whatwg/is-abs-url.spec.js +5 -5
- package/package.json +8 -10
- package/test/check.spec.js +89 -0
- package/test/css-syntax.spec.js +165 -0
- package/test/list.spec.js +133 -0
- package/test/primitive/index.spec.js +65 -0
- package/test/rfc/is-bcp-47.spec.js +23 -0
- package/test/token/token-collection.spec.js +146 -0
- package/test/w3c/check-serialized-permissions-policy.spec.js +36 -0
- package/test/whatwg/check-autocomplete.spec.js +387 -0
- package/test/whatwg/check-datetime/index.spec.js +336 -0
- package/test/whatwg/check-mime-type.spec.js +59 -0
- package/test/whatwg/is-abs-url.spec.js +8 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { CustomSyntaxCheck, UnmatchedResult } from './types';
|
|
2
|
-
export declare function checkMultiTypes(value: string, checks: readonly CustomSyntaxCheck[]):
|
|
2
|
+
export declare function checkMultiTypes(value: string, checks: readonly CustomSyntaxCheck[]): import("./types").MatchedResult | UnmatchedResult;
|
package/lib/check.spec.js
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
// @ts-nocheck
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
const check_1 = require(
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
const check_1 = require('./check');
|
|
5
5
|
test('Any', () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
expect((0, check_1.check)('', 'Any').matched).toBe(true);
|
|
7
|
+
expect((0, check_1.check)(' ', 'Any').matched).toBe(true);
|
|
8
|
+
expect((0, check_1.check)('a', 'Any').matched).toBe(true);
|
|
9
9
|
});
|
|
10
10
|
test('NoEmptyAny', () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
expect((0, check_1.check)('', 'NoEmptyAny').matched).toBe(false);
|
|
12
|
+
expect((0, check_1.check)(' ', 'NoEmptyAny').matched).toBe(true);
|
|
13
|
+
expect((0, check_1.check)('a', 'NoEmptyAny').matched).toBe(true);
|
|
14
14
|
});
|
|
15
15
|
test('OneLineAny', () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
expect((0, check_1.check)('', 'OneLineAny').matched).toBe(true);
|
|
17
|
+
expect((0, check_1.check)(' ', 'OneLineAny').matched).toBe(true);
|
|
18
|
+
expect((0, check_1.check)('a', 'OneLineAny').matched).toBe(true);
|
|
19
|
+
expect((0, check_1.check)('a ', 'OneLineAny').matched).toBe(true);
|
|
20
|
+
expect((0, check_1.check)('a b', 'OneLineAny').matched).toBe(true);
|
|
21
|
+
expect((0, check_1.check)('a\n', 'OneLineAny').matched).toBe(false);
|
|
22
|
+
expect((0, check_1.check)('a\nb', 'OneLineAny').matched).toBe(false);
|
|
23
|
+
expect((0, check_1.check)('a\r\nb', 'OneLineAny').matched).toBe(false);
|
|
24
|
+
expect((0, check_1.check)('a\rb', 'OneLineAny').matched).toBe(false);
|
|
25
25
|
});
|
|
26
26
|
test('Pattern', () => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
expect((0, check_1.check)('.*', 'Pattern').matched).toBe(true);
|
|
28
|
+
expect((0, check_1.check)('[a-z]+', 'Pattern').matched).toBe(true);
|
|
29
|
+
expect((0, check_1.check)(']//[()?!+*', 'Pattern').matched).toBe(false);
|
|
30
30
|
});
|
|
31
31
|
test('BCP47', () => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
expect((0, check_1.check)('en', 'BCP47').matched).toBe(true);
|
|
33
|
+
expect((0, check_1.check)('en-US', 'BCP47').matched).toBe(true);
|
|
34
|
+
expect((0, check_1.check)('ja', 'BCP47').matched).toBe(true);
|
|
35
|
+
expect((0, check_1.check)(' ja ', 'BCP47').matched).toBe(false);
|
|
36
|
+
expect((0, check_1.check)('', 'BCP47').matched).toBe(false);
|
|
37
|
+
expect((0, check_1.check)('zh/cn', 'BCP47').matched).toBe(false);
|
|
38
38
|
});
|
|
39
39
|
test('Srcset', () => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
expect((0, check_1.check)('a/bb/ccc/dddd', 'Srcset').matched).toBe(true);
|
|
41
|
+
expect((0, check_1.check)('a/bb/ccc/dddd 200w', 'Srcset').matched).toBe(true);
|
|
42
|
+
expect((0, check_1.check)('a/bb/ccc/dddd 200w, b/cc/ddd/eeee 1.5x', 'Srcset').matched).toBe(true);
|
|
43
|
+
expect((0, check_1.check)('a/bb/ccc/dddd 200w, b/cc/ddd/eeee 1.5a', 'Srcset').matched).toBe(false);
|
|
44
44
|
});
|
|
45
45
|
test('IconSize', () => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
46
|
+
expect((0, check_1.check)('any', 'IconSize').matched).toBe(true);
|
|
47
|
+
expect((0, check_1.check)('Any', 'IconSize').matched).toBe(true);
|
|
48
|
+
expect((0, check_1.check)('10x10', 'IconSize').matched).toBe(true);
|
|
49
|
+
expect((0, check_1.check)('1x1', 'IconSize').matched).toBe(true);
|
|
50
|
+
expect((0, check_1.check)('1x0', 'IconSize').matched).toBe(false);
|
|
51
|
+
expect((0, check_1.check)('0x1', 'IconSize').matched).toBe(false);
|
|
52
|
+
expect((0, check_1.check)('0x0', 'IconSize').matched).toBe(false);
|
|
53
|
+
expect((0, check_1.check)('', 'IconSize').matched).toBe(false);
|
|
54
|
+
expect((0, check_1.check)(' ', 'IconSize').matched).toBe(false);
|
|
55
|
+
expect((0, check_1.check)('1', 'IconSize').matched).toBe(false);
|
|
56
|
+
expect((0, check_1.check)('1x', 'IconSize').matched).toBe(false);
|
|
57
|
+
expect((0, check_1.check)('x1', 'IconSize').matched).toBe(false);
|
|
58
58
|
});
|
|
59
59
|
test('Number', () => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
expect((0, check_1.check)('10', { type: 'integer', gt: 0 }).matched).toBe(true);
|
|
61
|
+
expect((0, check_1.check)('0', { type: 'integer', gt: 0 }).matched).toBe(false);
|
|
62
|
+
expect((0, check_1.check)('0', { type: 'integer', gte: 0 }).matched).toBe(true);
|
|
63
|
+
expect((0, check_1.check)('9', { type: 'integer', lt: 10 }).matched).toBe(true);
|
|
64
|
+
expect((0, check_1.check)('10', { type: 'integer', lt: 10 }).matched).toBe(false);
|
|
65
65
|
});
|
|
66
66
|
test('Non-exist types', () => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
expect((0, check_1.check)('abc', 'String').matched).toBe(true);
|
|
69
|
+
// @ts-ignore
|
|
70
|
+
expect((0, check_1.check)('abc', 'FooBar').matched).toBe(true);
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
expect((0, check_1.check)('abc', ' ').matched).toBe(true);
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
expect((0, check_1.check)('abc', '\n').matched).toBe(true);
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
expect((0, check_1.check)('abc', '').matched).toBe(true);
|
|
77
77
|
});
|
|
78
78
|
test('ItemProp', () => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
expect((0, check_1.check)('itemListElement', 'ItemProp').matched).toBe(true);
|
|
80
|
+
expect((0, check_1.check)('item', 'ItemProp').matched).toBe(true);
|
|
81
|
+
expect((0, check_1.check)('position', 'ItemProp').matched).toBe(true);
|
|
82
82
|
});
|
package/lib/css-syntax.spec.js
CHANGED
|
@@ -1,158 +1,160 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
// @ts-nocheck
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
const css_syntax_1 = require(
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
const css_syntax_1 = require('./css-syntax');
|
|
5
5
|
test('CSS Standard', () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('10px', '<length>').matched).toBe(true);
|
|
7
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('one-pixel', '<length>').matched).toBe(false);
|
|
8
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('(prefers-color-scheme: dark)', '<media-query-list>').matched).toBe(true);
|
|
9
9
|
});
|
|
10
10
|
test('Extends', () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
11
|
+
const sourceSizeList = {
|
|
12
|
+
ref: 'https://html.spec.whatwg.org/multipage/images.html#sizes-attributes',
|
|
13
|
+
syntax: {
|
|
14
|
+
apply: '<source-size-list>',
|
|
15
|
+
def: {
|
|
16
|
+
'source-size-list': '[ <source-size># , ]? <source-size-value>',
|
|
17
|
+
'source-size': '<media-condition> <source-size-value>',
|
|
18
|
+
'source-size-value': '<length>',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('50vw', sourceSizeList).matched).toBe(true);
|
|
23
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('(max-width: 600px) 200px, 50vw', sourceSizeList).matched).toBe(true);
|
|
24
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('print 300vw', sourceSizeList).matched).toBe(false);
|
|
25
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('(max-width: 600px) 200px', sourceSizeList).matched).toBe(false);
|
|
26
|
+
expect(
|
|
27
|
+
(0, css_syntax_1.cssSyntaxMatch)('(max-width: 600px) 200px', {
|
|
28
|
+
...sourceSizeList,
|
|
29
|
+
syntax: {
|
|
30
|
+
...sourceSizeList.syntax,
|
|
31
|
+
apply: '<source-size>',
|
|
32
|
+
},
|
|
33
|
+
}).matched,
|
|
34
|
+
).toBe(true);
|
|
35
|
+
const keyTimes = {
|
|
36
|
+
ref: 'https://svgwg.org/specs/animations/#KeyTimesAttribute',
|
|
37
|
+
syntax: {
|
|
38
|
+
apply: '<key-times>',
|
|
39
|
+
def: {
|
|
40
|
+
'key-times': '<number> [; <number>]* [;]?',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('20; 20; 30', keyTimes).matched).toBe(true);
|
|
45
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('20; 20; 30;', keyTimes).matched).toBe(true);
|
|
46
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('20; 20; abc;', keyTimes).matched).toBe(false);
|
|
47
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('20; 20; ;', keyTimes).matched).toBe(false);
|
|
48
|
+
const SVGViewBox = {
|
|
49
|
+
ref: 'https://svgwg.org/svg2-draft/coords.html#ViewBoxAttribute',
|
|
50
|
+
syntax: {
|
|
51
|
+
apply: '<view-box>',
|
|
52
|
+
def: {
|
|
53
|
+
'view-box': '<min-x> [,]? <min-y> [,]? <width> [,]? <height>',
|
|
54
|
+
'min-x': '<number>',
|
|
55
|
+
'min-y': '<number>',
|
|
56
|
+
width: '<number>',
|
|
57
|
+
height: '<number>',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('0 0 30 10', SVGViewBox).matched).toBe(true);
|
|
62
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('0 0, 30, 10', SVGViewBox).matched).toBe(true);
|
|
63
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('0 0, 30', SVGViewBox).matched).toBe(false);
|
|
64
|
+
const percentageList = {
|
|
65
|
+
ref: 'https://developer.mozilla.org/en-US/docs/Web/SVG/Content_type#percentage',
|
|
66
|
+
syntax: {
|
|
67
|
+
apply: '<percentage-list>',
|
|
68
|
+
def: {
|
|
69
|
+
'percentage-list': '[ <number> [,]? ]* <number>',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('0 0 30 10', percentageList).matched).toBe(true);
|
|
74
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('0, 0, 30 10', percentageList).matched).toBe(true);
|
|
75
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('0', percentageList).matched).toBe(true);
|
|
76
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('', percentageList).matched).toBe(false);
|
|
77
|
+
const custom = {
|
|
78
|
+
ref: 'n/a',
|
|
79
|
+
syntax: {
|
|
80
|
+
apply: '<custom>',
|
|
81
|
+
def: {
|
|
82
|
+
custom: '0 | 1 | .',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('0', custom).matched).toBe(true);
|
|
87
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('1', custom).matched).toBe(true);
|
|
88
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('.', custom).matched).toBe(true);
|
|
89
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('2', custom).matched).toBe(false);
|
|
90
|
+
expect((0, css_syntax_1.cssSyntaxMatch)(':', custom).matched).toBe(false);
|
|
89
91
|
});
|
|
90
92
|
test('custom-type-checking', () => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
93
|
+
const custom = {
|
|
94
|
+
ref: 'n/a',
|
|
95
|
+
caseSensitive: true,
|
|
96
|
+
syntax: {
|
|
97
|
+
apply: '<custom>',
|
|
98
|
+
def: {
|
|
99
|
+
custom: '<custom-type>',
|
|
100
|
+
'custom-type': token => {
|
|
101
|
+
if (!token) {
|
|
102
|
+
return 0;
|
|
103
|
+
}
|
|
104
|
+
return token.value === '1' ? 1 : 0;
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('1', custom).matched).toBe(true);
|
|
110
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('0', custom).matched).toBe(false);
|
|
109
111
|
});
|
|
110
112
|
test('case-sensitive', () => {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
113
|
+
const custom = {
|
|
114
|
+
ref: 'n/a',
|
|
115
|
+
caseSensitive: true,
|
|
116
|
+
syntax: {
|
|
117
|
+
apply: '<custom>',
|
|
118
|
+
def: {
|
|
119
|
+
custom: 'CaSeS [a | B | aBc]',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('CaSeS a', custom).matched).toBe(true);
|
|
124
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('CaSeS B', custom).matched).toBe(true);
|
|
125
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('CaSeS aBc', custom).matched).toBe(true);
|
|
126
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('CaSeS A', custom)).toStrictEqual({
|
|
127
|
+
column: 7,
|
|
128
|
+
line: 1,
|
|
129
|
+
matched: false,
|
|
130
|
+
length: 1,
|
|
131
|
+
offset: 6,
|
|
132
|
+
partName: 'value',
|
|
133
|
+
raw: 'A',
|
|
134
|
+
reason: 'syntax-error',
|
|
135
|
+
ref: 'n/a',
|
|
136
|
+
expects: [
|
|
137
|
+
{
|
|
138
|
+
type: 'syntax',
|
|
139
|
+
value: '<custom>',
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
});
|
|
143
|
+
expect((0, css_syntax_1.cssSyntaxMatch)('CaSeS abc', custom)).toStrictEqual({
|
|
144
|
+
column: 7,
|
|
145
|
+
line: 1,
|
|
146
|
+
matched: false,
|
|
147
|
+
length: 3,
|
|
148
|
+
offset: 6,
|
|
149
|
+
partName: 'value',
|
|
150
|
+
raw: 'abc',
|
|
151
|
+
reason: 'syntax-error',
|
|
152
|
+
ref: 'n/a',
|
|
153
|
+
expects: [
|
|
154
|
+
{
|
|
155
|
+
type: 'syntax',
|
|
156
|
+
value: '<custom>',
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
});
|
|
158
160
|
});
|
package/lib/get-candidate.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
type NullableString = string | null | undefined;
|
|
2
|
-
export declare function getCandidate(
|
|
3
|
-
value: NullableString,
|
|
4
|
-
...candidates: readonly (NullableString | readonly NullableString[])[]
|
|
5
|
-
): string | undefined;
|
|
2
|
+
export declare function getCandidate(value: NullableString, ...candidates: readonly (NullableString | readonly NullableString[])[]): string | undefined;
|
|
6
3
|
export {};
|