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