@gjsify/querystring 0.3.20 → 0.4.0

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.
@@ -0,0 +1 @@
1
+ var e=Object.defineProperty,__name=(t,n)=>e(t,`name`,{value:n,configurable:!0});export{__name};
package/lib/esm/error.js CHANGED
@@ -1 +1 @@
1
- var e=class extends Error{code;constructor(e,t,n){super(n),this.code=t,this.name=e,this.stack=this.stack&&`${e} [${this.code}]${this.stack.slice(20)}`}toString(){return`${this.name} [${this.code}]: ${this.message}`}},t=class extends e{constructor(e,t){super(URIError.prototype.name,e,t),Object.setPrototypeOf(this,URIError.prototype),this.toString=function(){return`${this.name} [${this.code}]: ${this.message}`}}};export{e as NodeErrorAbstraction,t as NodeURIError};
1
+ import"./_virtual/_rolldown/runtime.js";var NodeErrorAbstraction=class extends Error{code;constructor(e,t,n){super(n),this.code=t,this.name=e,this.stack=this.stack&&`${e} [${this.code}]${this.stack.slice(20)}`}toString(){return`${this.name} [${this.code}]: ${this.message}`}},NodeURIError=class extends NodeErrorAbstraction{constructor(e,t){super(URIError.prototype.name,e,t),Object.setPrototypeOf(this,URIError.prototype),this.toString=function(){return`${this.name} [${this.code}]: ${this.message}`}}};export{NodeErrorAbstraction,NodeURIError};
package/lib/esm/index.js CHANGED
@@ -1 +1 @@
1
- import{NodeURIError as e}from"./error.js";import{Buffer as t}from"node:buffer";const n=Array(256);for(let e=0;e<256;++e)n[e]=`%`+((e<16?`0`:``)+e.toString(16)).toUpperCase();function r(e,t,n){let r=e.length;if(r===0)return``;let a=``,o=0;for(let s=0;s<r;s++){let c=e.charCodeAt(s);if(c<128){if(t[c]===1)continue;o<s&&(a+=e.slice(o,s)),o=s+1,a+=n[c];continue}if(o<s&&(a+=e.slice(o,s)),c<2048){o=s+1,a+=n[192|c>>6]+n[128|c&63];continue}if(c<55296||c>=57344){o=s+1,a+=n[224|c>>12]+n[128|c>>6&63]+n[128|c&63];continue}if(++s,s>=r)throw new i;let l=e.charCodeAt(s)&1023;o=s+1,c=65536+((c&1023)<<10|l),a+=n[240|c>>18]+n[128|c>>12&63]+n[128|c>>6&63]+n[128|c&63]}return o===0?e:o<r?a+e.slice(o):a}var i=class extends e{constructor(){super(`ERR_INVALID_URI`,`URI malformed`)}};const a=f,o=_;function s(e){return typeof e!=`string`&&(typeof e==`object`?e=String(e):e+=``),r(e,p,n)}const c=s,l=new Int8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function u(e){let t=Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}function d(e,t,n,r,i,a){if(t.length>0&&r)try{t=a(t)}catch{}if(n.length>0&&i)try{n=a(n)}catch{}if(e[t]===void 0)e[t]=n;else{let r=e[t];r.pop?r[r.length]=n:e[t]=[r,n]}}function f(e,t=`&`,n=`=`,{decodeURIComponent:r=x,maxKeys:i=1e3}={}){let a=Object.create(null);if(typeof e!=`string`||e.length===0)return a;let o=t?u(String(t)):[38],s=n?u(String(n)):[61],c=o.length,f=s.length,p=1e3;typeof i==`number`&&(p=i>0?i:-1);let m=x;r&&(m=r);let h=m!==x,g=0,_=0,v=0,y=``,b=``,S=h,C=h,w=h?`%20`:` `,T=0;for(let t=0;t<e.length;++t){let n=e.charCodeAt(t);if(n===o[_]){if(++_===c){let n=t-_+1;if(v<f){if(g<n)y+=e.slice(g,n);else if(y.length===0){if(--p===0)return a;g=t+1,_=v=0;continue}}else g<n&&(b+=e.slice(g,n));if(d(a,y,b,S,C,m),--p===0)return a;y=b=``,T=0,g=t+1,_=v=0}}else{if(_=0,v<f){if(n===s[v]){if(++v===f){let n=t-v+1;g<n&&(y+=e.slice(g,n)),T=0,g=t+1}continue}else if(v=0,!S){if(n===37){T=1;continue}else if(T>0)if(l[n]===1){++T===3&&(S=!0);continue}else T=0}if(n===43){g<t&&(y+=e.slice(g,t)),y+=w,g=t+1;continue}}n===43?(g<t&&(b+=e.slice(g,t)),b+=w,g=t+1):C||(n===37?T=1:T>0&&(l[n]===1?++T===3&&(C=!0):T=0))}}if(g<e.length)v<f?y+=e.slice(g):_<c&&(b+=e.slice(g));else if(v===0&&y.length===0)return a;return d(a,y,b,S,C,m),a}const p=new Int8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0]);function m(e){return typeof e==`string`?e:typeof e==`number`&&isFinite(e)||typeof e==`bigint`?``+e:typeof e==`boolean`?e?`true`:`false`:``}function h(e,t){return t(m(e))}function g(e,t){return typeof e==`string`?e.length?t(e):``:typeof e==`number`&&isFinite(e)?Math.abs(e)<1e21?``+e:t(``+e):typeof e==`bigint`?``+e:typeof e==`boolean`?e?`true`:`false`:``}function _(e,t,n,r){t||=`&`,n||=`=`;let i=r?r.encodeURIComponent:s,a=r?h:g;if(typeof e==`object`&&e){let r=Object.keys(e),o=r.length,s=``;for(let c=0;c<o;++c){let o=r[c],l=e[o],u=a(o,i);if(u+=n,Array.isArray(l)){let e=l.length;if(e===0)continue;s&&(s+=t);for(let n=0;n<e;++n)n&&(s+=t),s+=u,s+=a(l[n],i)}else s&&(s+=t),s+=u,s+=a(l,i)}return s}return``}const v=new Int8Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);function y(e,n=!1){let r=new t(e.length),i=0,a=0,o,s,c,l,u=e.length-2,d=!1;for(;i<e.length;){if(o=e.charCodeAt(i),o===43&&n){r[a++]=32,i++;continue}if(o===37&&i<u)if(o=e.charCodeAt(++i),c=v[o],c>=0)s=e.charCodeAt(++i),l=v[s],l>=0?(d=!0,o=c*16+l):(r[a++]=37,i--);else{r[a++]=37;continue}r[a++]=o,i++}return d?r.slice(0,a):r}function b(e){try{return decodeURIComponent(e)}catch{return y(e).toString()}}const x=b;var S={parse:f,stringify:_,decode:a,encode:o,unescape:x,escape:c,unescapeBuffer:y};export{i as ERR_INVALID_URI,a as decode,S as default,o as encode,c as escape,f as parse,_ as stringify,x as unescape,y as unescapeBuffer};
1
+ import"./_virtual/_rolldown/runtime.js";import{NodeURIError as e}from"./error.js";import{Buffer as t}from"node:buffer";const n=Array(256);for(let e=0;e<256;++e)n[e]=`%`+((e<16?`0`:``)+e.toString(16)).toUpperCase();function encodeStr(e,t,n){let r=e.length;if(r===0)return``;let i=``,a=0;for(let o=0;o<r;o++){let s=e.charCodeAt(o);if(s<128){if(t[s]===1)continue;a<o&&(i+=e.slice(a,o)),a=o+1,i+=n[s];continue}if(a<o&&(i+=e.slice(a,o)),s<2048){a=o+1,i+=n[192|s>>6]+n[128|s&63];continue}if(s<55296||s>=57344){a=o+1,i+=n[224|s>>12]+n[128|s>>6&63]+n[128|s&63];continue}if(++o,o>=r)throw new ERR_INVALID_URI;let c=e.charCodeAt(o)&1023;a=o+1,s=65536+((s&1023)<<10|c),i+=n[240|s>>18]+n[128|s>>12&63]+n[128|s>>6&63]+n[128|s&63]}return a===0?e:a<r?i+e.slice(a):i}var ERR_INVALID_URI=class extends e{constructor(){super(`ERR_INVALID_URI`,`URI malformed`)}};const r=parse,i=stringify;function qsEscape(e){return typeof e!=`string`&&(typeof e==`object`?e=String(e):e+=``),encodeStr(e,s,n)}const a=qsEscape,o=new Int8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function charCodes(e){let t=Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}function addKeyVal(e,t,n,r,i,a){if(t.length>0&&r)try{t=a(t)}catch{}if(n.length>0&&i)try{n=a(n)}catch{}if(e[t]===void 0)e[t]=n;else{let r=e[t];r.pop?r[r.length]=n:e[t]=[r,n]}}function parse(e,t=`&`,n=`=`,{decodeURIComponent:r=l,maxKeys:i=1e3}={}){let a=Object.create(null);if(typeof e!=`string`||e.length===0)return a;let s=t?charCodes(String(t)):[38],c=n?charCodes(String(n)):[61],u=s.length,d=c.length,f=1e3;typeof i==`number`&&(f=i>0?i:-1);let p=l;r&&(p=r);let m=p!==l,h=0,g=0,_=0,v=``,y=``,b=m,x=m,S=m?`%20`:` `,C=0;for(let t=0;t<e.length;++t){let n=e.charCodeAt(t);if(n===s[g]){if(++g===u){let n=t-g+1;if(_<d){if(h<n)v+=e.slice(h,n);else if(v.length===0){if(--f===0)return a;h=t+1,g=_=0;continue}}else h<n&&(y+=e.slice(h,n));if(addKeyVal(a,v,y,b,x,p),--f===0)return a;v=y=``,C=0,h=t+1,g=_=0}}else{if(g=0,_<d){if(n===c[_]){if(++_===d){let n=t-_+1;h<n&&(v+=e.slice(h,n)),C=0,h=t+1}continue}else if(_=0,!b){if(n===37){C=1;continue}else if(C>0)if(o[n]===1){++C===3&&(b=!0);continue}else C=0}if(n===43){h<t&&(v+=e.slice(h,t)),v+=S,h=t+1;continue}}n===43?(h<t&&(y+=e.slice(h,t)),y+=S,h=t+1):x||(n===37?C=1:C>0&&(o[n]===1?++C===3&&(x=!0):C=0))}}if(h<e.length)_<d?v+=e.slice(h):g<u&&(y+=e.slice(h));else if(_===0&&v.length===0)return a;return addKeyVal(a,v,y,b,x,p),a}const s=new Int8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0]);function stringifyPrimitive(e){return typeof e==`string`?e:typeof e==`number`&&isFinite(e)||typeof e==`bigint`?``+e:typeof e==`boolean`?e?`true`:`false`:``}function encodeStringifiedCustom(e,t){return t(stringifyPrimitive(e))}function encodeStringified(e,t){return typeof e==`string`?e.length?t(e):``:typeof e==`number`&&isFinite(e)?Math.abs(e)<1e21?``+e:t(``+e):typeof e==`bigint`?``+e:typeof e==`boolean`?e?`true`:`false`:``}function stringify(e,t,n,r){t||=`&`,n||=`=`;let i=r?r.encodeURIComponent:qsEscape,a=r?encodeStringifiedCustom:encodeStringified;if(typeof e==`object`&&e){let r=Object.keys(e),o=r.length,s=``;for(let c=0;c<o;++c){let o=r[c],l=e[o],u=a(o,i);if(u+=n,Array.isArray(l)){let e=l.length;if(e===0)continue;s&&(s+=t);for(let n=0;n<e;++n)n&&(s+=t),s+=u,s+=a(l[n],i)}else s&&(s+=t),s+=u,s+=a(l,i)}return s}return``}const c=new Int8Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);function unescapeBuffer(e,n=!1){let r=new t(e.length),i=0,a=0,o,s,l,u,d=e.length-2,f=!1;for(;i<e.length;){if(o=e.charCodeAt(i),o===43&&n){r[a++]=32,i++;continue}if(o===37&&i<d)if(o=e.charCodeAt(++i),l=c[o],l>=0)s=e.charCodeAt(++i),u=c[s],u>=0?(f=!0,o=l*16+u):(r[a++]=37,i--);else{r[a++]=37;continue}r[a++]=o,i++}return f?r.slice(0,a):r}function qsUnescape(e){try{return decodeURIComponent(e)}catch{return unescapeBuffer(e).toString()}}const l=qsUnescape;var u={parse,stringify,decode:r,encode:i,unescape:l,escape:a,unescapeBuffer};export{ERR_INVALID_URI,r as decode,u as default,i as encode,a as escape,parse,stringify,l as unescape,unescapeBuffer};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/querystring",
3
- "version": "0.3.20",
3
+ "version": "0.4.0",
4
4
  "description": "Node.js querystring module for Gjs",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -30,8 +30,8 @@
30
30
  "fs"
31
31
  ],
32
32
  "devDependencies": {
33
- "@gjsify/cli": "^0.3.20",
34
- "@gjsify/unit": "^0.3.20",
33
+ "@gjsify/cli": "^0.4.0",
34
+ "@gjsify/unit": "^0.4.0",
35
35
  "@types/node": "^25.6.2",
36
36
  "typescript": "^6.0.3"
37
37
  }