charcode-is-valid-xml-name-character 2.0.2 → 2.0.6
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/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## 2.0.1 (2021-09-13)
|
|
7
|
-
|
|
8
|
-
### Bug Fixes
|
|
9
|
-
|
|
10
|
-
- bump TS and separate ESLint plugins away from this monorepo ([2e07d42](https://github.com/codsen/codsen/commit/2e07d424222b6ffedf5fb45c83ad453627ec2904))
|
|
11
|
-
|
|
12
6
|
## 2.0.0 (2021-09-09)
|
|
13
7
|
|
|
14
8
|
### Features
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2010
|
|
3
|
+
Copyright (c) 2010-2021 Roy Revelt and other contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name charcode-is-valid-xml-name-character
|
|
3
3
|
* @fileoverview Does a given character belong to XML spec's "Production 4 OR 4a" type (is acceptable for XML element's name)
|
|
4
|
-
* @version 2.0.
|
|
4
|
+
* @version 2.0.6
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/charcode-is-valid-xml-name-character/}
|
|
@@ -9,21 +9,60 @@
|
|
|
9
9
|
|
|
10
10
|
import { isIndexWithin } from 'ranges-is-index-within';
|
|
11
11
|
|
|
12
|
-
const nameStartChar = [
|
|
12
|
+
const nameStartChar = [
|
|
13
|
+
[58, 58],
|
|
14
|
+
[65, 90],
|
|
15
|
+
[95, 95],
|
|
16
|
+
[192, 214],
|
|
17
|
+
[216, 246],
|
|
18
|
+
[248, 767],
|
|
19
|
+
[880, 893],
|
|
20
|
+
[895, 8191],
|
|
21
|
+
[8204, 8205],
|
|
22
|
+
[8304, 8591],
|
|
23
|
+
[11264, 12271],
|
|
24
|
+
[12289, 55295],
|
|
25
|
+
[63744, 64975],
|
|
26
|
+
[65008, 65533],
|
|
27
|
+
[65536, 983039],
|
|
13
28
|
];
|
|
14
|
-
const nameChar = [
|
|
29
|
+
const nameChar = [
|
|
30
|
+
[45, 45],
|
|
31
|
+
[46, 46],
|
|
32
|
+
[48, 57],
|
|
33
|
+
[58, 58],
|
|
34
|
+
[65, 90],
|
|
35
|
+
[95, 95],
|
|
36
|
+
[183, 183],
|
|
37
|
+
[192, 214],
|
|
38
|
+
[216, 246],
|
|
39
|
+
[248, 767],
|
|
40
|
+
[768, 879],
|
|
41
|
+
[880, 893],
|
|
42
|
+
[895, 8191],
|
|
43
|
+
[8204, 8205],
|
|
44
|
+
[8255, 8256],
|
|
45
|
+
[8304, 8591],
|
|
46
|
+
[11264, 12271],
|
|
47
|
+
[12289, 55295],
|
|
48
|
+
[63744, 64975],
|
|
49
|
+
[65008, 65533],
|
|
50
|
+
[65536, 983039],
|
|
15
51
|
];
|
|
16
|
-
const priorityNameChar = [
|
|
52
|
+
const priorityNameChar = [
|
|
53
|
+
[97, 122],
|
|
17
54
|
];
|
|
18
55
|
const opts = {
|
|
19
|
-
|
|
20
|
-
|
|
56
|
+
inclusiveRangeEnds: true,
|
|
57
|
+
skipIncomingRangeSorting: true,
|
|
21
58
|
};
|
|
22
59
|
function isProduction4(char) {
|
|
23
|
-
|
|
60
|
+
return (isIndexWithin(char.codePointAt(0), priorityNameChar, opts) ||
|
|
61
|
+
isIndexWithin(char.codePointAt(0), nameStartChar, opts));
|
|
24
62
|
}
|
|
25
63
|
function isProduction4a(char) {
|
|
26
|
-
|
|
64
|
+
return (isIndexWithin(char.codePointAt(0), priorityNameChar, opts) ||
|
|
65
|
+
isIndexWithin(char.codePointAt(0), nameChar, opts));
|
|
27
66
|
}
|
|
28
67
|
|
|
29
68
|
export { isProduction4, isProduction4a, isProduction4 as validFirstChar, isProduction4a as validSecondCharOnwards };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name charcode-is-valid-xml-name-character
|
|
3
3
|
* @fileoverview Does a given character belong to XML spec's "Production 4 OR 4a" type (is acceptable for XML element's name)
|
|
4
|
-
* @version 2.0.
|
|
4
|
+
* @version 2.0.6
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/charcode-is-valid-xml-name-character/}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
/**
|
|
12
12
|
* @name ranges-is-index-within
|
|
13
13
|
* @fileoverview Checks if index is within any of the given string index ranges
|
|
14
|
-
* @version 3.0.
|
|
14
|
+
* @version 3.0.6
|
|
15
15
|
* @author Roy Revelt, Codsen Ltd
|
|
16
16
|
* @license MIT
|
|
17
17
|
* {@link https://codsen.com/os/ranges-is-index-within/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "charcode-is-valid-xml-name-character",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "Does a given character belong to XML spec's \"Production 4 OR 4a\" type (is acceptable for XML element's name)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"4",
|
|
@@ -39,9 +39,10 @@
|
|
|
39
39
|
"types": "types/index.d.ts",
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "rollup -c",
|
|
42
|
-
"esbuild": "node '../../scripts/esbuild.js'",
|
|
43
|
-
"
|
|
44
|
-
"ci_test": "npm run build && npm run format && tap --no-only --reporter=silent
|
|
42
|
+
"build:esbuild": "node '../../scripts/esbuild.js'",
|
|
43
|
+
"build:esbuild:dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
|
|
44
|
+
"ci_test": "npm run build && npm run format && tap --no-only --reporter=silent",
|
|
45
|
+
"clean_types": "../../scripts/cleanTypes.js",
|
|
45
46
|
"dev": "rollup -c --dev",
|
|
46
47
|
"devunittest": "npm run dev && tap --only -R 'base'",
|
|
47
48
|
"format": "npm run lect && npm run prettier && npm run lint",
|
|
@@ -51,20 +52,15 @@
|
|
|
51
52
|
"prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent",
|
|
52
53
|
"republish": "npm publish || :",
|
|
53
54
|
"tap": "tap",
|
|
54
|
-
"tsc": "tsc",
|
|
55
55
|
"pretest": "npm run build",
|
|
56
|
-
"test": "npm run
|
|
56
|
+
"test": "npm run test:ci && npm run perf",
|
|
57
|
+
"test:ci": "npm run unittest && npm run test:examples && npm run format",
|
|
57
58
|
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"clean_types": "../../scripts/cleanTypes.js"
|
|
59
|
+
"tsc": "tsc",
|
|
60
|
+
"unittest": "tap --no-only --reporter=terse && tsc -p tsconfig.json --noEmit"
|
|
61
61
|
},
|
|
62
62
|
"tap": {
|
|
63
63
|
"check-coverage": false,
|
|
64
|
-
"coverage-report": [
|
|
65
|
-
"json-summary",
|
|
66
|
-
"text"
|
|
67
|
-
],
|
|
68
64
|
"node-arg": [
|
|
69
65
|
"--no-warnings",
|
|
70
66
|
"--experimental-loader",
|
|
@@ -84,47 +80,47 @@
|
|
|
84
80
|
}
|
|
85
81
|
},
|
|
86
82
|
"dependencies": {
|
|
87
|
-
"@babel/runtime": "^7.
|
|
88
|
-
"ranges-is-index-within": "^3.0.
|
|
83
|
+
"@babel/runtime": "^7.16.3",
|
|
84
|
+
"ranges-is-index-within": "^3.0.6"
|
|
89
85
|
},
|
|
90
86
|
"devDependencies": {
|
|
91
|
-
"@babel/cli": "^7.
|
|
92
|
-
"@babel/core": "^7.
|
|
93
|
-
"@babel/node": "^7.
|
|
94
|
-
"@babel/plugin-external-helpers": "^7.
|
|
95
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
96
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.
|
|
97
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.
|
|
98
|
-
"@babel/plugin-proposal-optional-chaining": "^7.
|
|
99
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
100
|
-
"@babel/preset-env": "^7.
|
|
101
|
-
"@babel/preset-typescript": "^7.
|
|
102
|
-
"@babel/register": "^7.
|
|
87
|
+
"@babel/cli": "^7.16.0",
|
|
88
|
+
"@babel/core": "^7.16.0",
|
|
89
|
+
"@babel/node": "^7.16.0",
|
|
90
|
+
"@babel/plugin-external-helpers": "^7.16.0",
|
|
91
|
+
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
|
92
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
|
93
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.16.0",
|
|
94
|
+
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
|
95
|
+
"@babel/plugin-transform-runtime": "^7.16.4",
|
|
96
|
+
"@babel/preset-env": "^7.16.4",
|
|
97
|
+
"@babel/preset-typescript": "^7.16.0",
|
|
98
|
+
"@babel/register": "^7.16.0",
|
|
103
99
|
"@istanbuljs/esm-loader-hook": "^0.1.2",
|
|
104
100
|
"@rollup/plugin-babel": "^5.3.0",
|
|
105
|
-
"@rollup/plugin-commonjs": "^
|
|
106
|
-
"@rollup/plugin-node-resolve": "^13.0.
|
|
101
|
+
"@rollup/plugin-commonjs": "^21.0.1",
|
|
102
|
+
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
107
103
|
"@rollup/plugin-strip": "^2.1.0",
|
|
108
|
-
"@rollup/plugin-typescript": "^8.
|
|
109
|
-
"@types/node": "^16.9
|
|
104
|
+
"@rollup/plugin-typescript": "^8.3.0",
|
|
105
|
+
"@types/node": "^16.11.9",
|
|
110
106
|
"@types/tap": "^15.0.5",
|
|
111
|
-
"@typescript-eslint/eslint-plugin": "^4.
|
|
112
|
-
"@typescript-eslint/parser": "^4.
|
|
113
|
-
"core-js": "^3.
|
|
107
|
+
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
|
108
|
+
"@typescript-eslint/parser": "^5.4.0",
|
|
109
|
+
"core-js": "^3.19.1",
|
|
114
110
|
"cross-env": "^7.0.3",
|
|
115
|
-
"eslint": "^
|
|
116
|
-
"lect": "^0.18.
|
|
117
|
-
"rollup": "^2.
|
|
111
|
+
"eslint": "^8.3.0",
|
|
112
|
+
"lect": "^0.18.6",
|
|
113
|
+
"rollup": "^2.60.0",
|
|
118
114
|
"rollup-plugin-ascii": "^0.0.3",
|
|
119
115
|
"rollup-plugin-banner": "^0.2.1",
|
|
120
116
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
121
|
-
"rollup-plugin-dts": "^4.0.
|
|
117
|
+
"rollup-plugin-dts": "^4.0.1",
|
|
122
118
|
"rollup-plugin-terser": "^7.0.2",
|
|
123
|
-
"tap": "^15.
|
|
119
|
+
"tap": "^15.1.2",
|
|
124
120
|
"tslib": "^2.3.1",
|
|
125
|
-
"typescript": "^4.
|
|
121
|
+
"typescript": "^4.5.2"
|
|
126
122
|
},
|
|
127
123
|
"engines": {
|
|
128
|
-
"node": ">=
|
|
124
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
129
125
|
}
|
|
130
126
|
}
|