Skip to content

bendrucker/assert-in

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

assert-in Build Status Greenkeeper badge

Assert that a value is in an array

Install

$ npm install --save assert-in

Usage

var assertIn = require('assert-in')

assertIn(['foo', 'bar'], 'foo')
//=> noop

assertIn(['foo', 'bar'], 'baz')
//=> Error: expected baz in object

var assert = assertIn(['foo', 'bar'])
//=> partially applied fn

API

assertIn(values, [value]) -> undefined / function

values

Required
Type: array[string]

Array of string values.

value

Type: string

A value to assert against. If value is omitted, a partially applied function for the provided values is returned instead.

License

MIT © Ben Drucker

About

Assert that a value is in an array

Resources

License

Stars

Watchers

Forks

Packages

No packages published