@travi/any
Advanced tools
Comparing version 0.2.0 to 0.3.0
'use strict'; | ||
var Chance = require('chance'); | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var Chance = _interopDefault(require('chance')); | ||
var chance = new Chance(); | ||
var DEFAULT_SIZE_RANGE = { | ||
max: 20, | ||
min: 1 | ||
}; | ||
function integer(options) { | ||
var DEFAULT_SIZE_RANGE = { max: 20, min: 1 }; | ||
var integer = function integer(options) { | ||
return chance.natural(options); | ||
} | ||
function string(options) { | ||
}; | ||
var string = function string(options) { | ||
return chance.string(options); | ||
} | ||
function word() { | ||
}; | ||
var word = function word() { | ||
return chance.word(); | ||
} | ||
function url(options) { | ||
}; | ||
var url = function url(options) { | ||
return chance.url(options); | ||
} | ||
function boolean() { | ||
}; | ||
var boolean = function boolean() { | ||
return chance.bool(); | ||
} | ||
function email() { | ||
}; | ||
var email = function email() { | ||
return chance.email(); | ||
} | ||
function date() { | ||
}; | ||
var date = function date() { | ||
return chance.date({ string: true }); | ||
} | ||
}; | ||
@@ -49,5 +44,6 @@ function simpleObject() { | ||
function listOf(constructor, options) { | ||
var options = options || {}, | ||
list = [], | ||
function listOf(constructor) { | ||
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
var list = [], | ||
listSize = options.size || integer(Object.assign({}, DEFAULT_SIZE_RANGE, options)); | ||
@@ -62,12 +58,10 @@ | ||
module.exports = { | ||
string: string, | ||
word: word, | ||
integer: integer, | ||
boolean: boolean, | ||
url: url, | ||
email: email, | ||
date: date, | ||
simpleObject: simpleObject, | ||
listOf: listOf | ||
}; | ||
exports.string = string; | ||
exports.word = word; | ||
exports.integer = integer; | ||
exports.boolean = boolean; | ||
exports.url = url; | ||
exports.email = email; | ||
exports.date = date; | ||
exports.simpleObject = simpleObject; | ||
exports.listOf = listOf; |
{ | ||
"name": "@travi/any", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "random data generator for when test data is insignificant", | ||
@@ -45,3 +45,3 @@ "main": "dist/any.js", | ||
"grunt-rollup": "0.7.1", | ||
"istanbul": "0.4.3", | ||
"istanbul": "1.0.0-alpha.2", | ||
"load-grunt-config": "0.19.2", | ||
@@ -48,0 +48,0 @@ "mocha": "2.5.3", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
7143
0
98