Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

array-includes-with-glob

codsen17.2kMIT5.0.12TypeScript support: included

Like _.includes but with wildcards

array, arrays, asterisk, contains, glob, globby, has, include, includes, inclues, instance, pattern, string, wildcard

readme

array-includes-with-glob

Like _.includes but with wildcards

page on codsen.com page on npm page on github Downloads per month changelog MIT Licence

Install

This package is pure ESM. If you're not ready yet, install an older version of this program, 3.1.0 (npm i array-includes-with-glob@3.1.0).

npm i array-includes-with-glob

Quick Take

import { strict as assert } from "assert";

import { includesWithGlob } from "array-includes-with-glob";

assert.equal(includesWithGlob(["xc", "yc", "zc"], "*c"), true);
// (all 3)

assert.equal(includesWithGlob(["xc", "yc", "zc"], "*a"), false);
// (none found)

assert.equal(includesWithGlob(["something", "anything", "zzz"], "some*"), true);
// (1 hit)

Documentation

Please visit codsen.com for a full description of the API.

Contributing

To report bugs or request features or assistance, raise an issue on GitHub.

Licence

MIT License.

Copyright © 2010-2025 Roy Revelt and other contributors.

ok codsen star

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

5.0.0 (2022-12-01)

BREAKING CHANGES

  • Minimum supported Node version is v14.18; we're dropping v12 support

4.1.0 (2022-08-12)

Features

4.0.0 (2021-09-09)

Features

BREAKING CHANGES

  • programs now are in ES Modules and won't work with Common JS require()

3.1.0 (2021-05-24)

Features

  • config file based major bump blacklisting (e15f9bb)

3.0.15 (2021-04-11)

Reverts

  • Revert "chore: setup refresh" (23cf206)

3.0.1 (2021-01-28)

Fixed

  • add testStats to npmignore (f3c84e9)

3.0.0 (2021-01-23)

Features

  • Rewrite in TypeScript, start using named exports

BREAKING CHANGES

  • Previously, you'd consume by: import includesWithGlob from ...", now use:import { includesWithGlob } from ...`

2.13.0 (2020-11-28)

Accidental version bump during migration to SourceHut. Sorry about that.

2.12.0 (2019-06-29)

Features

  • Add perf measurement, tracking and historical comparison (b7f73ad)

2.11.0 (2019-01-20)

  • Various documentation and setup tweaks after we migrated to monorepo
  • Setup refresh: updated dependencies and all config files using automated tools

2.5.0 (2018-12-14)

  • 🔧 Restored AVA linting, updated all dependencies, added licence to the top of each built file

2.4.0 (2018-10-12)

  • Updated all dependencies and restored coverage reporting both in terminal and sending to coveralls

2.3.0 (2018-05-11)

  • Pointed AVA unit tests to ES Modules build, as opposed to previously transpiled CommonJS-one. This means, now unit test code coverage is correct.

2.2.0 (2018-04-29)

  • Set up Prettier
  • Removed package.lock and .editorconfig
  • Wired Rollup to remove comments from non-dev builds. This means we can now leave the console.logs in the source code — Rollup will remove them during the builds.

2.1.0 (2018-02-11)

  • Up until now the matcher.js which was driving the wildcard matching was not-case sensitive. Today they released case-sensitive option and we are setting it on. This will ensure the consistency in matching results.

2.0.0 (2017-12-08)

  • Removed JS Standard and switched to raw ESLint with airbnb-base config. That's because ESLint is always up-to-date (unlike JS Standard which might consume half-year-old ESLint like it does now) and also because airbnb-* configs have more rules active. I overrode the setting for semicolons, of course.

Bumping major just in case it breaks somebody's API. But I don't think it will.

1.5.0 (2017-07-23)

  • Removed object-assign from deps, switched to native Object.assign
  • Set all dev deps except Standard to be latest (*) to save time updating them
  • Updated All deps

1.4.0 (2017-04-23) Sunday evening

  • There are some finshy things happening with string wildcard libraries. Namely, wildcard and wildstring. I was using wildstring until I in another of my libraries discovered that it does not support leading wildcards, that is when asterisk is the first character! WTF!!! Same case with wildcard too. Proof's here and there are other issues with its API as well!!! SOLUTION: switched to Sindre Sorhus' matcher. Small amendments (order of arguments) and one find-and-replace on the method isMatch. Problem solved!

1.3.0 (2017-04-23)

  • You can provide an array (second argument) of strings to check, is ANY of them found in the source (first argument).
  • Alternatively, you can set the matching to request that ALL elements from second argument array must be found in the source array (first argument).

1.2.0 (2017-04-22)

  • Now the input can be not only array, but string as well. It will be converted into an array first and then processed.

1.0.0 (2017-04-22)

  • First public release