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

yow

Package Overview
Dependencies
Maintainers
1
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yow - npm Package Compare versions

Comparing version 1.0.73 to 1.0.75

2

package.json
{
"name": "yow",
"version": "1.0.73",
"version": "1.0.75",
"description": "You Only Wish module",

@@ -5,0 +5,0 @@ "main": "yow.js",

@@ -6,6 +6,6 @@ var isArray = require('./yow.js').isArray;

var _this = this;
var _queue = [];
var _promise = undefined;
var _limit = limit == undefined ? 1000 : limit;
var _this = this;
var _queue = [];
var _running = false;
var _limit = limit == undefined ? 1000 : limit;

@@ -15,9 +15,13 @@ _this.dequeue = function() {

return new Promise(function(resolve, reject) {
if (_queue.length > 0 && _promise == undefined) {
if (_queue.length > 0 && !_running) {
_promise = _queue.splice(0, 1)[0];
_running = true;
_promise.then(function() {
_promise = undefined;
// Get next function in line
var fn = _queue.splice(0, 1)[0];
// Call it, and wait for complete
fn().then(function() {
_running = false;
function recurse() {

@@ -35,2 +39,3 @@ _this.dequeue().then(function() {

.catch(function(error) {
_running = false;
reject(error);

@@ -66,3 +71,3 @@ });

_this.isRunning = function() {
return _promise != undefined;
return _running;
};

@@ -74,10 +79,10 @@

this.prequeue = function(promise) {
this.prequeue = function(fn) {
if (_queue.length > _limit) {
console.log('Queue too big! Truncating.');
_queue = [promise];
_queue = [fn];
}
else {
_queue.unshift(promise);
_queue.unshift(fn);

@@ -88,10 +93,10 @@ }

this.enqueue = function(promise) {
this.enqueue = function(fn) {
if (_queue.length > _limit) {
console.log('Queue too big! Truncating.');
_queue = [promise];
_queue = [fn];
}
else {
_queue.push(promise);
_queue.push(fn);

@@ -98,0 +103,0 @@ }

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