@naverpay/nurl 0.0.11 → 0.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/cjs/punycode.js +1 -1
- package/dist/esm/punycode.mjs +64 -65
- package/package.json +1 -1
package/dist/cjs/punycode.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=2147483647,f=36,T=1,v=26,L=38,V=700,I=72,O=128,S="-",q={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=f-T,a=Math.floor,m=String.fromCharCode;function p(t){throw new RangeError(q[t])}function j(t){const n=[];let s=0;const e=t.length;for(;s<e;){const o=t.charCodeAt(s++);if(o>=55296&&o<=56319&&s<e){const r=t.charCodeAt(s++);(r&64512)==56320?n.push(((o&1023)<<10)+(r&1023)+65536):(n.push(o),s--)}else n.push(o)}return n}const B=t=>t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:f,A=(t,n)=>t+22+75*(t<26?1:0)-0,y=(t,n,s)=>{let e=0;for(t=s?a(t/V):t>>1,t+=a(t/n);t>M*v>>1;e+=f)t=a(t/M);return a(e+(M+1)*t/(t+L))},D=t=>{const n=[],s=t.length;let e=0,o=O,r=I,u=t.lastIndexOf(S);u<0&&(u=0);for(let c=0;c<u;++c)t.charCodeAt(c)>=128&&p("not-basic"),n.push(t.charCodeAt(c));for(let c=u>0?u+1:0;c<s;){const g=e;for(let d=1,l=f;;l+=f){c>=s&&p("invalid-input");const h=B(t.charCodeAt(c++));h>=f&&p("invalid-input"),h>a((C-e)/d)&&p("overflow"),e+=h*d;const b=l<=r?T:l>=r+v?v:l-r;if(h<b)break;const w=f-b;d>a(C/w)&&p("overflow"),d*=w}const i=n.length+1;r=y(e-g,i,g==0),a(e/i)>C-o&&p("overflow"),o+=a(e/i),e%=i,n.splice(e++,0,o)}return String.fromCodePoint(...n)},E=t=>{const n=[],s=j(t),e=s.length;let o=O,r=0,u=I;for(const i of s)i<128&&n.push(m(i));const c=n.length;let g=c;for(c&&n.push(S);g<e;){let i=C;for(const l of s)l>=o&&l<i&&(i=l);const d=g+1;i-o>a((C-r)/d)&&p("overflow"),r+=(i-o)*d,o=i;for(const l of s)if(l<o&&++r>C&&p("overflow"),l===o){let h=r;for(let b=f;;b+=f){const w=b<=u?T:b>=u+v?v:b-u;if(h<w)break;const k=h-w,x=f-w;n.push(m(A(w+k%x))),h=a(k/x)}n.push(m(A(h))),u=y(r,d,g===c),r=0,++g}++r,++o}return n.join("")};exports.decode=D;exports.encode=E;exports.ucs2decode=j;
|
package/dist/esm/punycode.mjs
CHANGED
|
@@ -1,89 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
const v = 2147483647, f = 36, k = 1, m = 26, q = 38, y = 700, L = 72, O = 128, V = "-", B = {
|
|
1
|
+
const v = "-", k = {
|
|
3
2
|
overflow: "Overflow: input needs wider integers to process",
|
|
4
3
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
5
4
|
"invalid-input": "Invalid input"
|
|
6
|
-
},
|
|
7
|
-
function
|
|
8
|
-
throw new RangeError(
|
|
5
|
+
}, g = 35, u = Math.floor, M = String.fromCharCode;
|
|
6
|
+
function b(t) {
|
|
7
|
+
throw new RangeError(k[t]);
|
|
9
8
|
}
|
|
10
|
-
function
|
|
9
|
+
function A(t) {
|
|
11
10
|
const n = [];
|
|
12
|
-
let
|
|
13
|
-
const
|
|
14
|
-
for (;
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
(
|
|
11
|
+
let s = 0;
|
|
12
|
+
const o = t.length;
|
|
13
|
+
for (; s < o; ) {
|
|
14
|
+
const e = t.charCodeAt(s++);
|
|
15
|
+
if (e >= 55296 && e <= 56319 && s < o) {
|
|
16
|
+
const i = t.charCodeAt(s++);
|
|
17
|
+
(i & 64512) == 56320 ? n.push(((e & 1023) << 10) + (i & 1023) + 65536) : (n.push(e), s--);
|
|
19
18
|
} else
|
|
20
|
-
|
|
19
|
+
n.push(e);
|
|
21
20
|
}
|
|
22
21
|
return n;
|
|
23
22
|
}
|
|
24
|
-
const
|
|
25
|
-
let
|
|
23
|
+
const T = (t) => t >= 48 && t < 58 ? 26 + (t - 48) : t >= 65 && t < 91 ? t - 65 : t >= 97 && t < 123 ? t - 97 : 36, C = (t, n) => t + 22 + 75 * (t < 26 ? 1 : 0) - 0, I = (t, n, s) => {
|
|
24
|
+
let o = 0;
|
|
26
25
|
for (
|
|
27
|
-
t =
|
|
26
|
+
t = s ? u(t / 700) : t >> 1, t += u(t / n);
|
|
28
27
|
/* no initialization */
|
|
29
|
-
t >
|
|
30
|
-
|
|
28
|
+
t > g * 26 >> 1;
|
|
29
|
+
o += 36
|
|
31
30
|
)
|
|
32
|
-
t = u(t /
|
|
33
|
-
return u(
|
|
34
|
-
},
|
|
35
|
-
const n = [],
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
for (let
|
|
39
|
-
t.charCodeAt(
|
|
40
|
-
for (let
|
|
41
|
-
const
|
|
42
|
-
for (let
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
31
|
+
t = u(t / g);
|
|
32
|
+
return u(o + (g + 1) * t / (t + 38));
|
|
33
|
+
}, B = (t) => {
|
|
34
|
+
const n = [], s = t.length;
|
|
35
|
+
let o = 0, e = 128, i = 72, l = t.lastIndexOf(v);
|
|
36
|
+
l < 0 && (l = 0);
|
|
37
|
+
for (let a = 0; a < l; ++a)
|
|
38
|
+
t.charCodeAt(a) >= 128 && b("not-basic"), n.push(t.charCodeAt(a));
|
|
39
|
+
for (let a = l > 0 ? l + 1 : 0; a < s; ) {
|
|
40
|
+
const p = o;
|
|
41
|
+
for (let h = 1, c = 36; ; c += 36) {
|
|
42
|
+
a >= s && b("invalid-input");
|
|
43
|
+
const f = T(t.charCodeAt(a++));
|
|
44
|
+
f >= 36 && b("invalid-input"), f > u((2147483647 - o) / h) && b("overflow"), o += f * h;
|
|
45
|
+
const x = c <= i ? 1 : c >= i + 26 ? 26 : c - i;
|
|
46
|
+
if (f < x)
|
|
48
47
|
break;
|
|
49
|
-
const
|
|
50
|
-
|
|
48
|
+
const d = 36 - x;
|
|
49
|
+
h > u(2147483647 / d) && b("overflow"), h *= d;
|
|
51
50
|
}
|
|
52
|
-
const
|
|
53
|
-
|
|
51
|
+
const r = n.length + 1;
|
|
52
|
+
i = I(o - p, r, p == 0), u(o / r) > 2147483647 - e && b("overflow"), e += u(o / r), o %= r, n.splice(o++, 0, e);
|
|
54
53
|
}
|
|
55
54
|
return String.fromCodePoint(...n);
|
|
56
|
-
},
|
|
57
|
-
const n = [],
|
|
58
|
-
let
|
|
59
|
-
for (const
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
let
|
|
63
|
-
for (
|
|
64
|
-
let
|
|
65
|
-
for (const
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
for (const
|
|
70
|
-
if (
|
|
71
|
-
let
|
|
72
|
-
for (let
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
55
|
+
}, L = (t) => {
|
|
56
|
+
const n = [], s = A(t), o = s.length;
|
|
57
|
+
let e = 128, i = 0, l = 72;
|
|
58
|
+
for (const r of s)
|
|
59
|
+
r < 128 && n.push(M(r));
|
|
60
|
+
const a = n.length;
|
|
61
|
+
let p = a;
|
|
62
|
+
for (a && n.push(v); p < o; ) {
|
|
63
|
+
let r = 2147483647;
|
|
64
|
+
for (const c of s)
|
|
65
|
+
c >= e && c < r && (r = c);
|
|
66
|
+
const h = p + 1;
|
|
67
|
+
r - e > u((2147483647 - i) / h) && b("overflow"), i += (r - e) * h, e = r;
|
|
68
|
+
for (const c of s)
|
|
69
|
+
if (c < e && ++i > 2147483647 && b("overflow"), c === e) {
|
|
70
|
+
let f = i;
|
|
71
|
+
for (let x = 36; ; x += 36) {
|
|
72
|
+
const d = x <= l ? 1 : x >= l + 26 ? 26 : x - l;
|
|
73
|
+
if (f < d)
|
|
75
74
|
break;
|
|
76
|
-
const
|
|
77
|
-
|
|
75
|
+
const w = f - d, m = 36 - d;
|
|
76
|
+
n.push(M(C(d + w % m))), f = u(w / m);
|
|
78
77
|
}
|
|
79
|
-
|
|
78
|
+
n.push(M(C(f))), l = I(i, h, p === a), i = 0, ++p;
|
|
80
79
|
}
|
|
81
|
-
++
|
|
80
|
+
++i, ++e;
|
|
82
81
|
}
|
|
83
82
|
return n.join("");
|
|
84
83
|
};
|
|
85
84
|
export {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
B as decode,
|
|
86
|
+
L as encode,
|
|
87
|
+
A as ucs2decode
|
|
89
88
|
};
|