array-pull-all-with-glob
Version:
Like _.pullAll but with globs (wildcards)
11 lines (9 loc) • 579 B
JavaScript
/**
* @name array-pull-all-with-glob
* @fileoverview Like _.pullAll but with globs (wildcards)
* @version 7.0.12
* @author Roy Revelt, Codsen Ltd
* @license MIT
* {@link https://codsen.com/os/array-pull-all-with-glob/}
*/
import{isMatch as a}from"matcher";var r="7.0.12";var h=r,u={caseSensitive:!0};function y(e,t,s){if(!e.length)return[];if(!e.length||!t.length)return Array.from(e);let l=typeof t=="string"?[t]:Array.from(t),n={...u,...s};return Array.from(e).filter(i=>!l.some(p=>a(i,p,{caseSensitive:n.caseSensitive})))}export{u as defaults,y as pull,h as version};