@travi/any
Advanced tools
Comparing version
@@ -122,3 +122,3 @@ # API Reference | ||
Returns one item at random from the provided list. | ||
Direct usage of [`pickone()` from chance.js](http://chancejs.com/helpers/pickone.html). | ||
@@ -175,3 +175,3 @@ ### `fromList` parameters | ||
Direct usage of [`string()` from chance.js](http://chancejs.com/#string). | ||
Direct usage of [`string()` from chance.js](http://chancejs.com/basics/string.html). | ||
Options are passed directly to the chance method so refer to its documentation | ||
@@ -196,3 +196,3 @@ for what is available. | ||
Direct usage of [`word()` from chance.js](http://chancejs.com/#word). | ||
Direct usage of [`word()` from chance.js](http://chancejs.com/text/word.html). | ||
Options are passed directly to the chance method so refer to its documentation | ||
@@ -211,3 +211,3 @@ for what is available. | ||
Direct usage of [`sentence()` from chance.js](http://chancejs.com/#sentence). | ||
Direct usage of [`sentence()` from chance.js](http://chancejs.com/text/sentence.html). | ||
Options are passed directly to the chance method so refer to its documentation | ||
@@ -226,3 +226,3 @@ for what is available. | ||
Direct usage of [`paragraph()` from chance.js](http://chancejs.com/#paragraph). | ||
Direct usage of [`paragraph()` from chance.js](http://chancejs.com/text/paragraph.html). | ||
Options are passed directly to the chance method so refer to its documentation | ||
@@ -245,5 +245,5 @@ for what is available. | ||
Produces a random integer > 0. Direct usage of | ||
[`natural()` from chance.js](http://chancejs.com/#natural). Options are passed | ||
directly to the chance method so refer to its documentation for what is | ||
available. | ||
[`natural()` from chance.js](http://chancejs.com/basics/natural.html). | ||
Options are passed directly to the chance method so refer to its | ||
documentation for what is available. | ||
@@ -260,3 +260,3 @@ ### `integer` example | ||
Direct usage of [`floating()` from chance.js](http://chancejs.com/#floating). | ||
Direct usage of [`floating()` from chance.js](http://chancejs.com/basics/floating.html). | ||
Options are passed directly to the chance method so refer to its documentation | ||
@@ -289,5 +289,5 @@ for what is available. | ||
Direct usage of [`url()` from chance.js](http://chancejs.com/#url). Options are | ||
passed directly to the chance method so refer to its documentation for what is | ||
available. | ||
Direct usage of [`url()` from chance.js](http://chancejs.com/web/url.html). | ||
Options are passed directly to the chance method so refer to its | ||
documentation for what is available. | ||
@@ -304,3 +304,3 @@ ### `url` example | ||
Direct usage of [`email()` from chance.js](http://chancejs.com/#email). | ||
Direct usage of [`email()` from chance.js](http://chancejs.com/web/email.html). | ||
Options are passed directly to the chance method so refer to its documentation | ||
@@ -319,3 +319,3 @@ for what is available. | ||
An almost direct usage of [`date()` from chance.js](http://chancejs.com/#date). | ||
An almost direct usage of [`date()` from chance.js](http://chancejs.com/time/date.html). | ||
No options passed to the `any` method are passed to the `chance` method, but | ||
@@ -335,3 +335,3 @@ the `{string: true}` option is passed because I have only had a use for the | ||
An almost direct usage of [`pickset()` from chance.js](http://chancejs.com/#pickset). | ||
An almost direct usage of [`pickset()` from chance.js](http://chancejs.com/helpers/pickset.html). | ||
The `size` option is passed directly to the chance method's `quantity` argument so | ||
@@ -338,0 +338,0 @@ refer to its documentation for what is available. |
@@ -123,2 +123,5 @@ 'use strict'; | ||
}; | ||
var fromList = function fromList(list) { | ||
return chance.pickone(list); | ||
}; | ||
@@ -171,6 +174,2 @@ function word() { | ||
function fromList (list) { | ||
return list[integer({ min: 0, max: list.length - 1 })]; | ||
} | ||
function objectWithKeys (keys) { | ||
@@ -177,0 +176,0 @@ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; |
@@ -119,2 +119,5 @@ import Chance from 'chance'; | ||
}; | ||
var fromList = function fromList(list) { | ||
return chance.pickone(list); | ||
}; | ||
@@ -167,6 +170,2 @@ function word() { | ||
function fromList (list) { | ||
return list[integer({ min: 0, max: list.length - 1 })]; | ||
} | ||
function objectWithKeys (keys) { | ||
@@ -173,0 +172,0 @@ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; |
{ | ||
"name": "@travi/any", | ||
"version": "1.7.5", | ||
"version": "1.8.0", | ||
"description": "random data generator for when test data is insignificant", | ||
@@ -41,2 +41,7 @@ "main": "lib/any.cjs.js", | ||
"url": "https://twitter.com/intelxdesign" | ||
}, | ||
{ | ||
"name": "Zach Toben", | ||
"email": "zach.toben@gmail.com", | ||
"url": "https://ztoben.com/" | ||
} | ||
@@ -50,9 +55,9 @@ ], | ||
"dependencies": { | ||
"chance": "1.0.15", | ||
"debug": "3.1.0", | ||
"lodash": "4.17.9", | ||
"chance": "1.0.16", | ||
"debug": "4.0.0", | ||
"lodash": "4.17.10", | ||
"mersenne-twister": "1.1.0" | ||
}, | ||
"devDependencies": { | ||
"@travi/eslint-config-travi": "1.6.13", | ||
"@travi/eslint-config-travi": "1.6.18", | ||
"babel-cli": "6.26.0", | ||
@@ -65,22 +70,22 @@ "babel-plugin-transform-exponentiation-operator": "6.24.1", | ||
"chai": "4.1.2", | ||
"commitlint-config-travi": "1.2.29", | ||
"coveralls": "3.0.0", | ||
"commitlint-config-travi": "1.2.30", | ||
"coveralls": "3.0.2", | ||
"cz-conventional-changelog": "2.1.0", | ||
"formatio": "1.2.0", | ||
"globstar": "1.0.0", | ||
"greenkeeper-lockfile": "1.14.0", | ||
"husky": "1.0.0-rc.1", | ||
"greenkeeper-lockfile": "2.7.0", | ||
"husky": "1.0.0-rc.14", | ||
"markdown-toc": "1.2.0", | ||
"markdownlint-cli": "0.8.1", | ||
"mocha": "5.1.1", | ||
"npm-run-all": "4.1.2", | ||
"nyc": "11.7.1", | ||
"proxyquire": "2.0.1", | ||
"markdownlint-cli": "0.13.0", | ||
"mocha": "5.2.0", | ||
"npm-run-all": "4.1.3", | ||
"nyc": "13.0.1", | ||
"proxyquire": "2.1.0", | ||
"referee": "1.2.0", | ||
"referee-sinon": "1.0.3", | ||
"rimraf": "2.6.2", | ||
"rollup": "0.58.2", | ||
"rollup-plugin-babel": "3.0.4", | ||
"semantic-release": "15.1.7", | ||
"sinon": "4.5.0" | ||
"rollup": "0.65.2", | ||
"rollup-plugin-babel": "3.0.7", | ||
"semantic-release": "15.9.15", | ||
"sinon": "6.2.0" | ||
}, | ||
@@ -87,0 +92,0 @@ "config": { |
# Random data generator | ||
<!-- consumer badges --> | ||
[](https://www.npmjs.com/package/@travi/any) | ||
[](https://www.npmjs.com/package/@travi/any) | ||
[](LICENSE) | ||
<!-- status badges --> | ||
[](https://travis-ci.org/travi/any) | ||
[](https://coveralls.io/r/travi/any?branch=master) | ||
[](https://travis-ci.org/travi/any) | ||
[](https://coveralls.io/r/travi/any?branch=master) | ||
<!-- contribution badges --> | ||
[![PRs Welcome][prs-badge]][prs] | ||
[](https://conventionalcommits.org) | ||
[](http://commitizen.github.io/cz-cli/) | ||
[](https://github.com/semantic-release/semantic-release) | ||
[](https://greenkeeper.io/) | ||
Random data generator for when test data is insignificant. Tailoring data too | ||
@@ -43,9 +31,17 @@ closely for the domain can end up being confusing in tests because it distracts | ||
## Install | ||
## Usage | ||
```bash | ||
<!-- consumer badges --> | ||
[](https://www.npmjs.com/package/@travi/any) | ||
[](https://www.npmjs.com/package/@travi/any) | ||
[](LICENSE) | ||
[](https://npm.runkit.com/@travi/any) | ||
### Install | ||
```sh | ||
$ npm install @travi/any --save-dev | ||
``` | ||
## Documentation | ||
### Documentation | ||
@@ -55,3 +51,25 @@ * [API](docs/API.md) | ||
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square | ||
## Contributing | ||
<!-- contribution badges --> | ||
[![PRs Welcome][prs-badge]][prs] | ||
[](https://conventionalcommits.org) | ||
[](http://commitizen.github.io/cz-cli/) | ||
[](https://github.com/semantic-release/semantic-release) | ||
[](https://greenkeeper.io/) | ||
### Dependencies | ||
```sh | ||
$ nvm install | ||
$ npm install | ||
``` | ||
### Verification | ||
```sh | ||
$ npm test | ||
``` | ||
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg | ||
[prs]: http://makeapullrequest.com |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
40791
0.25%74
32.14%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated