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.0 to 1.8.1

79

dist/index.js

@@ -62,2 +62,17 @@ const DEFAULT_MAX_AGE = 3e3;

const cache = _globalStore[globalKey];
let callStack = "";
const printLogs = (...msg) => {
if (console.groupCollapsed) {
console.groupCollapsed(...msg);
console.log("globalKey:", globalKey);
console.log("callStack:", callStack);
console.log("data:", cache[
2
/* resData */
]);
console.groupEnd();
} else {
console.log(...msg);
}
};
const reset = () => {

@@ -92,7 +107,10 @@ cache[

if (i === 0) {
console.log(`[idmp info] ${globalKey == null ? void 0 : globalKey.toString()} from origin`);
printLogs(
`%c[idmp info] ${globalKey == null ? void 0 : globalKey.toString()} from origin`,
"font-weight: lighter"
);
} else {
console.log(
printLogs(
`%c[idmp info] ${globalKey == null ? void 0 : globalKey.toString()} from cache`,
"color: gray"
"color: gray; font-weight: lighter"
);

@@ -143,2 +161,28 @@ }

} catch (err) {
const getCodeLine = (stack, offset = 0) => {
try {
let arr = stack.split("\n").filter((o) => o.includes(":"));
let idx = Infinity;
$0:
for (let key of [
"idmp/src/index.ts",
"idmp/",
"idmp\\",
"idmp"
]) {
let _idx = arr.length - 1;
$1:
for (; _idx >= 0; --_idx) {
if (arr[_idx].indexOf(key) > -1) {
idx = _idx;
break $0;
}
}
}
const line = arr[idx + offset + 1] || "";
return line;
} catch (e) {
}
};
callStack = getCodeLine(err.stack, 1).split(" ").pop() || "";
!cache[

@@ -155,27 +199,2 @@ 6

] !== err.stack) {
const getCodeLine = (stack) => {
try {
const arr = stack.split("\n").filter((o) => o.includes(":"));
let idx = Infinity;
$0:
for (let key of [
"idmp/src/index.ts",
"idmp/",
"idmp\\",
"idmp"
]) {
let _idx = arr.length - 1;
$1:
for (; _idx >= 0; --_idx) {
if (arr[_idx].indexOf(key) > -1) {
idx = _idx;
break $0;
}
}
}
const line = arr[idx + 1] || "";
return line;
} catch (e) {
}
};
const line1 = getCodeLine(cache[

@@ -204,5 +223,5 @@ 6

if (process.env.NODE_ENV !== "production") {
console.log(
printLogs(
`%c[idmp info] \`${globalKey == null ? void 0 : globalKey.toString()}\` from cache`,
"color: gray"
"color: gray;font-weight: lighter"
);

@@ -209,0 +228,0 @@ }

{
"name": "idmp",
"version": "1.8.0",
"version": "1.8.1",
"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