Socket
Socket
Sign inDemoInstall

@vercel/stega

Package Overview
Dependencies
Maintainers
9
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vercel/stega - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

./dist/index.js

@@ -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},d=new Array(4).fill(String.fromCodePoint(c[0])).join(""),m=String.fromCharCode(0);function E(t){let e=JSON.stringify(t);return`${d}${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))?Boolean(Date.parse(t)):!1}function x(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)||x(t))?t:`${t}${E(e)}`}var S=Object.fromEntries(Object.entries(c).map(t=>t.reverse())),g=Object.fromEntries(Object.entries(s).map(t=>t.reverse())),T=`${Object.values(s).map(t=>`\\u{${t.toString(16)}}`).join("")}`,f= exports.VERCEL_STEGA_REGEX =new RegExp(`[${T}]{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(d))return A(r,e)}else throw new Error("Encoded data has invalid length");let n=[];for(let o=r.length*.25;o--;){let l=r.slice(o*4,o*4+4).map(u=>S[u.codePointAt(0)]).join("");n.unshift(String.fromCharCode(parseInt(l,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 u;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("")],l=10;for(;o.length;){let i=o.shift();try{if(n.push(JSON.parse(i)),e)return n}catch(a){if(!l--)throw a;let p=+((u=a.message.match(/\sposition\s(\d+)$/))==null?void 0:u[1]);if(!p)throw a;o.unshift(i.substring(0,p),i.substring(p))}}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 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 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 = _;

@@ -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},d=new Array(4).fill(String.fromCodePoint(c[0])).join(""),m=String.fromCharCode(0);function E(t){let e=JSON.stringify(t);return`${d}${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))?Boolean(Date.parse(t)):!1}function x(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)||x(t))?t:`${t}${E(e)}`}var S=Object.fromEntries(Object.entries(c).map(t=>t.reverse())),g=Object.fromEntries(Object.entries(s).map(t=>t.reverse())),T=`${Object.values(s).map(t=>`\\u{${t.toString(16)}}`).join("")}`,f= exports.VERCEL_STEGA_REGEX =new RegExp(`[${T}]{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(d))return A(r,e)}else throw new Error("Encoded data has invalid length");let n=[];for(let o=r.length*.25;o--;){let l=r.slice(o*4,o*4+4).map(u=>S[u.codePointAt(0)]).join("");n.unshift(String.fromCharCode(parseInt(l,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 u;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("")],l=10;for(;o.length;){let i=o.shift();try{if(n.push(JSON.parse(i)),e)return n}catch(a){if(!l--)throw a;let p=+((u=a.message.match(/\sposition\s(\d+)$/))==null?void 0:u[1]);if(!p)throw a;o.unshift(i.substring(0,p),i.substring(p))}}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 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 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 = _;
{
"name": "@vercel/stega",
"version": "0.1.1",
"version": "0.1.2",
"description": "Utilities for steganography",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc