sharyn
Version:
Combines all the other packages under one.
14 lines (11 loc) • 313 B
Flow
// @flow
const isEither = (first: any, ...comparisons: any[]) => {
if (!comparisons.length) {
throw Error('isEither takes at least a second argument')
}
if (Array.isArray(comparisons[0])) {
return comparisons[0].includes(first)
}
return comparisons.includes(first)
}
module.exports = isEither