@redux-saga/delay-p
Advanced tools
Comparing version 1.1.2 to 1.2.0
@@ -7,2 +7,3 @@ 'use strict'; | ||
var MAX_SIGNED_INT = 2147483647; | ||
function delayP(ms, val) { | ||
@@ -13,5 +14,10 @@ if (val === void 0) { | ||
// https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#maximum_delay_value | ||
if (process.env.NODE_ENV !== 'production' && ms > MAX_SIGNED_INT) { | ||
throw new Error('delay only supports a maximum value of ' + MAX_SIGNED_INT + 'ms'); | ||
} | ||
var timeoutId; | ||
var promise = new Promise(function (resolve) { | ||
timeoutId = setTimeout(resolve, ms, val); | ||
timeoutId = setTimeout(resolve, Math.min(MAX_SIGNED_INT, ms), val); | ||
}); | ||
@@ -18,0 +24,0 @@ |
import { CANCEL } from '@redux-saga/symbols'; | ||
var MAX_SIGNED_INT = 2147483647; | ||
function delayP(ms, val) { | ||
@@ -8,5 +9,10 @@ if (val === void 0) { | ||
// https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#maximum_delay_value | ||
if (process.env.NODE_ENV !== 'production' && ms > MAX_SIGNED_INT) { | ||
throw new Error('delay only supports a maximum value of ' + MAX_SIGNED_INT + 'ms'); | ||
} | ||
var timeoutId; | ||
var promise = new Promise(function (resolve) { | ||
timeoutId = setTimeout(resolve, ms, val); | ||
timeoutId = setTimeout(resolve, Math.min(MAX_SIGNED_INT, ms), val); | ||
}); | ||
@@ -13,0 +19,0 @@ |
{ | ||
"name": "@redux-saga/delay-p", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "Promisified setTimeout", | ||
@@ -10,4 +10,14 @@ "main": "./dist/redux-saga-delay-p.cjs.js", | ||
"dist", | ||
"*.d.ts" | ||
"*.d.ts", | ||
"import-condition-proxy.mjs" | ||
], | ||
"exports": { | ||
".": { | ||
"types": "./index.d.ts", | ||
"module": "./dist/redux-saga-delay-p.esm.js", | ||
"import": "./import-condition-proxy.mjs", | ||
"default": "./dist/redux-saga-delay-p.cjs.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"scripts": { | ||
@@ -19,3 +29,3 @@ "clean": "rimraf dist", | ||
}, | ||
"repository": "https://github.com/redux-saga/redux-saga/tree/master/packages/delay-p", | ||
"repository": "https://github.com/redux-saga/redux-saga/tree/main/packages/delay-p", | ||
"keywords": [ | ||
@@ -61,4 +71,3 @@ "promise", | ||
"rollup-plugin-babel": "5.0.0-alpha.0" | ||
}, | ||
"gitHead": "da88bb4df0de4066597bd34739580d986f67e0f0" | ||
} | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
46
3389
2
1