@modernpoacher/rules-runner
Version:
A business rules engine for Node
14 lines (8 loc) • 339 B
JavaScript
import debug from 'debug'
const log = debug('@modernpoacher/rules-runner/comparators/any-of')
log('`@modernpoacher/rules-runner` is awake')
export default function anyOf ({ anyOf: values = null }, actual) {
log('anyOf')
if (!Array.isArray(values)) throw new Error(`"${values}" is not an array`)
return values.includes(actual)
}