Use Hoek.contain(ref, values, [options]) to test if a reference value (string, array, or object) contains the provided values.
Parameters:
ref: The reference string, array, or object.values: A single value or an array of values to find within ref. If ref is an object, values can be a key name, an array of key names, or an object with key-value pairs.
Options:
deep: (boolean) Perform a deep comparison of the values.once: (boolean) Allows only one occurrence of each value.only: (boolean) Does not allow values not explicitly listed.part: (boolean) Allows partial match (at least one must match).symbols: (boolean) Whether to include symbol properties. Defaults to true.
Note: Comparing a string to overlapping values will fail (e.g. contain('abc', ['ab', 'bc'])). If an object key's value does not match, false is returned even if part is specified.
Hoek.contain('aaa', 'a', { only: true }); // true
Hoek.contain([{ a: 1 }], [{ a: 1 }], { deep: true }); // true
Hoek.contain([1, 2, 2], [1, 2], { once: true }); // false