Socket
Socket
Sign inDemoInstall

idmp

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

idmp - npm Package Compare versions

Comparing version 1.8.4 to 1.9.0

32

dist/index.js

@@ -6,14 +6,24 @@ const DEFAULT_MAX_AGE = 3e3;

const udf = void 0;
const deepFreeze = (obj) => {
if (!obj)
return obj;
if (typeof obj !== "object")
return obj;
Object.keys(obj).forEach((property) => {
if (typeof obj[property] === "object" && !Object.isFrozen(obj[property])) {
deepFreeze(obj[property]);
const defineReactive = (obj, key, value) => {
readonly(value);
Object.defineProperty(obj, key, {
get: () => value,
set: (newValue) => {
const msg = `[idmp error] The data is read-only, set ${key.toString()}=${JSON.stringify(
newValue
)} is not allow`;
console.error(`%c ${msg}`, "font-weight: lighter; color: red");
throw new Error(msg);
}
});
return Object.freeze(obj);
};
const readonly = (obj) => {
if (obj === null || typeof obj !== "object") {
return obj;
}
Object.keys(obj).forEach((key) => {
defineReactive(obj, key, obj[key]);
});
return obj;
};
const getRange = (maxAge) => {

@@ -37,3 +47,3 @@ if (maxAge < 0)

if (process.env.NODE_ENV !== "production") {
options = deepFreeze(options);
options = readonly(options);
}

@@ -252,3 +262,3 @@ const {

/* resData */
] = deepFreeze(data);
] = readonly(data);
} else {

@@ -255,0 +265,0 @@ cache[

{
"name": "idmp",
"version": "1.8.4",
"version": "1.9.0",
"keywords": [

@@ -5,0 +5,0 @@ "cache response",

Sorry, the diff of this file is not supported yet

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