Socket
Socket
Sign inDemoInstall

idmp

Package Overview
Dependencies
0
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.9.0 to 1.9.1

1

dist/index.browser.esm.js

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

/*! idmp v1.9.1 | (c) github/haozi | MIT */
const R = () => {

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

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

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

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

/*! idmp v1.9.1 | (c) github/haozi | MIT */
const DEFAULT_MAX_AGE = 3e3;

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

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

/*! idmp v1.9.1 | (c) github/haozi | MIT */
const DEFAULT_MAX_AGE = 3e3;

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

2

package.json
{
"name": "idmp",
"version": "1.9.0",
"version": "1.9.1",
"keywords": [

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

@@ -8,3 +8,3 @@ # idmp

[![LICENSE](https://img.shields.io/npm/l/idmp)](https://github.com/ha0z1/idmp/blob/main/LICENSE)
[![Size](https://img.shields.io/bundlephobia/minzip/idmp.svg)](https://unpkg.com/idmp/dist/)
[![Size](https://img.shields.io/bundlephobia/minzip/idmp.svg)](https://cdn.jsdelivr.net/npm/idmp/+esm)

@@ -11,0 +11,0 @@ An elegant library to solve duplicate and concurrent calls for idempotent functions, pure function. Less than 1 KB after Gzip

@@ -8,3 +8,3 @@ # idmp

[![LICENSE](https://img.shields.io/npm/l/idmp)](https://github.com/ha0z1/idmp/blob/main/LICENSE)
[![Size](https://img.shields.io/bundlephobia/minzip/idmp.svg)](https://unpkg.com/idmp/dist/)
[![Size](https://img.shields.io/bundlephobia/minzip/idmp.svg)](https://cdn.jsdelivr.net/npm/idmp/+esm)

@@ -11,0 +11,0 @@ 一个优雅地解决幂等(idempotent) 函数的重复和并发调用的小库,纯函数,Gzip 后不到 1 KB

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc