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

corifeus-utils

Package Overview
Dependencies
Maintainers
1
Versions
474
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

corifeus-utils - npm Package Compare versions

Comparing version 1.1.279-63 to 1.1.285-70

src/timer.js

4

package.json
{
"name": "corifeus-utils",
"version": "1.1.279-63",
"version": "1.1.285-70",
"corifeus": {

@@ -35,3 +35,3 @@ "icon": "fa fa-lightbulb-o",

"devDependencies": {
"corifeus-builder": "^1.7.614-56"
"corifeus-builder": "^1.7.618-59"
},

@@ -38,0 +38,0 @@ "dependencies": {

@@ -101,3 +101,3 @@ [//]: #@corifeus-header

---
[**CORIFEUS-UTILS**](https://pages.corifeus.tk/corifeus-utils) Build v1.1.279-63
[**CORIFEUS-UTILS**](https://pages.corifeus.tk/corifeus-utils) Build v1.1.285-70

@@ -104,0 +104,0 @@ [Corifeus](http://www.corifeus.tk) by [Patrik Laszlo](http://patrikx3.tk)

const forEachAsync = (array, cb, serial = false) => {
const promises = [];
let lastCb;
for(let index = 0; index < array.length; index++) {
const item = array[index];
const call = () => {
cb(item, index)
}
if (serial) {
if (lastCb === undefined) {
lastCb = cb(item);
lastCb = cb(item, index)
} else {
lastCb = lastCb.then(() => cb(item));
lastCb = lastCb.then(() => cb(item, index));
}
} else {
promises.push(cb(item))
promises.push( cb(item, index))
}

@@ -15,0 +21,0 @@ }

@@ -20,8 +20,13 @@ module.exports = {

require: require('./require'),
timer: require('./timer'),
}
const repeat = async (count, callback, serial) => {
return await new Array(count).forEachAsync(callback, serial);
const repeat = (count, callback) => {
return [...Array(count).keys()].forEach(callback);
}
repeat.async = async (count, callback, serial) => {
return await [...Array(count).keys()].forEachAsync(callback, serial);
}
module.exports.repeat = repeat;

@@ -9,3 +9,3 @@ const resovleDependencies =(options) => {

const {
let {
modules,

@@ -16,2 +16,3 @@ recursive,

recursive = recursive || [];
if (debug) {

@@ -18,0 +19,0 @@ dconsole = console;

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