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

call-n-times

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

call-n-times - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

.editorconfig

56

index.js
/* eslint-env node */
"use strict";
'use strict'
var isInteger = require("validate.io-integer");
var isInteger = require('validate.io-integer')
module.exports = function (func, n) {
if (arguments.length !== 2) {
throw "Expected exactly 2 arguments";
}
if (typeof func !== "function") {
throw "Expected first argument to be a function";
}
if (typeof n !== "number") {
throw "Expected second argument to be a number";
}
if (n >= 0 !== true) {
throw "Expected second argument to be equal to or greater than 0";
}
if (isInteger(n) !== true) {
throw "Expected second argument to be an integer";
}
module.exports = function (func, n, cb) {
if (arguments.length < 2) {
throw 'Expected exactly 2 arguments'
}
if (typeof func !== 'function') {
throw 'Expected first argument to be a function'
}
if (typeof n !== 'number') {
throw 'Expected second argument to be a number'
}
if (n >= 0 !== true) {
throw 'Expected second argument to be equal to or greater than 0'
}
if (isInteger(n) !== true) {
throw 'Expected second argument to be an integer'
}
var returns = [];
var returnVal;
var returns = []
var returnVal
while (n > 0) {
returnVal = func();
returns.push(returnVal);
n--;
}
while (n > 0) {
returnVal = func()
returns.push(returnVal)
n--
}
return returns;
};
if (typeof cb === 'function') cb()
return returns
}
/* eslint-env node */
"use strict";
'use strict'

@@ -12,10 +12,8 @@ // Karma configuration

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: "",
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ["jasmine", "browserify"],
frameworks: ['jasmine', 'browserify'],
browserify: {

@@ -25,9 +23,7 @@ debug: true

// list of files / patterns to load in the browser
files: [
"test/**/*spec.js"
'spec/spec.js'
],
// list of files to exclude

@@ -37,24 +33,19 @@ exclude: [

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"test/**/*spec.js": ["browserify"]
'spec/spec.js': ['browserify']
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ["progress"],
reporters: ['progress'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging

@@ -64,16 +55,13 @@ // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG

// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ["Chrome"],
browsers: ['Chrome'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
});
};
})
}
{
"name": "call-n-times",
"version": "1.0.1",
"version": "1.1.0",
"description": "Calls a provided function n times, synchronously",
"main": "index.js",
"scripts": {
"test": "karma start --single-run --browsers Chrome"
"test": "standard && jasmine"
},

@@ -25,3 +25,3 @@ "repository": {

"devDependencies": {
"jasmine": "^2.1.1",
"jasmine": "^2.2.0",
"jasmine-core": "^2.1.3",

@@ -31,3 +31,4 @@ "karma": "^0.12.31",

"karma-chrome-launcher": "^0.1.7",
"karma-jasmine": "^0.3.4"
"karma-jasmine": "^0.3.4",
"standard": "*"
},

@@ -34,0 +35,0 @@ "dependencies": {

@@ -5,2 +5,4 @@ # call-n-times

Can optionally call a provided callback right before returning.
Should work in IE7+. Perhaps even older.

@@ -7,0 +9,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