punycode-esm 1.0.10 → 1.0.12
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/dist/punycode.js +11 -6
- package/package.json +9 -9
package/dist/punycode.js
CHANGED
|
@@ -30,14 +30,16 @@ export const ucs2Decode = (string)=>{
|
|
|
30
30
|
const output = [];
|
|
31
31
|
let counter = 0;
|
|
32
32
|
while(counter < string.length){
|
|
33
|
-
const value = string.charCodeAt(counter
|
|
33
|
+
const value = string.charCodeAt(counter);
|
|
34
|
+
++counter;
|
|
34
35
|
if (value >= 0xd800 && value <= 0xdbff && counter < string.length) {
|
|
35
|
-
const extra = string.charCodeAt(counter
|
|
36
|
+
const extra = string.charCodeAt(counter);
|
|
37
|
+
++counter;
|
|
36
38
|
if ((extra & 0xfc00) === 0xdc00) {
|
|
37
39
|
output.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);
|
|
38
40
|
} else {
|
|
39
41
|
output.push(value);
|
|
40
|
-
counter
|
|
42
|
+
--counter;
|
|
41
43
|
}
|
|
42
44
|
} else {
|
|
43
45
|
output.push(value);
|
|
@@ -100,7 +102,8 @@ export const decode = (input)=>{
|
|
|
100
102
|
gte: true,
|
|
101
103
|
error: 'invalid-input'
|
|
102
104
|
});
|
|
103
|
-
const digit = basicToDigit(input.codePointAt(index
|
|
105
|
+
const digit = basicToDigit(input.codePointAt(index));
|
|
106
|
+
++index;
|
|
104
107
|
checkOverflow(digit, base, {
|
|
105
108
|
gte: true
|
|
106
109
|
});
|
|
@@ -120,7 +123,8 @@ export const decode = (input)=>{
|
|
|
120
123
|
checkOverflow(Math.floor(i / out), maxInt - n);
|
|
121
124
|
n += Math.floor(i / out);
|
|
122
125
|
i %= out;
|
|
123
|
-
output.splice(i
|
|
126
|
+
output.splice(i, 0, n);
|
|
127
|
+
++i;
|
|
124
128
|
}
|
|
125
129
|
return String.fromCodePoint(...output);
|
|
126
130
|
};
|
|
@@ -154,7 +158,8 @@ export const encode = (input)=>{
|
|
|
154
158
|
n = m;
|
|
155
159
|
for (const currentValue of decodedInput){
|
|
156
160
|
if (currentValue < n) {
|
|
157
|
-
|
|
161
|
+
++delta;
|
|
162
|
+
checkOverflow(delta, maxInt);
|
|
158
163
|
}
|
|
159
164
|
if (currentValue === n) {
|
|
160
165
|
let q = delta;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "punycode-esm",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "Typescript + ESM version of punycode.js",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20"
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@biomejs/biome": "^1.9.4",
|
|
32
|
-
"@types/chai": "^5.0.
|
|
32
|
+
"@types/chai": "^5.0.1",
|
|
33
33
|
"@types/mocha": "^10.0.9",
|
|
34
|
-
"@types/node": "^22.
|
|
34
|
+
"@types/node": "^22.8.6",
|
|
35
35
|
"c8": "^10.1.2",
|
|
36
|
-
"chai": "^5.1.
|
|
37
|
-
"mocha": "^10.
|
|
36
|
+
"chai": "^5.1.2",
|
|
37
|
+
"mocha": "^10.8.2",
|
|
38
38
|
"typescript": "^5.6.3",
|
|
39
|
-
"
|
|
40
|
-
"mocha-chain": "^0.0.
|
|
41
|
-
"
|
|
42
|
-
"nx-update-ts-references": "^0.0.
|
|
39
|
+
"nx-tsc": "^0.0.13",
|
|
40
|
+
"mocha-chain": "^0.0.8",
|
|
41
|
+
"@leyman/eslint-config": "^0.0.4",
|
|
42
|
+
"nx-update-ts-references": "^0.0.8"
|
|
43
43
|
}
|
|
44
44
|
}
|