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

utilsac

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

utilsac - npm Package Compare versions

Comparing version 3.0.2 to 4.0.0

operators.js

2

package.json
{
"name": "utilsac",
"version": "3.0.2",
"version": "4.0.0",
"description": "tools mostly",

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

@@ -0,3 +1,12 @@

export {
fillArrayWithFunctionResult,
chainPromises,
doNTimes,
chainPromiseNTimes,
timeCallback,
timePromise
};
export const fillArrayWithFunctionResult = function (aFunction, times) {
const fillArrayWithFunctionResult = function (aFunction, times) {
// [].fill is for static values only
const returnArray = [];

@@ -11,3 +20,3 @@ let i;

export const doNTimes = function (task, times) {
const doNTimes = function (task, times) {
let i;

@@ -19,3 +28,3 @@ for (i = 0; i < times; i += 1) {

export const chainPromises = function (promiseCreators) {
const chainPromises = function (promiseCreators) {
// different than Promise.all

@@ -44,3 +53,3 @@ // only executes promiseCreator one after the previous has resolved

export const chainPromiseNTimes = function (promiseCreator, times) {
const chainPromiseNTimes = function (promiseCreator, times) {
// different than Promise.all

@@ -72,3 +81,3 @@ // only executes promiseCreator one after the previous has resolved

export const timeCallback = function (callback) {
const timeCallback = function (callback) {
// executes callback and returns time elapsed in ms

@@ -81,3 +90,3 @@ const startTime = performance.now();

export const timePromise = function (promiseCreator) {
const timePromise = function (promiseCreator) {
// returns a Promise that resolves with

@@ -84,0 +93,0 @@ // the time elapsed for the promise to resolve and its value

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