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 1.9.1 to 2.0.0

23

docs/API.md

@@ -345,24 +345,1 @@ # API Reference

```
## `subset`
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 refer to its documentation for what is available.
### `subset` parameters
* `list` (required): list of items the subset will be taken from
* `options`: object to provide configuration options
* `size`: size of the subset to attempt to generate from the given list
* if the value is larger than the size of the list, the subset will
be the entire list.
* defaults to `2` if not provided
### `subset` example
```js
any.subset(['one', 'two', 'three', 'four'], 2);
// ['two', 'four']
```

6

lib/any.cjs.js

@@ -66,5 +66,2 @@ 'use strict';

});
const subset = (list, {
size = 2
} = {}) => chance.pickset(list, size);
const fromList = list => chance.pickone(list);

@@ -139,4 +136,3 @@ const subList = (list, {

fromList,
subList,
subset
subList
};

@@ -143,0 +139,0 @@

@@ -62,5 +62,2 @@ import Chance from 'chance';

});
const subset = (list, {
size = 2
} = {}) => chance.pickset(list, size);
const fromList = list => chance.pickone(list);

@@ -135,4 +132,3 @@ const subList = (list, {

fromList,
subList,
subset
subList
};

@@ -139,0 +135,0 @@

2

package.json
{
"name": "@travi/any",
"version": "1.9.1",
"version": "2.0.0",
"description": "random data generator for when test data is insignificant",

@@ -5,0 +5,0 @@ "main": "lib/any.cjs.js",

Sorry, the diff of this file is not supported yet

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