non-blocking-json
Advanced tools
Comparing version 1.1.0-1596113581708 to 1.1.0-1596184291766
@@ -23,11 +23,17 @@ import { __awaiter } from "tslib"; | ||
let tickLength = 0; | ||
while (currentLength && tickLength < BATCH_LENGTH) { | ||
const queueItem = queue.shift(); | ||
queueItem.cb(); | ||
tickLength += queueItem.length; | ||
currentLength -= queueItem.length; | ||
} | ||
if (queue.length) { | ||
tick(run); | ||
} | ||
isRunning = true; | ||
tick(() => { | ||
while (currentLength && tickLength < BATCH_LENGTH) { | ||
const queueItem = queue.shift(); | ||
queueItem.cb(); | ||
tickLength += queueItem.length; | ||
currentLength -= queueItem.length; | ||
} | ||
if (queue.length) { | ||
run(); | ||
} | ||
else { | ||
isRunning = false; | ||
} | ||
}); | ||
} | ||
@@ -34,0 +40,0 @@ return (length, cb) => { |
@@ -25,11 +25,17 @@ "use strict"; | ||
let tickLength = 0; | ||
while (currentLength && tickLength < BATCH_LENGTH) { | ||
const queueItem = queue.shift(); | ||
queueItem.cb(); | ||
tickLength += queueItem.length; | ||
currentLength -= queueItem.length; | ||
} | ||
if (queue.length) { | ||
tick(run); | ||
} | ||
isRunning = true; | ||
tick(() => { | ||
while (currentLength && tickLength < BATCH_LENGTH) { | ||
const queueItem = queue.shift(); | ||
queueItem.cb(); | ||
tickLength += queueItem.length; | ||
currentLength -= queueItem.length; | ||
} | ||
if (queue.length) { | ||
run(); | ||
} | ||
else { | ||
isRunning = false; | ||
} | ||
}); | ||
} | ||
@@ -36,0 +42,0 @@ return (length, cb) => { |
{ | ||
"name": "non-blocking-json", | ||
"version": "1.1.0-1596113581708", | ||
"version": "1.1.0-1596184291766", | ||
"description": "Async JSON parse and stringify", | ||
@@ -5,0 +5,0 @@ "author": "Christian Alfoni <christianalfoni@gmail.com>", |
Sorry, the diff of this file is not supported yet
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
59031
530