@gjsify/querystring 0.3.21 → 0.4.3

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 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};
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 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};
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,38 +1,41 @@
1
1
  {
2
- "name": "@gjsify/querystring",
3
- "version": "0.3.21",
4
- "description": "Node.js querystring module for Gjs",
5
- "type": "module",
6
- "module": "lib/esm/index.js",
7
- "types": "lib/types/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./lib/types/index.d.ts",
11
- "default": "./lib/esm/index.js"
2
+ "name": "@gjsify/querystring",
3
+ "version": "0.4.3",
4
+ "description": "Node.js querystring module for Gjs",
5
+ "type": "module",
6
+ "module": "lib/esm/index.js",
7
+ "types": "lib/types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/types/index.d.ts",
11
+ "default": "./lib/esm/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "lib"
16
+ ],
17
+ "scripts": {
18
+ "clear": "rm -rf lib tsconfig.tsbuildinfo tsconfig.types.tsbuildinfo test.gjs.mjs test.node.mjs || exit 0",
19
+ "check": "tsc --noEmit",
20
+ "build": "gjsify run build:gjsify && gjsify run build:types",
21
+ "build:gjsify": "gjsify build --library 'src/**/*.{ts,js}' --exclude 'src/**/*.spec.{mts,ts}' 'src/test.{mts,ts}'",
22
+ "build:types": "tsc",
23
+ "build:test": "gjsify run build:test:gjs && gjsify run build:test:node",
24
+ "build:test:gjs": "gjsify build src/test.mts --app gjs --outfile test.gjs.mjs",
25
+ "build:test:node": "gjsify build src/test.mts --app node --outfile test.node.mjs",
26
+ "test": "gjsify run build:gjsify && gjsify run build:test && gjsify run test:node && gjsify run test:gjs",
27
+ "test:gjs": "gjsify run test.gjs.mjs",
28
+ "test:node": "node test.node.mjs"
29
+ },
30
+ "keywords": [
31
+ "gjs",
32
+ "node",
33
+ "fs"
34
+ ],
35
+ "devDependencies": {
36
+ "@gjsify/cli": "workspace:^",
37
+ "@gjsify/unit": "workspace:^",
38
+ "@types/node": "^25.6.2",
39
+ "typescript": "^6.0.3"
12
40
  }
13
- },
14
- "scripts": {
15
- "clear": "rm -rf lib tsconfig.tsbuildinfo tsconfig.types.tsbuildinfo test.gjs.mjs test.node.mjs || exit 0",
16
- "check": "tsc --noEmit",
17
- "build": "yarn build:gjsify && yarn build:types",
18
- "build:gjsify": "gjsify build --library 'src/**/*.{ts,js}' --exclude 'src/**/*.spec.{mts,ts}' 'src/test.{mts,ts}'",
19
- "build:types": "tsc",
20
- "build:test": "yarn build:test:gjs && yarn build:test:node",
21
- "build:test:gjs": "gjsify build src/test.mts --app gjs --outfile test.gjs.mjs",
22
- "build:test:node": "gjsify build src/test.mts --app node --outfile test.node.mjs",
23
- "test": "yarn build:gjsify && yarn build:test && yarn test:node && yarn test:gjs",
24
- "test:gjs": "gjsify run test.gjs.mjs",
25
- "test:node": "node test.node.mjs"
26
- },
27
- "keywords": [
28
- "gjs",
29
- "node",
30
- "fs"
31
- ],
32
- "devDependencies": {
33
- "@gjsify/cli": "^0.3.21",
34
- "@gjsify/unit": "^0.3.21",
35
- "@types/node": "^25.6.2",
36
- "typescript": "^6.0.3"
37
- }
38
- }
41
+ }
package/src/error.ts DELETED
@@ -1,34 +0,0 @@
1
- // Reference: Node.js lib/internal/errors.js — Node.js error base class
2
- // Reimplemented for GJS
3
- // TODO create module for node errors?
4
-
5
- /**
6
- * All error instances in Node have additional methods and properties
7
- * This export class is meant to be extended by these instances abstracting native JS error instances
8
- */
9
- export class NodeErrorAbstraction extends Error {
10
- code: string;
11
-
12
- constructor(name: string, code: string, message: string) {
13
- super(message);
14
- this.code = code;
15
- this.name = name;
16
- //This number changes depending on the name of this class
17
- //20 characters as of now
18
- this.stack = this.stack && `${name} [${this.code}]${this.stack.slice(20)}`;
19
- }
20
-
21
- override toString() {
22
- return `${this.name} [${this.code}]: ${this.message}`;
23
- }
24
- }
25
-
26
- export class NodeURIError extends NodeErrorAbstraction implements URIError {
27
- constructor(code: string, message: string) {
28
- super(URIError.prototype.name, code, message);
29
- Object.setPrototypeOf(this, URIError.prototype);
30
- this.toString = function () {
31
- return `${this.name} [${this.code}]: ${this.message}`;
32
- };
33
- }
34
- }