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.12.4 to 1.13.0-alpha.0

demo/node_modules/idmp/dist/index.browser.esm.js

2

dist/index.browser.esm.js

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

/*! idmp v1.12.4 | (c) github/haozi | MIT */
/*! idmp v1.13.0-alpha.0 | (c) github/haozi | MIT */
const p = () => {

@@ -3,0 +3,0 @@ };

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

/*! idmp v1.12.4 | (c) github/haozi | MIT */
/*! idmp v1.13.0-alpha.0 | (c) github/haozi | MIT */
(function(n,i){typeof exports=="object"&&typeof module!="undefined"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(n=typeof globalThis!="undefined"?globalThis:n||self,i(n.idmp={}))})(this,function(n){"use strict";const g=()=>{},l=t=>t<0?0:t>6048e5?6048e5:t;n.g={};const a=t=>{const{maxRetry:f=30,maxAge:u=3e3,onBeforeRetry:c=g}=t||{},m=l(u);return{maxRetry:f,maxAge:m,onBeforeRetry:c,f:u===1/0}},r=t=>{t&&delete n.g[t]},_=()=>{n.g={}},h=(t,f,u)=>{if(!t)return f();const{maxRetry:c,maxAge:m,onBeforeRetry:p,f:R}=a(u);n.g[t]=n.g[t]||{0:0,1:0,4:[]};const e=n.g[t],T=()=>{e[1]=0,e[2]=void 0,e[3]=void 0},M=()=>{const o=e[4].length;for(let s=0;s<o;++s)e[4][s][0](e[2]);e[4]=[],R||setTimeout(()=>{r(t)},m)},y=()=>{const o=e[4].length-c;for(let s=0;s<o;++s)e[4][s][1](e[3]);r(t)},A=()=>new Promise((o,s)=>{if(!e[5]&&(e[5]=f),e[2]){o(e[2]);return}e[1]===0?(e[1]=1,e[4].push([o,s]),e[5]().then(d=>{e[2]=d,M(),e[1]=4}).catch(d=>{e[1]=3,e[3]=d,++e[0],e[0]>c?y():(p(d,{globalKey:t,retryCount:e[0]}),T(),setTimeout(A,(e[0]-1)*50))})):e[1]===1&&e[4].push([o,s])});return A()};h.flush=r,h.flushAll=_,n.default=h,n.getOptions=a,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});

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

/*! idmp v1.12.4 | (c) github/haozi | MIT */
/*! idmp v1.13.0-alpha.0 | (c) github/haozi | MIT */
const DEFAULT_MAX_AGE = 3e3;

@@ -3,0 +3,0 @@ const _7days = 6048e5;

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

/*! idmp v1.12.4 | (c) github/haozi | MIT */
/*! idmp v1.13.0-alpha.0 | (c) github/haozi | MIT */
const DEFAULT_MAX_AGE = 3e3;

@@ -3,0 +3,0 @@ const _7days = 6048e5;

{
"name": "idmp",
"version": "1.12.4",
"version": "1.13.0-alpha.0",
"keywords": [

@@ -19,3 +19,3 @@ "deduplicate network requests",

],
"homepage": "https://ha0z1.github.io/idmp/",
"homepage": "https://idmp.vercel.app",
"bugs": "https://github.com/ha0z1/idmp/issues",

@@ -30,3 +30,4 @@ "repository": {

".": "./dist/index.js",
"./node-fs": "./plugins/node-fs/dist/index.js"
"./node-fs": "./plugins/node-fs/dist/index.js",
"./browser-storage": "./plugins/browser-storage/dist/index.js"
},

@@ -33,0 +34,0 @@ "main": "./dist/index.node.cjs",

import { type Idmp, type IdmpOptions, type IdmpPromise } from 'idmp';
declare const cacheDir: string;
declare const getCachePath: (globalKey: string) => string;
declare const fsIdmpWrap: (_idmp: Idmp) => {

@@ -9,2 +10,2 @@ <T>(globalKey: string, promiseFunc: IdmpPromise<T>, options?: IdmpOptions): Promise<any>;

export default fsIdmpWrap;
export { cacheDir };
export { cacheDir, getCachePath };

@@ -66,4 +66,5 @@ /*! idmp v1.0.0 | (c) github/haozi | MIT */

cacheDir,
fsIdmpWrap as default
fsIdmpWrap as default,
getCachePath
};
//# sourceMappingURL=index.js.map

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

/*! idmp v1.12.4 | (c) github/haozi | MIT */
/*! idmp v1.13.0-alpha.0 | (c) github/haozi | MIT */
const p = () => {

@@ -3,0 +3,0 @@ };

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

/*! idmp v1.12.4 | (c) github/haozi | MIT */
/*! idmp v1.13.0-alpha.0 | (c) github/haozi | MIT */
(function(n,i){typeof exports=="object"&&typeof module!="undefined"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(n=typeof globalThis!="undefined"?globalThis:n||self,i(n.idmp={}))})(this,function(n){"use strict";const g=()=>{},l=t=>t<0?0:t>6048e5?6048e5:t;n.g={};const a=t=>{const{maxRetry:f=30,maxAge:u=3e3,onBeforeRetry:c=g}=t||{},m=l(u);return{maxRetry:f,maxAge:m,onBeforeRetry:c,f:u===1/0}},r=t=>{t&&delete n.g[t]},_=()=>{n.g={}},h=(t,f,u)=>{if(!t)return f();const{maxRetry:c,maxAge:m,onBeforeRetry:p,f:R}=a(u);n.g[t]=n.g[t]||{0:0,1:0,4:[]};const e=n.g[t],T=()=>{e[1]=0,e[2]=void 0,e[3]=void 0},M=()=>{const o=e[4].length;for(let s=0;s<o;++s)e[4][s][0](e[2]);e[4]=[],R||setTimeout(()=>{r(t)},m)},y=()=>{const o=e[4].length-c;for(let s=0;s<o;++s)e[4][s][1](e[3]);r(t)},A=()=>new Promise((o,s)=>{if(!e[5]&&(e[5]=f),e[2]){o(e[2]);return}e[1]===0?(e[1]=1,e[4].push([o,s]),e[5]().then(d=>{e[2]=d,M(),e[1]=4}).catch(d=>{e[1]=3,e[3]=d,++e[0],e[0]>c?y():(p(d,{globalKey:t,retryCount:e[0]}),T(),setTimeout(A,(e[0]-1)*50))})):e[1]===1&&e[4].push([o,s])});return A()};h.flush=r,h.flushAll=_,n.default=h,n.getOptions=a,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});

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

/*! idmp v1.12.4 | (c) github/haozi | MIT */
/*! idmp v1.13.0-alpha.0 | (c) github/haozi | MIT */
const DEFAULT_MAX_AGE = 3e3;

@@ -3,0 +3,0 @@ const _7days = 6048e5;

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

/*! idmp v1.12.4 | (c) github/haozi | MIT */
/*! idmp v1.13.0-alpha.0 | (c) github/haozi | MIT */
const DEFAULT_MAX_AGE = 3e3;

@@ -3,0 +3,0 @@ const _7days = 6048e5;

@@ -14,3 +14,3 @@ # idmp

- Demo <https://ha0z1.github.io/idmp/>
- Demo <https://idmp.vercel.app>

@@ -73,6 +73,6 @@ ## Usage

- [Data Persistence with node-fs](plugins/node-fs/README.md) (Persist data to the file system)
- Data Persistence with localStorage
- Data Persistence with sessionStorage
- Data Persistence with indexedDB
- Data Persistence with chrome-extension
- [Data Persistence with localStorage](https://github.com/ha0z1/idmp/blob/main/plugins/browser-storage/README.md)
- [Data Persistence with sessionStorage](https://github.com/ha0z1/idmp/blob/main/plugins/browser-storage/README.md)
- Data Persistence with indexedDB // TODO
- Data Persistence with chrome-extension // TODO

@@ -146,3 +146,3 @@ ## Options

See [demo](https://ha0z1.github.io/idmp/) and [source code](https://github.com/ha0z1/idmp/tree/main/demo)
See [demo](https://idmp.vercel.app) and [source code](https://github.com/ha0z1/idmp/tree/main/demo)

@@ -149,0 +149,0 @@ So when module A or module B's code is deleted, there is no need to maintain their cache.

@@ -14,3 +14,3 @@ # idmp

- Demo <https://ha0z1.github.io/idmp/>
- Demo <https://idmp.vercel.app>

@@ -73,6 +73,6 @@ ## 使用

- [使用node-fs进行数据持久化](plugins/node-fs/README.md)(将数据持久化到文件系统)
- 使用 localStorage 进行数据持久化
- 使用 sessionStorage 进行数据持久化
- 使用 indexedDB 进行数据持久化
- 使用 chrome-extension 实现数据持久化
- [使用 localStorage 进行数据持久化](https://github.com/ha0z1/idmp/blob/main/plugins/browser-storage/README.md)
- [使用 sessionStorage 进行数据持久化](https://github.com/ha0z1/idmp/blob/main/plugins/browser-storage/README.md)
- 使用 indexedDB 进行数据持久化 // TODO
- 使用 chrome-extension 实现数据持久化 // TODO

@@ -146,3 +146,3 @@ ## Options

查看 [demo](https://ha0z1.github.io/idmp/) 和[源码](https://github.com/ha0z1/idmp/tree/main/demo)
查看 [demo](https://idmp.vercel.app) 和[源码](https://github.com/ha0z1/idmp/tree/main/demo)

@@ -149,0 +149,0 @@ 这样当模块 A 或者模块 B 的代码删除后,是不需要维护他们的缓存的。

Sorry, the diff of this file is not supported yet

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