New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

antiflux

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

antiflux - npm Package Compare versions

Comparing version 0.1.20 to 0.1.21

2

dist/index.js

@@ -1,2 +0,2 @@

(()=>{"use strict";var t={n:e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},d:(e,r)=>{for(var s in r)t.o(r,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:r[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>h});const r=require("events"),s=require("fs");var o=t.n(s);const i=require("crypto");var n=t.n(i);const c="aes-256-gcm",a=o().readFileSync,l=o().writeFileSync,h=class{constructor(t={},e={},i={}){if(this.state={},this.options=e,e.debug&&process.env.DEBUG,this.watch=new r.EventEmitter,e.debug&&(this.watch.on("set",(t=>{console.log(`(Store) ${t.key}: ${t.prior} ➟ ${t.value}`)})),this.watch.on("delete",(t=>{console.log(`(Store) ${t.key}: ${t.prior} ➟ DELETED`)})),this.watch.on("clear",(()=>{console.log("(Store) STATE ➟ CLEARED")}))),e.persist){const t=()=>{const t=this.dump();e.debug&&(console.log("Writing to disk:"),console.log(t)),((t,e,r)=>{try{r&&(e=((t,e)=>{try{if(t){if(e){"string"!=typeof e&&(e=JSON.stringify(e));const r=n().randomBytes(12),s=n().createCipheriv(c,t,r);let o=s.update(e,"utf8","base64");return o+=s.final("base64"),{enc:o,iv:r,tag:s.getAuthTag()}}return void(process.env.DEBUG&&console.log("No data to encrypt"))}throw new Error("You must specify an encryption key")}catch(t){throw console.error(t),t}})(r,e)),l(t,JSON.stringify(e),"utf8")}catch(t){throw new Error("Could not write to file")}})(e.persist,t,e.encryptKey)};this.watch.on("set",(()=>t())),this.watch.on("delete",(()=>t())),this.watch.on("clear",(()=>t()))}if(e.persist&&(0,s.existsSync)(e.persist)){const t=((t,e)=>{try{if(o().existsSync(t)){let s=a(t,"utf8");return s=JSON.parse(s),e&&(s=((t,e)=>{try{if(t){if(e){const{enc:r,iv:s,tag:o}=e,i=n().createDecipheriv(c,t,Buffer.from(s));i.setAuthTag(Buffer.from(o));let a=i.update(r,"base64","utf8");return a+=i.final("utf8"),JSON.parse(a)}return void(process.env.DEBUG&&console.log("No data to decrypt"))}throw new Error("You must specify an encryption key")}catch(t){throw console.error(t),t}})(e,s)),r=s,Object.keys(r).sort().reduce((function(t,e){return t[e]=r[e],t}),{})}throw new Error("File does not exist")}catch(t){console.error(t)}var r})(e.persist,e.encryptKey);for(const e in t)this.set(e,t[e])}else for(const e in t)this.set(e,t[e]);i&&(this.getters=i)}get(t){if(this.state[t])return this.state[t];if(t.includes(".")){const e=t.split(".");let r;for(const t in e)r=r?r[e[t]]:this.state[e[t]];return r}}getter(t){if(this.getters&&this.getters[t])return this.getters[t](this.dump())}dump(){return Object.assign({},this.state)}set(t,e){const r=this.get(t);t.includes(".")?this.state=((t,e,r)=>{if(e.includes(".")){const s=e.split("."),o=t[s[0]];let i="";if(s.length>1){let e=1;for(;e<s.length;)i+=`{ "${s[e]}": `,e++;for(i+="string"==typeof r?`"${r}"`:JSON.stringify(r),e=1;e<s.length;)i+=" }",e++;return i=JSON.parse(i),t[s[0]]=Object.assign(o,i),t||{}}}})(this.state,t,e):this.state[t]=e,this.watch.emit("set",{key:t,value:e,prior:r})}has(t){if(t.includes(".")){const e=t.split(".");let r={};for(const t in e)r=r?r[e[t]]:this.state[e[t]];return void 0!==r}return Object.prototype.hasOwnProperty.call(this.state,t)}delete(t){const e=this.get(t);delete this.state[t],this.watch.emit("delete",{key:t,prior:e})}clear(){for(const t in this.state)delete this.state[t];this.watch.emit("clear")}};exports.Antiflux=e})();
var Antiflux;(()=>{"use strict";var t={n:e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},d:(e,r)=>{for(var s in r)t.o(r,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:r[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>h});const r=require("events"),s=require("fs");var o=t.n(s);const i=require("crypto");var n=t.n(i);const c="aes-256-gcm",a=o().readFileSync,l=o().writeFileSync,h=class{constructor(t={},e={},i={}){if(this.state={},this.options=e,e.debug&&process.env.DEBUG,this.watch=new r.EventEmitter,e.debug&&(this.watch.on("set",(t=>{console.log(`(Store) ${t.key}: ${t.prior} ➟ ${t.value}`)})),this.watch.on("delete",(t=>{console.log(`(Store) ${t.key}: ${t.prior} ➟ DELETED`)})),this.watch.on("clear",(()=>{console.log("(Store) STATE ➟ CLEARED")}))),e.persist){const t=()=>{const t=this.dump();e.debug&&(console.log("Writing to disk:"),console.log(t)),((t,e,r)=>{try{r&&(e=((t,e)=>{try{if(t){if(e){"string"!=typeof e&&(e=JSON.stringify(e));const r=n().randomBytes(12),s=n().createCipheriv(c,t,r);let o=s.update(e,"utf8","base64");return o+=s.final("base64"),{enc:o,iv:r,tag:s.getAuthTag()}}return void(process.env.DEBUG&&console.log("No data to encrypt"))}throw new Error("You must specify an encryption key")}catch(t){throw console.error(t),t}})(r,e)),l(t,JSON.stringify(e),"utf8")}catch(t){throw new Error("Could not write to file")}})(e.persist,t,e.encryptKey)};this.watch.on("set",(()=>t())),this.watch.on("delete",(()=>t())),this.watch.on("clear",(()=>t()))}if(e.persist&&(0,s.existsSync)(e.persist)){const t=((t,e)=>{try{if(o().existsSync(t)){let s=a(t,"utf8");return s=JSON.parse(s),e&&(s=((t,e)=>{try{if(t){if(e){const{enc:r,iv:s,tag:o}=e,i=n().createDecipheriv(c,t,Buffer.from(s));i.setAuthTag(Buffer.from(o));let a=i.update(r,"base64","utf8");return a+=i.final("utf8"),JSON.parse(a)}return void(process.env.DEBUG&&console.log("No data to decrypt"))}throw new Error("You must specify an encryption key")}catch(t){throw console.error(t),t}})(e,s)),r=s,Object.keys(r).sort().reduce((function(t,e){return t[e]=r[e],t}),{})}throw new Error("File does not exist")}catch(t){console.error(t)}var r})(e.persist,e.encryptKey);for(const e in t)this.set(e,t[e])}else for(const e in t)this.set(e,t[e]);i&&(this.getters=i)}get(t){if(this.state[t])return this.state[t];if(t.includes(".")){const e=t.split(".");let r;for(const t in e)r=r?r[e[t]]:this.state[e[t]];return r}}getter(t){if(this.getters&&this.getters[t])return this.getters[t](this.dump())}dump(){return Object.assign({},this.state)}set(t,e){const r=this.get(t);t.includes(".")?this.state=((t,e,r)=>{if(e.includes(".")){const s=e.split("."),o=t[s[0]];let i="";if(s.length>1){let e=1;for(;e<s.length;)i+=`{ "${s[e]}": `,e++;for(i+="string"==typeof r?`"${r}"`:JSON.stringify(r),e=1;e<s.length;)i+=" }",e++;return i=JSON.parse(i),t[s[0]]=Object.assign(o,i),t||{}}}})(this.state,t,e):this.state[t]=e,this.watch.emit("set",{key:t,value:e,prior:r})}has(t){if(t.includes(".")){const e=t.split(".");let r={};for(const t in e)r=r?r[e[t]]:this.state[e[t]];return void 0!==r}return Object.prototype.hasOwnProperty.call(this.state,t)}delete(t){const e=this.get(t);delete this.state[t],this.watch.emit("delete",{key:t,prior:e})}clear(){for(const t in this.state)delete this.state[t];this.watch.emit("clear")}};Antiflux=e})();
//# sourceMappingURL=index.js.map
{
"name": "antiflux",
"version": "0.1.20",
"version": "0.1.21",
"keywords": [

@@ -5,0 +5,0 @@ "store",

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