Comparing version 1.11.6 to 1.12.0
@@ -1,2 +0,2 @@ | ||
/*! idmp v1.11.6 | (c) github/haozi | MIT */ | ||
/*! idmp v1.12.0 | (c) github/haozi | MIT */ | ||
const p = () => { | ||
@@ -3,0 +3,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
/*! idmp v1.11.6 | (c) github/haozi | MIT */ | ||
/*! idmp v1.12.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.11.6 | (c) github/haozi | MIT */ | ||
/*! idmp v1.12.0 | (c) github/haozi | MIT */ | ||
const DEFAULT_MAX_AGE = 3e3; | ||
@@ -3,0 +3,0 @@ const _7days = 6048e5; |
@@ -1,2 +0,2 @@ | ||
/*! idmp v1.11.6 | (c) github/haozi | MIT */ | ||
/*! idmp v1.12.0 | (c) github/haozi | MIT */ | ||
const DEFAULT_MAX_AGE = 3e3; | ||
@@ -210,3 +210,5 @@ const _7days = 6048e5; | ||
const line = arr[idx + offset + 1] || ""; | ||
return line; | ||
if (line.includes("idmp")) | ||
return line; | ||
return ""; | ||
} catch (e) { | ||
@@ -236,5 +238,8 @@ } | ||
${[ | ||
`1.${line1}`, | ||
`1.${line1} ${cache[ | ||
6 | ||
/* _sourceStack */ | ||
]}`, | ||
"------------", | ||
`2.${line2}` | ||
`2.${line2} ${err.stack}` | ||
].join("\n")}` | ||
@@ -241,0 +246,0 @@ ); |
{ | ||
"name": "idmp", | ||
"version": "1.11.6", | ||
"version": "1.12.0", | ||
"keywords": [ | ||
@@ -28,5 +28,4 @@ "deduplicate network requests", | ||
"exports": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.node.cjs" | ||
".": "./dist/index.js", | ||
"./node-fs": "./plugins/node-fs/dist/index.js" | ||
}, | ||
@@ -37,4 +36,5 @@ "main": "./dist/index.node.cjs", | ||
"files": [ | ||
"dist" | ||
"**/dist", | ||
"*.d.ts" | ||
] | ||
} |
@@ -65,2 +65,14 @@ # idmp | ||
## Plugins | ||
`idmp` has a powerful plugin system. The following plugins are officially maintained, and you can also reference the source code to create your own plugins: | ||
The analogy to higher-order functions elegantly conveys that plugins can extend idmp's core functionality in a non-invasive way, similar to mathematical functions $g(f)(x)$. This provides great flexibility and extensibility to the plugin system. | ||
- [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 | ||
## Options | ||
@@ -67,0 +79,0 @@ |
@@ -65,2 +65,14 @@ # idmp | ||
## 插件 | ||
`idmp` 有一个强大的插件系统。 以下插件是官方维护的,您也可以参考源码创建自己的插件: | ||
与高阶函数的类比优雅地传达了插件可以以非侵入性方式扩展 idmp 的核心功能,类似于数学函数 $g(f)(x)$。 这为插件系统提供了极大的灵活性和可扩展性。 | ||
- [使用node-fs进行数据持久化](plugins/node-fs/README.md)(将数据持久化到文件系统) | ||
- 使用 localStorage 进行数据持久化 | ||
- 使用 sessionStorage 进行数据持久化 | ||
- 使用 indexedDB 进行数据持久化 | ||
- 使用 chrome-extension 实现数据持久化 | ||
## Options | ||
@@ -67,0 +79,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
118711
22
2386
342
1