@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
package/lib/types.schema.js
CHANGED
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
// @ts-nocheck
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
const check_serialized_permissions_policy_1 = require(
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
const check_serialized_permissions_policy_1 = require('./check-serialized-permissions-policy');
|
|
5
5
|
const check = (0, check_serialized_permissions_policy_1.checkSerializedPermissionsPolicy)();
|
|
6
6
|
test('checkSerializedPermissionsPolicy', () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
7
|
+
expect(check('').reason).toBe('empty-token');
|
|
8
|
+
expect(check(' ').reason).toBe('unexpected-token');
|
|
9
|
+
// expect(check('a').reason).toBe('missing-token');
|
|
10
|
+
expect(check('a').matched).toBe(true); // Current supported
|
|
11
|
+
expect(check('a:').reason).toBe('unexpected-token');
|
|
12
|
+
// expect(check('a ').reason).toBe('missing-token'); // Current supported
|
|
13
|
+
expect(check('a ').matched).toBe(true);
|
|
14
|
+
expect(check('a a').reason).toBe('unexpected-token');
|
|
15
|
+
expect(check('a *').matched).toBe(true);
|
|
16
|
+
expect(check('a *a').reason).toBe('unexpected-token');
|
|
17
|
+
expect(check('a none').reason).toBe('missing-token');
|
|
18
|
+
expect(check("a 'none'").matched).toBe(true);
|
|
19
|
+
expect(check('a https://markuplint.dev').matched).toBe(true);
|
|
20
|
+
expect(check('a https://markuplint.dev/path/to').reason).toBe('extra-token');
|
|
21
|
+
expect(check('a https://マルチバイト.abc.xyz').reason).toBe('must-be-serialized');
|
|
22
|
+
expect(check('a * https://markuplint.dev').matched).toBe(true);
|
|
23
|
+
expect(check("a * https://markuplint.dev 'none'").matched).toBe(true);
|
|
24
|
+
// expect(check("a * https://markuplint.dev 'none';b").reason).toBe('missing-token');
|
|
25
|
+
expect(check("a * https://markuplint.dev 'none';b").matched).toBe(true); // Current supported
|
|
26
|
+
// expect(check("a * https://markuplint.dev 'none';b ").reason).toBe('missing-token');
|
|
27
|
+
expect(check("a * https://markuplint.dev 'none';b ").matched).toBe(true); // Current supported
|
|
28
|
+
expect(check("a * https://markuplint.dev 'none';b *").matched).toBe(true);
|
|
29
|
+
expect(check("a * https://markuplint.dev 'none';b *;c 'none'").matched).toBe(true);
|
|
30
|
+
expect(check("a * https://markuplint.dev 'none'; b *; c 'none'").matched).toBe(true);
|
|
31
31
|
});
|
|
32
32
|
test('YouTube embed', () => {
|
|
33
|
-
|
|
33
|
+
expect(
|
|
34
|
+
check('accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture').matched,
|
|
35
|
+
).toBe(true);
|
|
34
36
|
});
|