@markuplint/types 3.0.0-dev.25 → 3.0.0-dev.40

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.
Files changed (65) hide show
  1. package/lib/css-syntax.js +6 -6
  2. package/lib/types.schema.d.ts +1 -1
  3. package/package.json +4 -6
  4. package/types.schema.json +16 -67
  5. package/gen/specific-schema.json +0 -98
  6. package/gen/types.ts +0 -66
  7. package/patches/css-tree+2.3.1.patch +0 -23
  8. package/src/check-multi-types.ts +0 -35
  9. package/src/check.spec.ts +0 -83
  10. package/src/check.ts +0 -48
  11. package/src/css-syntax.spec.ts +0 -167
  12. package/src/css-syntax.ts +0 -188
  13. package/src/debug.ts +0 -3
  14. package/src/defs.ts +0 -811
  15. package/src/enum.ts +0 -25
  16. package/src/get-candidate.ts +0 -24
  17. package/src/index.ts +0 -3
  18. package/src/keyword-type.ts +0 -64
  19. package/src/list.spec.ts +0 -133
  20. package/src/list.ts +0 -34
  21. package/src/match-result.ts +0 -49
  22. package/src/number.ts +0 -46
  23. package/src/primitive/index.spec.ts +0 -65
  24. package/src/primitive/index.ts +0 -7
  25. package/src/primitive/is-float.ts +0 -8
  26. package/src/primitive/is-int.ts +0 -8
  27. package/src/primitive/is-non-zero-uint.ts +0 -8
  28. package/src/primitive/is-quantity.ts +0 -38
  29. package/src/primitive/is-uint.ts +0 -15
  30. package/src/primitive/range.ts +0 -14
  31. package/src/primitive/split-unit.ts +0 -20
  32. package/src/rfc/is-bcp-47.spec.ts +0 -23
  33. package/src/rfc/is-bcp-47.ts +0 -13
  34. package/src/token/index.ts +0 -2
  35. package/src/token/token-collection.spec.ts +0 -147
  36. package/src/token/token-collection.ts +0 -444
  37. package/src/token/token.ts +0 -144
  38. package/src/types.schema.ts +0 -1113
  39. package/src/types.ts +0 -118
  40. package/src/w3c/check-serialized-permissions-policy.spec.ts +0 -38
  41. package/src/w3c/check-serialized-permissions-policy.ts +0 -303
  42. package/src/whatwg/check-autocomplete.spec.ts +0 -387
  43. package/src/whatwg/check-autocomplete.ts +0 -380
  44. package/src/whatwg/check-datetime/date-string.ts +0 -44
  45. package/src/whatwg/check-datetime/datetime-tokens.ts +0 -600
  46. package/src/whatwg/check-datetime/duration-string.ts +0 -399
  47. package/src/whatwg/check-datetime/global-date-and-time-string.ts +0 -96
  48. package/src/whatwg/check-datetime/index.spec.ts +0 -333
  49. package/src/whatwg/check-datetime/index.ts +0 -36
  50. package/src/whatwg/check-datetime/local-date-and-time-string.ts +0 -163
  51. package/src/whatwg/check-datetime/month-string.ts +0 -31
  52. package/src/whatwg/check-datetime/time-string.ts +0 -49
  53. package/src/whatwg/check-datetime/time-zone-offset-string.ts +0 -93
  54. package/src/whatwg/check-datetime/week-string.ts +0 -41
  55. package/src/whatwg/check-datetime/year-string.ts +0 -26
  56. package/src/whatwg/check-datetime/yearless-date-string.ts +0 -38
  57. package/src/whatwg/check-mime-type.spec.ts +0 -59
  58. package/src/whatwg/check-mime-type.ts +0 -46
  59. package/src/whatwg/is-abs-url.spec.ts +0 -8
  60. package/src/whatwg/is-abs-url.ts +0 -31
  61. package/src/whatwg/is-browser-context-name.ts +0 -16
  62. package/src/whatwg/is-custom-element-name.ts +0 -76
  63. package/src/whatwg/is-itemprop-name.ts +0 -17
  64. package/tsconfig.test.json +0 -3
  65. package/tsconfig.tsbuildinfo +0 -1
@@ -1,387 +0,0 @@
1
- import { checkAutoComplete } from './check-autocomplete';
2
-
3
- const check = checkAutoComplete();
4
-
5
- test('basic', () => {
6
- expect(check('on').matched).toBe(true);
7
- expect(check('on webauthn').matched).toBe(false);
8
- expect(check('off').matched).toBe(true);
9
- expect(check('off webauthn').matched).toBe(false);
10
- expect(check('name').matched).toBe(true);
11
- expect(check('given-name').matched).toBe(true);
12
- expect(check('given-name webauthn').matched).toBe(true);
13
- expect(check('given-name webauthun').matched).toBe(false);
14
- expect(check('section-').matched).toBe(true);
15
- expect(check('section-foo').matched).toBe(true);
16
- expect(check('section-foo webauthn').matched).toBe(true);
17
- expect(check('section-foo name').matched).toBe(true);
18
- expect(check('section-foo name webauthn').matched).toBe(true);
19
- expect(check('section-foo shipping name').matched).toBe(true);
20
- expect(check('section-foo billing name').matched).toBe(true);
21
- expect(check('section-foo billing home').matched).toBe(true);
22
- expect(check('section-foo billing work').matched).toBe(true);
23
- expect(check('section-foo billing home tel').matched).toBe(true);
24
- expect(check('section-foo billing work email').matched).toBe(true);
25
- expect(check('section-foo billing work email webauthn').matched).toBe(true);
26
- expect(check('shipping name').matched).toBe(true);
27
- expect(check('billing name').matched).toBe(true);
28
- expect(check('billing home').matched).toBe(true);
29
- expect(check('billing work').matched).toBe(true);
30
- expect(check('billing home tel').matched).toBe(true);
31
- expect(check('billing work email').matched).toBe(true);
32
- expect(check('billing work email webauthn').matched).toBe(true);
33
- expect(check('home tel').matched).toBe(true);
34
- expect(check('work email').matched).toBe(true);
35
- expect(check('work email webauthn').matched).toBe(true);
36
- });
37
-
38
- test('unexpected-token', () => {
39
- expect(check('section-foo , name')).toStrictEqual({
40
- matched: false,
41
- raw: ',',
42
- offset: 12,
43
- length: 1,
44
- line: 1,
45
- column: 13,
46
- reason: 'unexpected-token',
47
- expects: [
48
- { type: 'const', value: 'billing' },
49
- { type: 'const', value: 'shipping' },
50
- { type: 'common', value: 'autofill field name' },
51
- ],
52
- candidate: undefined,
53
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
54
- });
55
- });
56
-
57
- test('unexpected-token', () => {
58
- expect(check('xxx')).toStrictEqual({
59
- matched: false,
60
- raw: 'xxx',
61
- offset: 0,
62
- length: 3,
63
- line: 1,
64
- column: 1,
65
- reason: 'unexpected-token',
66
- expects: [
67
- { type: 'common', value: 'autofill named group' },
68
- { type: 'common', value: 'autofill field name' },
69
- ],
70
- candidate: undefined,
71
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
72
- });
73
- });
74
-
75
- test('unexpected-token', () => {
76
- expect(check('section-foo neme')).toStrictEqual({
77
- matched: false,
78
- raw: 'neme',
79
- offset: 12,
80
- length: 4,
81
- line: 1,
82
- column: 13,
83
- reason: 'unexpected-token',
84
- expects: [
85
- { type: 'const', value: 'billing' },
86
- { type: 'const', value: 'shipping' },
87
- { type: 'common', value: 'autofill field name' },
88
- ],
89
- candidate: 'name',
90
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
91
- });
92
- expect(check('section-foo shipping neme')).toStrictEqual({
93
- matched: false,
94
- raw: 'neme',
95
- offset: 21,
96
- length: 4,
97
- line: 1,
98
- column: 22,
99
- reason: 'unexpected-token',
100
- expects: [
101
- { type: 'common', value: 'autofill field name' },
102
- { type: 'const', value: 'home' },
103
- { type: 'const', value: 'work' },
104
- { type: 'const', value: 'mobile' },
105
- { type: 'const', value: 'fax' },
106
- { type: 'const', value: 'pager' },
107
- ],
108
- candidate: 'name',
109
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
110
- });
111
- expect(check('section-foo shipping home name')).toStrictEqual({
112
- matched: false,
113
- raw: 'name',
114
- offset: 26,
115
- length: 4,
116
- line: 1,
117
- column: 27,
118
- reason: 'unexpected-token',
119
- expects: [
120
- { type: 'const', value: 'tel' },
121
- { type: 'const', value: 'tel-country-code' },
122
- { type: 'const', value: 'tel-national' },
123
- { type: 'const', value: 'tel-area-code' },
124
- { type: 'const', value: 'tel-local' },
125
- { type: 'const', value: 'tel-local-prefix' },
126
- { type: 'const', value: 'tel-local-suffix' },
127
- { type: 'const', value: 'tel-extension' },
128
- { type: 'const', value: 'email' },
129
- { type: 'const', value: 'impp' },
130
- ],
131
- candidate: undefined,
132
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-tel',
133
- });
134
- expect(check('section-foo shipping home emall')).toStrictEqual({
135
- matched: false,
136
- raw: 'emall',
137
- offset: 26,
138
- length: 5,
139
- line: 1,
140
- column: 27,
141
- reason: 'unexpected-token',
142
- expects: [
143
- { type: 'const', value: 'tel' },
144
- { type: 'const', value: 'tel-country-code' },
145
- { type: 'const', value: 'tel-national' },
146
- { type: 'const', value: 'tel-area-code' },
147
- { type: 'const', value: 'tel-local' },
148
- { type: 'const', value: 'tel-local-prefix' },
149
- { type: 'const', value: 'tel-local-suffix' },
150
- { type: 'const', value: 'tel-extension' },
151
- { type: 'const', value: 'email' },
152
- { type: 'const', value: 'impp' },
153
- ],
154
- candidate: 'email',
155
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-tel',
156
- });
157
- });
158
-
159
- test('duplicated', () => {
160
- expect(check('name name')).toStrictEqual({
161
- matched: false,
162
- raw: 'name',
163
- offset: 5,
164
- length: 4,
165
- line: 1,
166
- column: 6,
167
- partName: 'the content of the list',
168
- reason: 'duplicated',
169
- expects: [{ type: 'format', value: 'autocomplete' }],
170
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete',
171
- });
172
- expect(check('on on')).toStrictEqual({
173
- matched: false,
174
- raw: 'on',
175
- offset: 3,
176
- length: 2,
177
- line: 1,
178
- column: 4,
179
- partName: 'the content of the list',
180
- reason: 'duplicated',
181
- expects: [{ type: 'format', value: 'autocomplete' }],
182
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete',
183
- });
184
- });
185
-
186
- test('extra-token', () => {
187
- expect(check('on off')).toStrictEqual({
188
- matched: false,
189
- raw: 'off',
190
- offset: 3,
191
- length: 3,
192
- line: 1,
193
- column: 4,
194
- reason: 'extra-token',
195
- expects: [{ type: 'format', value: 'autocomplete' }],
196
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-on-2',
197
- });
198
- expect(check('off on')).toStrictEqual({
199
- matched: false,
200
- raw: 'on',
201
- offset: 4,
202
- length: 2,
203
- line: 1,
204
- column: 5,
205
- reason: 'extra-token',
206
- expects: [{ type: 'format', value: 'autocomplete' }],
207
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-on-2',
208
- });
209
- expect(check('on name')).toStrictEqual({
210
- matched: false,
211
- raw: 'name',
212
- offset: 3,
213
- length: 4,
214
- line: 1,
215
- column: 4,
216
- reason: 'extra-token',
217
- expects: [{ type: 'format', value: 'autocomplete' }],
218
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-on-2',
219
- });
220
- expect(check('name on')).toStrictEqual({
221
- matched: false,
222
- raw: 'on',
223
- offset: 5,
224
- length: 2,
225
- line: 1,
226
- column: 6,
227
- reason: 'extra-token',
228
- expects: [{ type: 'format', value: 'autocomplete' }],
229
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
230
- });
231
- expect(check('section-foo name on')).toStrictEqual({
232
- matched: false,
233
- raw: 'on',
234
- offset: 17,
235
- length: 2,
236
- line: 1,
237
- column: 18,
238
- reason: 'extra-token',
239
- expects: [{ type: 'format', value: 'autocomplete' }],
240
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
241
- });
242
- expect(check('section-foo billing name on')).toStrictEqual({
243
- matched: false,
244
- raw: 'on',
245
- offset: 25,
246
- length: 2,
247
- line: 1,
248
- column: 26,
249
- reason: 'extra-token',
250
- expects: [{ type: 'format', value: 'autocomplete' }],
251
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
252
- });
253
- expect(check('billing name on')).toStrictEqual({
254
- matched: false,
255
- raw: 'on',
256
- offset: 13,
257
- length: 2,
258
- line: 1,
259
- column: 14,
260
- reason: 'extra-token',
261
- expects: [{ type: 'format', value: 'autocomplete' }],
262
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
263
- });
264
- expect(check('tel on')).toStrictEqual({
265
- matched: false,
266
- raw: 'on',
267
- offset: 4,
268
- length: 2,
269
- line: 1,
270
- column: 5,
271
- reason: 'extra-token',
272
- expects: [{ type: 'format', value: 'autocomplete' }],
273
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
274
- });
275
- expect(check('home tel on')).toStrictEqual({
276
- matched: false,
277
- raw: 'on',
278
- offset: 9,
279
- length: 2,
280
- line: 1,
281
- column: 10,
282
- reason: 'extra-token',
283
- expects: [{ type: 'format', value: 'autocomplete' }],
284
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
285
- });
286
- expect(check('billing home tel on')).toStrictEqual({
287
- matched: false,
288
- raw: 'on',
289
- offset: 17,
290
- length: 2,
291
- line: 1,
292
- column: 18,
293
- reason: 'extra-token',
294
- expects: [{ type: 'format', value: 'autocomplete' }],
295
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
296
- });
297
- expect(check('billing home tel on')).toStrictEqual({
298
- matched: false,
299
- raw: 'on',
300
- offset: 17,
301
- length: 2,
302
- line: 1,
303
- column: 18,
304
- reason: 'extra-token',
305
- expects: [{ type: 'format', value: 'autocomplete' }],
306
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
307
- });
308
- expect(check('section-foo billing home tel on')).toStrictEqual({
309
- matched: false,
310
- raw: 'on',
311
- offset: 29,
312
- length: 2,
313
- line: 1,
314
- column: 30,
315
- reason: 'extra-token',
316
- expects: [{ type: 'format', value: 'autocomplete' }],
317
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
318
- });
319
- expect(check('section-foo home tel on')).toStrictEqual({
320
- matched: false,
321
- raw: 'on',
322
- offset: 21,
323
- length: 2,
324
- line: 1,
325
- column: 22,
326
- reason: 'extra-token',
327
- expects: [{ type: 'format', value: 'autocomplete' }],
328
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
329
- });
330
- expect(check('section-foo tel on')).toStrictEqual({
331
- matched: false,
332
- raw: 'on',
333
- offset: 16,
334
- length: 2,
335
- line: 1,
336
- column: 17,
337
- reason: 'extra-token',
338
- expects: [{ type: 'format', value: 'autocomplete' }],
339
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
340
- });
341
- });
342
-
343
- test('duplicated section', () => {
344
- expect(check('section-foo section-bar')).toStrictEqual({
345
- matched: false,
346
- raw: 'section-bar',
347
- offset: 12,
348
- length: 11,
349
- line: 1,
350
- column: 13,
351
- partName: 'autofill named group',
352
- reason: 'duplicated',
353
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete-section',
354
- });
355
- });
356
-
357
- test('duplicated part', () => {
358
- expect(check('shipping billing')).toStrictEqual({
359
- matched: false,
360
- raw: 'billing',
361
- offset: 9,
362
- length: 7,
363
- line: 1,
364
- column: 10,
365
- reason: 'duplicated',
366
- expects: [{ type: 'format', value: 'autocomplete' }],
367
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete-shipping',
368
- });
369
- });
370
-
371
- test('typo', () => {
372
- expect(check('secsion-foo name')).toStrictEqual({
373
- matched: false,
374
- raw: 'secsion-foo',
375
- offset: 0,
376
- length: 11,
377
- line: 1,
378
- column: 1,
379
- reason: 'unexpected-token',
380
- expects: [
381
- { type: 'common', value: 'autofill named group' },
382
- { type: 'common', value: 'autofill field name' },
383
- ],
384
- candidate: 'section-foo',
385
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
386
- });
387
- });