Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

asynciterator

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asynciterator - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

38

asynciterator.js
var EventEmitter = require('events').EventEmitter;
// Executes the given function with arguments as soon as possible
var immediate = (function () {
// Using native `setImmediate` is fastest in Node.js
/* istanbul ignore else */
if (typeof process !== 'undefined' && !process.browser)
return setImmediate;
// In all other cases, rely on the `immediate` shim
else {
var immediate = require('immediate'), calls = 0;
return function (f, a, b, c, d) {
// Every once in a while, allow some time for events, painting, etc.
calls++ === 1e4 ? setTimeout(f, calls = 0, a, b, c, d) : immediate(f, a, b, c, d);
};
}
}());
/**

@@ -140,3 +124,3 @@ Names of possible iterator states.

if (newState === ENDED)
eventAsync ? immediate(emit, this, 'end') : this.emit('end');
eventAsync ? setImmediate(emit, this, 'end') : this.emit('end');
}

@@ -281,3 +265,3 @@ return valid;

function end(self, destroy) { self._end(destroy); }
function endAsync(self) { immediate(end, self); }
function endAsync(self) { setImmediate(end, self); }

@@ -309,3 +293,3 @@ /**

if (readable)
immediate(emit, this, 'readable');
setImmediate(emit, this, 'readable');
}

@@ -388,3 +372,3 @@ },

if (this.readable)
immediate(call, emitData, this);
setImmediate(call, emitData, this);
}

@@ -427,3 +411,3 @@ }

if (properties && (propertyName in properties))
immediate(callback, properties[propertyName]);
setImmediate(callback, properties[propertyName]);
// If the value was not set, store the callback for when the value will be set

@@ -454,5 +438,5 @@ else {

if (callbacks.length === 1)
immediate(callbacks[0], value);
setImmediate(callbacks[0], value);
else {
immediate(function () {
setImmediate(function () {
for (var i = 0; i < callbacks.length; i++)

@@ -713,3 +697,3 @@ callbacks[i](value);

this._reading = true;
immediate(init, this, autoStart !== false || autoStart);
setImmediate(init, this, autoStart !== false || autoStart);
}

@@ -889,3 +873,3 @@ AsyncIterator.subclass(BufferedIterator);

self._reading = true;
immediate(fillBufferAsyncCallback, self);
setImmediate(fillBufferAsyncCallback, self);
}

@@ -1052,3 +1036,3 @@ }

if (self._pushedCount < count && !self.closed)
immediate(readAndTransform, self, next, done);
setImmediate(readAndTransform, self, next, done);
else

@@ -1195,3 +1179,3 @@ done();

readAndTransformSimple(self, count, function next() {
immediate(readAndTransformSimple, self, count, next, done);
setImmediate(readAndTransformSimple, self, count, next, done);
}, done);

@@ -1198,0 +1182,0 @@ };

{
"name": "asynciterator",
"version": "2.0.0",
"version": "2.0.1",
"description": "An asynchronous iterator library for advanced object pipelines.",
"author": "Ruben Verborgh <ruben.verborgh@gmail.com>",
"author": "Ruben Verborgh <ruben@verborgh.org>",
"main": "asynciterator.js",

@@ -10,3 +10,2 @@ "scripts": {

"cover": "nyc -- mocha -R dot",
"coveralls": "nyc --reporter=text-lcov -- mocha -R dot | coveralls",
"lint": "eslint *.js test",

@@ -17,8 +16,4 @@ "docs": "jsdoc -c jsdoc.json README.md *.js"

"repository": "RubenVerborgh/AsyncIterator",
"dependencies": {
"immediate": "^3.2.3"
},
"devDependencies": {
"chai": "^4.1.2",
"coveralls": "^3.0.0",
"eslint": "^4.18.1",

@@ -25,0 +20,0 @@ "jaguarjs-jsdoc": "^1.0.1",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc