You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

rsv

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rsv

Return a value randomly from given values. stands for Random Sample Value.

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
4
-71.43%
Maintainers
1
Weekly downloads
 
Created
Source

npm version

Sample values, not simple value.

sample-value returns a value randomly from given values.

Usage

Good for build strong test including eventually invalid values.

npm install rsv

// ONLY the example using es6 syntax.

const should_fail = require('rsv')(null, '', 'INVALID', false)
// returns null OR '' OR 'INVALID' OR false

const users = [
  {age: 26},
  {age: 19},
  {age: 32},
  {age: 43},
  {age: 113},
  {age: -1},
]
const user = require('rsv')(...users)
// returns any object from users array.

Test

npm test

Useful examples at test.js.

Keywords

sample

FAQs

Package last updated on 14 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts