charcode-is-valid-xml-name-character 2.0.10 → 2.0.11
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/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2010-
|
|
3
|
+
Copyright (c) 2010-2022 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
|
package/README.md
CHANGED
|
@@ -26,14 +26,12 @@
|
|
|
26
26
|
|
|
27
27
|
## Install
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
The latest version is **ESM only**: Node 12+ is needed to use it and it must be `import`ed instead of `require`d. If your project is not on ESM yet and you want to use `require`, use an older version of this program, `1.13.0`.
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
npm i charcode-is-valid-xml-name-character
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
If you need a legacy version which works with `require`, use version 1.13.0
|
|
36
|
-
|
|
37
35
|
## Quick Take
|
|
38
36
|
|
|
39
37
|
```js
|
|
@@ -73,8 +71,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
|
|
|
73
71
|
|
|
74
72
|
MIT License
|
|
75
73
|
|
|
76
|
-
Copyright (c) 2010-
|
|
77
|
-
|
|
74
|
+
Copyright (c) 2010-2022 Roy Revelt and other contributors
|
|
78
75
|
|
|
79
76
|
<img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center">
|
|
80
|
-
|
|
@@ -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.11
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/charcode-is-valid-xml-name-character/}
|
|
@@ -1,17 +1,17 @@
|
|
|
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.11
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/charcode-is-valid-xml-name-character/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
var charcodeIsValidXmlNameCharacter=(()=>{var i=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var
|
|
10
|
+
var charcodeIsValidXmlNameCharacter=(()=>{var i=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols;var c=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var g=(n,e,a)=>e in n?i(n,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[e]=a,u=(n,e)=>{for(var a in e||(e={}))c.call(e,a)&&g(n,a,e[a]);if(d)for(var a of d(e))f.call(e,a)&&g(n,a,e[a]);return n};var p=n=>i(n,"__esModule",{value:!0});var R=(n,e)=>{for(var a in e)i(n,a,{get:e[a],enumerable:!0})},h=(n,e,a,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of b(e))!c.call(n,r)&&(a||r!=="default")&&i(n,r,{get:()=>e[r],enumerable:!(o=l(e,r))||o.enumerable});return n};var v=(n=>(e,a)=>n&&n.get(e)||(a=h(p({}),e,1),n&&n.set(e,a),a))(typeof WeakMap!="undefined"?new WeakMap:0);var w={};R(w,{isProduction4:()=>A,isProduction4a:()=>P,validFirstChar:()=>A,validSecondCharOnwards:()=>P});var I={inclusiveRangeEnds:!1,returnMatchedRangeInsteadOfTrue:!1};function s(n,e,a){let o=u(u({},I),a);if(!Number.isInteger(n))throw new Error(`ranges-is-index-within: [THROW_ID_01] the first input argument should be string index, a natural number (or zero). It was given as ${n} (type ${typeof n})`);return Array.isArray(e)?o.returnMatchedRangeInsteadOfTrue?e.find(r=>o.inclusiveRangeEnds?n>=r[0]&&n<=r[1]:n>r[0]&&n<r[1])||!1:e.some(r=>o.inclusiveRangeEnds?n>=r[0]&&n<=r[1]:n>r[0]&&n<r[1]):!1}var y=[[58,58],[65,90],[95,95],[192,214],[216,246],[248,767],[880,893],[895,8191],[8204,8205],[8304,8591],[11264,12271],[12289,55295],[63744,64975],[65008,65533],[65536,983039]],x=[[45,45],[46,46],[48,57],[58,58],[65,90],[95,95],[183,183],[192,214],[216,246],[248,767],[768,879],[880,893],[895,8191],[8204,8205],[8255,8256],[8304,8591],[11264,12271],[12289,55295],[63744,64975],[65008,65533],[65536,983039]],m=[[97,122]],t={inclusiveRangeEnds:!0,skipIncomingRangeSorting:!0};function A(n){return s(n.codePointAt(0),m,t)||s(n.codePointAt(0),y,t)}function P(n){return s(n.codePointAt(0),m,t)||s(n.codePointAt(0),x,t)}return v(w);})();
|
|
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.11
|
|
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.11",
|
|
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",
|
|
@@ -40,13 +40,15 @@
|
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
42
42
|
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
43
|
-
"dts": "rollup -c",
|
|
43
|
+
"dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
|
|
44
44
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
45
45
|
"lect": "node '../../ops/lect/lect.js'",
|
|
46
46
|
"letspublish": "yarn publish || :",
|
|
47
47
|
"lint": "eslint . --fix",
|
|
48
48
|
"perf": "node perf/check.js",
|
|
49
49
|
"prepare": "echo 'ready'",
|
|
50
|
+
"prettier": "prettier",
|
|
51
|
+
"prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
|
|
50
52
|
"pretest": "yarn run lect && yarn run build",
|
|
51
53
|
"test": "c8 yarn run unit && yarn run examples && yarn run lint",
|
|
52
54
|
"unit": "uvu test"
|
|
@@ -69,6 +71,6 @@
|
|
|
69
71
|
}
|
|
70
72
|
},
|
|
71
73
|
"dependencies": {
|
|
72
|
-
"ranges-is-index-within": "^3.0.
|
|
74
|
+
"ranges-is-index-within": "^3.0.11"
|
|
73
75
|
}
|
|
74
76
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
declare function isProduction4(char: string): boolean;
|
|
2
2
|
declare function isProduction4a(char: string): boolean;
|
|
3
3
|
|
|
4
|
-
export {
|
|
4
|
+
export {
|
|
5
|
+
isProduction4,
|
|
6
|
+
isProduction4a,
|
|
7
|
+
isProduction4 as validFirstChar,
|
|
8
|
+
isProduction4a as validSecondCharOnwards,
|
|
9
|
+
};
|