Package Exports
- does-include
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (does-include) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
does include
find whether a string (or arr
) contains any, or all of another array of strings.
📦 usage
yarn add does-include
npm i does-include --saveconst does-include = require('does-include')📘 examples
/**
* @param {Array<string> | string} haystack
* @param {Array<string>} needles
* @param {boolean} any
* @return {boolean}
*/
const doesInclude = require('does-include')
// or can be destructured
const {any, all} = require('does-include')any (default)
const doesInclude = require('does-include')
// can is in canada, so true.
doesInclude('canada', ['eh', 'can'])all
const doesInclude = require('does-include')
// last argument is `any` (default true)
// 'canada' and 'can' are both in it, so true
doesInclude('canada', ['canada', 'can'])