set-immediate-shim
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -1,5 +0,6 @@ | ||
'use strict'; | ||
module.exports = typeof setImmediate === 'function' ? setImmediate : (...args) => { | ||
args.splice(1, 0, 0); | ||
setTimeout(...args); | ||
const setImmediate = typeof globalThis.setImmediate === 'function' ? globalThis.setImmediate : (...arguments_) => { | ||
arguments_.splice(1, 0, 0); | ||
setTimeout(...arguments_); | ||
}; | ||
export default setImmediate; |
{ | ||
"name": "set-immediate-shim", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Simple setImmediate shim", | ||
"license": "MIT", | ||
"repository": "sindresorhus/set-immediate-shim", | ||
"funding": "https://github.com/sponsors/sindresorhus", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
"url": "https://sindresorhus.com" | ||
}, | ||
"type": "module", | ||
"exports": { | ||
"types": "./index.d.ts", | ||
"default": "./index.js" | ||
}, | ||
"sideEffects": false, | ||
"engines": { | ||
"node": ">=6" | ||
"node": ">=18" | ||
}, | ||
@@ -31,6 +38,5 @@ "scripts": { | ||
"devDependencies": { | ||
"ava": "*", | ||
"import-fresh": "^2.0.0", | ||
"xo": "*" | ||
"ava": "^6.1.2", | ||
"xo": "^0.58.0" | ||
} | ||
} |
@@ -1,17 +0,17 @@ | ||
# set-immediate-shim [![Build Status](https://travis-ci.org/sindresorhus/set-immediate-shim.svg?branch=master)](https://travis-ci.org/sindresorhus/set-immediate-shim) | ||
# set-immediate-shim | ||
> Simple [`setImmediate`](https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate) [ponyfill](https://ponyfill.com) | ||
Note: This shim is [quite inefficient](https://github.com/sindresorhus/set-immediate-shim/issues/4). | ||
## Install | ||
```sh | ||
npm install set-immediate-shim | ||
``` | ||
$ npm install set-immediate-shim | ||
``` | ||
## Usage | ||
```js | ||
const setImmediateShim = require('set-immediate-shim'); | ||
import setImmediateShim from 'set-immediate-shim'; | ||
@@ -28,10 +28,4 @@ setImmediateShim(() => { | ||
## Related | ||
- [p-immediate](https://github.com/sindresorhus/p-immediate) - Returns a promise resolved in the next event loop - think `setImmediate()` | ||
## License | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
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
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
2675
2
Yes
31