Socket
Socket
Sign inDemoInstall

next-tick

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.1.0

.editorconfig

17

index.js
'use strict';
var callable, byObserver;
callable = function (fn) {
var ensureCallable = function (fn) {
if (typeof fn !== 'function') throw new TypeError(fn + " is not a function");

@@ -10,3 +8,3 @@ return fn;

byObserver = function (Observer) {
var byObserver = function (Observer) {
var node = document.createTextNode(''), queue, currentQueue, i = 0;

@@ -37,3 +35,3 @@ new Observer(function () {

return function (fn) {
callable(fn);
ensureCallable(fn);
if (queue) {

@@ -55,2 +53,7 @@ if (typeof queue === 'function') queue = [queue, fn];

// queueMicrotask
if (typeof queueMicrotask === "function") {
return function (cb) { queueMicrotask(ensureCallable(cb)); };
}
// MutationObserver

@@ -65,3 +68,3 @@ if ((typeof document === 'object') && document) {

if (typeof setImmediate === 'function') {
return function (cb) { setImmediate(callable(cb)); };
return function (cb) { setImmediate(ensureCallable(cb)); };
}

@@ -71,3 +74,3 @@

if ((typeof setTimeout === 'function') || (typeof setTimeout === 'object')) {
return function (cb) { setTimeout(callable(cb), 0); };
return function (cb) { setTimeout(ensureCallable(cb), 0); };
}

@@ -74,0 +77,0 @@

{
"name": "next-tick",
"version": "1.0.0",
"description": "Environment agnostic nextTick polyfill",
"author": "Mariusz Nowak <medyk@medikoo.com> (http://www.medikoo.com/)",
"keywords": [
"nexttick",
"setImmediate",
"setTimeout",
"async"
],
"repository": {
"type": "git",
"url": "git://github.com/medikoo/next-tick.git"
},
"devDependencies": {
"tad": "^0.2.4",
"xlint": "^0.2.2",
"xlint-jslint-medikoo": "^0.1.4"
},
"scripts": {
"lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
"lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
"test": "node node_modules/tad/bin/tad"
},
"license": "MIT"
"name": "next-tick",
"version": "1.1.0",
"description": "Environment agnostic nextTick polyfill",
"author": "Mariusz Nowak <medyk@medikoo.com> (http://www.medikoo.com/)",
"keywords": [
"nexttick",
"setImmediate",
"setTimeout",
"async"
],
"repository": {
"type": "git",
"url": "git://github.com/medikoo/next-tick.git"
},
"devDependencies": {
"tad": "^3.0.1",
"xlint": "^0.2.2",
"xlint-jslint-medikoo": "^0.1.4"
},
"scripts": {
"lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
"lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
"test": "node node_modules/tad/bin/tad"
},
"license": "ISC"
}

@@ -7,3 +7,4 @@ # next-tick

- When run in Node.js `process.nextTick` is used
- In modern browsers microtask resolution is guaranteed by `MutationObserver`
- In modern engines, microtask resolution is guaranteed by `queueMicrotask`
- In older browsers, `MutationObserver` is used as a fallback
- In other engines `setImmediate` or `setTimeout(fn, 0)` is used as fallback.

@@ -21,3 +22,3 @@ - If none of the above is supported module resolves to `null`

You can easily bundle `next-tick` for browser with any CJS bundler, e.g. [modules-webmake](https://github.com/medikoo/modules-webmake)
To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)

@@ -27,1 +28,17 @@ ## Tests [![Build Status](https://api.travis-ci.org/medikoo/next-tick.png?branch=master)](https://travis-ci.org/medikoo/next-tick)

$ npm test
## Security contact information
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-next-tick?utm_source=npm-next-tick&utm_medium=referral&utm_campaign=readme">Get professional support for d with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc