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

@travi/any

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travi/any - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

27

dist/any.js

@@ -7,2 +7,3 @@ 'use strict';

var _ = _interopDefault(require('lodash'));
var Chance = _interopDefault(require('chance'));

@@ -66,14 +67,26 @@

var list = [],
listSize = options.size || integer(Object.assign({}, DEFAULT_SIZE_RANGE, options));
var listSize = options.size || integer(Object.assign({}, DEFAULT_SIZE_RANGE, options));
for (var i = 0; i < listSize; i += 1) {
list.push(factory());
if (options.uniqueOn) {
var uniqueValues = {};
while (Object.keys(uniqueValues).length < listSize) {
var item = factory();
uniqueValues[item[options.uniqueOn]] = item;
}
return _.values(uniqueValues);
} else {
var list = [];
for (var i = 0; i < listSize; i += 1) {
list.push(factory());
}
return list;
}
return list;
}
function fromList(list) {
return list[integer({ min: 0, max: list.length })];
return list[integer({ min: 0, max: list.length - 1 })];
}

@@ -80,0 +93,0 @@

{
"name": "@travi/any",
"version": "0.5.0",
"version": "0.6.0",
"description": "random data generator for when test data is insignificant",

@@ -49,2 +49,3 @@ "main": "dist/any.js",

"load-grunt-config": "0.19.2",
"lodash": "4.13.1",
"mocha": "2.5.3",

@@ -51,0 +52,0 @@ "proxyquire": "1.7.10",

Sorry, the diff of this file is not supported yet

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