@vercel/stega
Advanced tools
+1
-1
@@ -1,1 +0,1 @@ | ||
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var s={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},c={0:8203,1:8204,2:8205,3:65279},u=new Array(4).fill(String.fromCodePoint(c[0])).join(""),m=String.fromCharCode(0);function E(t){let e=JSON.stringify(t);return`${u}${Array.from(e).map(r=>{let n=r.charCodeAt(0);if(n>255)throw new Error(`Only ASCII edit info can be encoded. Error attempting to encode ${e} on character ${r} (${n})`);return Array.from(n.toString(4).padStart(4,"0")).map(o=>String.fromCodePoint(c[o])).join("")}).join("")}`}function y(t){let e=JSON.stringify(t);return Array.from(e).map(r=>{let n=r.charCodeAt(0);if(n>255)throw new Error(`Only ASCII edit info can be encoded. Error attempting to encode ${e} on character ${r} (${n})`);return Array.from(n.toString(16).padStart(2,"0")).map(o=>String.fromCodePoint(s[o])).join("")}).join("")}function I(t){return!Number.isNaN(Number(t))||/[a-z]/i.test(t)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(t)?!1:Boolean(Date.parse(t))}function T(t){try{new URL(t,t.startsWith("/")?"https://acme.com":void 0)}catch (e2){return!1}return!0}function C(t,e,r="auto"){return r===!0||r==="auto"&&(I(t)||T(t))?t:`${t}${E(e)}`}var x=Object.fromEntries(Object.entries(c).map(t=>t.reverse())),g=Object.fromEntries(Object.entries(s).map(t=>t.reverse())),S=`${Object.values(s).map(t=>`\\u{${t.toString(16)}}`).join("")}`,f= exports.VERCEL_STEGA_REGEX =new RegExp(`[${S}]{4,}`,"gu");function G(t){let e=t.match(f);if(!!e)return h(e[0],!0)[0]}function $(t){let e=t.match(f);if(!!e)return e.map(r=>h(r)).flat()}function h(t,e=!1){let r=Array.from(t);if(r.length%2===0){if(r.length%4||!t.startsWith(u))return A(r,e)}else throw new Error("Encoded data has invalid length");let n=[];for(let o=r.length*.25;o--;){let p=r.slice(o*4,o*4+4).map(d=>x[d.codePointAt(0)]).join("");n.unshift(String.fromCharCode(parseInt(p,4)))}if(e){n.shift();let o=n.indexOf(m);return o===-1&&(o=n.length),[JSON.parse(n.slice(0,o).join(""))]}return n.join("").split(m).filter(Boolean).map(o=>JSON.parse(o))}function A(t,e){var d;let r=[];for(let i=t.length*.5;i--;){let a=`${g[t[i*2].codePointAt(0)]}${g[t[i*2+1].codePointAt(0)]}`;r.unshift(String.fromCharCode(parseInt(a,16)))}let n=[],o=[r.join("")],p=10;for(;o.length;){let i=o.shift();try{if(n.push(JSON.parse(i)),e)return n}catch(a){if(!p--)throw a;let l=+((d=a.message.match(/\sposition\s(\d+)$/))==null?void 0:d[1]);if(!l)throw a;o.unshift(i.substring(0,l),i.substring(l))}}return n}function _(t){var e;return{cleaned:t.replace(f,""),encoded:((e=t.match(f))==null?void 0:e[0])||""}}function O(t){return t&&JSON.parse(_(JSON.stringify(t)).cleaned)}exports.VERCEL_STEGA_REGEX = f; exports.legacyStegaEncode = y; exports.vercelStegaClean = O; exports.vercelStegaCombine = C; exports.vercelStegaDecode = G; exports.vercelStegaDecodeAll = $; exports.vercelStegaEncode = E; exports.vercelStegaSplit = _; | ||
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var l={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},d={0:8203,1:8204,2:8205,3:65279},a={0:String.fromCodePoint(d[0]),1:String.fromCodePoint(d[1]),2:String.fromCodePoint(d[2]),3:String.fromCodePoint(d[3])},p=new Array(4).fill(String.fromCodePoint(d[0])).join(""),m=String.fromCharCode(0);function A(t){let e=JSON.stringify(t),r=new TextEncoder().encode(e),n="";for(let i=0;i<r.length;i++){let c=r[i];n+=a[c>>6&3]+a[c>>4&3]+a[c>>2&3]+a[c&3]}return p+n}function C(t){let e=JSON.stringify(t);return Array.from(e).map(r=>{let n=r.charCodeAt(0);if(n>255)throw new Error(`Only ASCII edit info can be encoded. Error attempting to encode ${e} on character ${r} (${n})`);return Array.from(n.toString(16).padStart(2,"0")).map(i=>String.fromCodePoint(l[i])).join("")}).join("")}function h(t){return!Number.isNaN(Number(t))||/[a-z]/i.test(t)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(t)?!1:!!Date.parse(t)}function S(t){try{new URL(t,t.startsWith("/")?"https://acme.com":void 0)}catch (e2){return!1}return!0}function b(t,e,r="auto"){return r===!0||r==="auto"&&(h(t)||S(t))?t:`${t}${A(e)}`}var g=Object.fromEntries(Object.entries(a).map(t=>[t[1],+t[0]])),T=Object.fromEntries(Object.entries(l).map(t=>t.reverse())),_=`${Object.values(l).map(t=>`\\u{${t.toString(16)}}`).join("")}`,u= exports.VERCEL_STEGA_REGEX =new RegExp(`[${_}]{4,}`,"gu");function X(t){let e=t.match(u);if(e)return x(e[0],!0)[0]}function w(t){let e=t.match(u);if(e)return e.map(r=>x(r)).flat()}function x(t,e=!1){let r=Array.from(t);if(r.length%2===0){if(r.length%4||!t.startsWith(p))return I(r,e)}else throw new Error("Encoded data has invalid length");let n=r.slice(4),i=new Uint8Array(n.length/4);for(let o=0;o<i.length;o++)i[o]=g[n[o*4]]<<6|g[n[o*4+1]]<<4|g[n[o*4+2]]<<2|g[n[o*4+3]];let c=new TextDecoder().decode(i);if(e){let o=c.indexOf(m);return o===-1&&(o=c.length),[JSON.parse(c.slice(0,o))]}return c.split(m).filter(Boolean).map(o=>JSON.parse(o))}function I(t,e){var o;let r=[];for(let s=t.length*.5;s--;){let f=`${T[t[s*2].codePointAt(0)]}${T[t[s*2+1].codePointAt(0)]}`;r.unshift(String.fromCharCode(parseInt(f,16)))}let n=[],i=[r.join("")],c=10;for(;i.length;){let s=i.shift();try{if(n.push(JSON.parse(s)),e)return n}catch(f){if(!c--)throw f;let E=+((o=f.message.match(/\sposition\s(\d+)$/))==null?void 0:o[1]);if(!E)throw f;i.unshift(s.substring(0,E),s.substring(E))}}return n}function D(t){var e;return{cleaned:t.replace(u,""),encoded:((e=t.match(u))==null?void 0:e[0])||""}}function M(t){return t&&JSON.parse(D(JSON.stringify(t)).cleaned)}exports.VERCEL_STEGA_REGEX = u; exports.legacyStegaEncode = C; exports.vercelStegaClean = M; exports.vercelStegaCombine = b; exports.vercelStegaDecode = X; exports.vercelStegaDecodeAll = w; exports.vercelStegaEncode = A; exports.vercelStegaSplit = D; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| var s={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},c={0:8203,1:8204,2:8205,3:65279},u=new Array(4).fill(String.fromCodePoint(c[0])).join(""),m=String.fromCharCode(0);function E(t){let e=JSON.stringify(t);return`${u}${Array.from(e).map(r=>{let n=r.charCodeAt(0);if(n>255)throw new Error(`Only ASCII edit info can be encoded. Error attempting to encode ${e} on character ${r} (${n})`);return Array.from(n.toString(4).padStart(4,"0")).map(o=>String.fromCodePoint(c[o])).join("")}).join("")}`}function y(t){let e=JSON.stringify(t);return Array.from(e).map(r=>{let n=r.charCodeAt(0);if(n>255)throw new Error(`Only ASCII edit info can be encoded. Error attempting to encode ${e} on character ${r} (${n})`);return Array.from(n.toString(16).padStart(2,"0")).map(o=>String.fromCodePoint(s[o])).join("")}).join("")}function I(t){return!Number.isNaN(Number(t))||/[a-z]/i.test(t)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(t)?!1:Boolean(Date.parse(t))}function T(t){try{new URL(t,t.startsWith("/")?"https://acme.com":void 0)}catch{return!1}return!0}function C(t,e,r="auto"){return r===!0||r==="auto"&&(I(t)||T(t))?t:`${t}${E(e)}`}var x=Object.fromEntries(Object.entries(c).map(t=>t.reverse())),g=Object.fromEntries(Object.entries(s).map(t=>t.reverse())),S=`${Object.values(s).map(t=>`\\u{${t.toString(16)}}`).join("")}`,f=new RegExp(`[${S}]{4,}`,"gu");function G(t){let e=t.match(f);if(!!e)return h(e[0],!0)[0]}function $(t){let e=t.match(f);if(!!e)return e.map(r=>h(r)).flat()}function h(t,e=!1){let r=Array.from(t);if(r.length%2===0){if(r.length%4||!t.startsWith(u))return A(r,e)}else throw new Error("Encoded data has invalid length");let n=[];for(let o=r.length*.25;o--;){let p=r.slice(o*4,o*4+4).map(d=>x[d.codePointAt(0)]).join("");n.unshift(String.fromCharCode(parseInt(p,4)))}if(e){n.shift();let o=n.indexOf(m);return o===-1&&(o=n.length),[JSON.parse(n.slice(0,o).join(""))]}return n.join("").split(m).filter(Boolean).map(o=>JSON.parse(o))}function A(t,e){var d;let r=[];for(let i=t.length*.5;i--;){let a=`${g[t[i*2].codePointAt(0)]}${g[t[i*2+1].codePointAt(0)]}`;r.unshift(String.fromCharCode(parseInt(a,16)))}let n=[],o=[r.join("")],p=10;for(;o.length;){let i=o.shift();try{if(n.push(JSON.parse(i)),e)return n}catch(a){if(!p--)throw a;let l=+((d=a.message.match(/\sposition\s(\d+)$/))==null?void 0:d[1]);if(!l)throw a;o.unshift(i.substring(0,l),i.substring(l))}}return n}function _(t){var e;return{cleaned:t.replace(f,""),encoded:((e=t.match(f))==null?void 0:e[0])||""}}function O(t){return t&&JSON.parse(_(JSON.stringify(t)).cleaned)}export{f as VERCEL_STEGA_REGEX,y as legacyStegaEncode,O as vercelStegaClean,C as vercelStegaCombine,G as vercelStegaDecode,$ as vercelStegaDecodeAll,E as vercelStegaEncode,_ as vercelStegaSplit}; | ||
| var l={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},d={0:8203,1:8204,2:8205,3:65279},a={0:String.fromCodePoint(d[0]),1:String.fromCodePoint(d[1]),2:String.fromCodePoint(d[2]),3:String.fromCodePoint(d[3])},p=new Array(4).fill(String.fromCodePoint(d[0])).join(""),m=String.fromCharCode(0);function A(t){let e=JSON.stringify(t),r=new TextEncoder().encode(e),n="";for(let i=0;i<r.length;i++){let c=r[i];n+=a[c>>6&3]+a[c>>4&3]+a[c>>2&3]+a[c&3]}return p+n}function C(t){let e=JSON.stringify(t);return Array.from(e).map(r=>{let n=r.charCodeAt(0);if(n>255)throw new Error(`Only ASCII edit info can be encoded. Error attempting to encode ${e} on character ${r} (${n})`);return Array.from(n.toString(16).padStart(2,"0")).map(i=>String.fromCodePoint(l[i])).join("")}).join("")}function h(t){return!Number.isNaN(Number(t))||/[a-z]/i.test(t)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(t)?!1:!!Date.parse(t)}function S(t){try{new URL(t,t.startsWith("/")?"https://acme.com":void 0)}catch{return!1}return!0}function b(t,e,r="auto"){return r===!0||r==="auto"&&(h(t)||S(t))?t:`${t}${A(e)}`}var g=Object.fromEntries(Object.entries(a).map(t=>[t[1],+t[0]])),T=Object.fromEntries(Object.entries(l).map(t=>t.reverse())),_=`${Object.values(l).map(t=>`\\u{${t.toString(16)}}`).join("")}`,u=new RegExp(`[${_}]{4,}`,"gu");function X(t){let e=t.match(u);if(e)return x(e[0],!0)[0]}function w(t){let e=t.match(u);if(e)return e.map(r=>x(r)).flat()}function x(t,e=!1){let r=Array.from(t);if(r.length%2===0){if(r.length%4||!t.startsWith(p))return I(r,e)}else throw new Error("Encoded data has invalid length");let n=r.slice(4),i=new Uint8Array(n.length/4);for(let o=0;o<i.length;o++)i[o]=g[n[o*4]]<<6|g[n[o*4+1]]<<4|g[n[o*4+2]]<<2|g[n[o*4+3]];let c=new TextDecoder().decode(i);if(e){let o=c.indexOf(m);return o===-1&&(o=c.length),[JSON.parse(c.slice(0,o))]}return c.split(m).filter(Boolean).map(o=>JSON.parse(o))}function I(t,e){var o;let r=[];for(let s=t.length*.5;s--;){let f=`${T[t[s*2].codePointAt(0)]}${T[t[s*2+1].codePointAt(0)]}`;r.unshift(String.fromCharCode(parseInt(f,16)))}let n=[],i=[r.join("")],c=10;for(;i.length;){let s=i.shift();try{if(n.push(JSON.parse(s)),e)return n}catch(f){if(!c--)throw f;let E=+((o=f.message.match(/\sposition\s(\d+)$/))==null?void 0:o[1]);if(!E)throw f;i.unshift(s.substring(0,E),s.substring(E))}}return n}function D(t){var e;return{cleaned:t.replace(u,""),encoded:((e=t.match(u))==null?void 0:e[0])||""}}function M(t){return t&&JSON.parse(D(JSON.stringify(t)).cleaned)}export{u as VERCEL_STEGA_REGEX,C as legacyStegaEncode,M as vercelStegaClean,b as vercelStegaCombine,X as vercelStegaDecode,w as vercelStegaDecodeAll,A as vercelStegaEncode,D as vercelStegaSplit}; |
+2
-4
| { | ||
| "name": "@vercel/stega", | ||
| "version": "0.1.2", | ||
| "version": "1.0.0", | ||
| "description": "Utilities for steganography", | ||
@@ -18,4 +18,3 @@ "main": "./dist/index.js", | ||
| "tsup": "^6.7.0", | ||
| "typescript": "^4.6.3", | ||
| "@vercel-private/conformance": "1.7.0" | ||
| "typescript": "^4.6.3" | ||
| }, | ||
@@ -29,5 +28,4 @@ "access": "public", | ||
| "build": "tsup", | ||
| "conformance": "vercel-conformance", | ||
| "test": "jest" | ||
| } | ||
| } |
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var s={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},c={0:8203,1:8204,2:8205,3:65279},u=new Array(4).fill(String.fromCodePoint(c[0])).join(""),m=String.fromCharCode(0);function E(t){let e=JSON.stringify(t);return`${u}${Array.from(e).map(r=>{let n=r.charCodeAt(0);if(n>255)throw new Error(`Only ASCII edit info can be encoded. Error attempting to encode ${e} on character ${r} (${n})`);return Array.from(n.toString(4).padStart(4,"0")).map(o=>String.fromCodePoint(c[o])).join("")}).join("")}`}function y(t){let e=JSON.stringify(t);return Array.from(e).map(r=>{let n=r.charCodeAt(0);if(n>255)throw new Error(`Only ASCII edit info can be encoded. Error attempting to encode ${e} on character ${r} (${n})`);return Array.from(n.toString(16).padStart(2,"0")).map(o=>String.fromCodePoint(s[o])).join("")}).join("")}function I(t){return!Number.isNaN(Number(t))||/[a-z]/i.test(t)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(t)?!1:Boolean(Date.parse(t))}function T(t){try{new URL(t,t.startsWith("/")?"https://acme.com":void 0)}catch (e2){return!1}return!0}function C(t,e,r="auto"){return r===!0||r==="auto"&&(I(t)||T(t))?t:`${t}${E(e)}`}var x=Object.fromEntries(Object.entries(c).map(t=>t.reverse())),g=Object.fromEntries(Object.entries(s).map(t=>t.reverse())),S=`${Object.values(s).map(t=>`\\u{${t.toString(16)}}`).join("")}`,f= exports.VERCEL_STEGA_REGEX =new RegExp(`[${S}]{4,}`,"gu");function G(t){let e=t.match(f);if(!!e)return h(e[0],!0)[0]}function $(t){let e=t.match(f);if(!!e)return e.map(r=>h(r)).flat()}function h(t,e=!1){let r=Array.from(t);if(r.length%2===0){if(r.length%4||!t.startsWith(u))return A(r,e)}else throw new Error("Encoded data has invalid length");let n=[];for(let o=r.length*.25;o--;){let p=r.slice(o*4,o*4+4).map(d=>x[d.codePointAt(0)]).join("");n.unshift(String.fromCharCode(parseInt(p,4)))}if(e){n.shift();let o=n.indexOf(m);return o===-1&&(o=n.length),[JSON.parse(n.slice(0,o).join(""))]}return n.join("").split(m).filter(Boolean).map(o=>JSON.parse(o))}function A(t,e){var d;let r=[];for(let i=t.length*.5;i--;){let a=`${g[t[i*2].codePointAt(0)]}${g[t[i*2+1].codePointAt(0)]}`;r.unshift(String.fromCharCode(parseInt(a,16)))}let n=[],o=[r.join("")],p=10;for(;o.length;){let i=o.shift();try{if(n.push(JSON.parse(i)),e)return n}catch(a){if(!p--)throw a;let l=+((d=a.message.match(/\sposition\s(\d+)$/))==null?void 0:d[1]);if(!l)throw a;o.unshift(i.substring(0,l),i.substring(l))}}return n}function _(t){var e;return{cleaned:t.replace(f,""),encoded:((e=t.match(f))==null?void 0:e[0])||""}}function O(t){return t&&JSON.parse(_(JSON.stringify(t)).cleaned)}exports.VERCEL_STEGA_REGEX = f; exports.legacyStegaEncode = y; exports.vercelStegaClean = O; exports.vercelStegaCombine = C; exports.vercelStegaDecode = G; exports.vercelStegaDecodeAll = $; exports.vercelStegaEncode = E; exports.vercelStegaSplit = _; |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5
-16.67%3
-40%26231
-10.87%6
-14.29%77
-13.48%