array-includes-with-glob 5.0.0 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## [5.0.2](https://github.com/codsen/codsen/compare/array-includes-with-glob@5.0.1...array-includes-with-glob@5.0.2) (2022-12-06)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
**Note:** Version bump only for package array-includes-with-glob
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## 5.0.0 (2022-12-01)
|
|
11
11
|
|
|
12
12
|
### BREAKING CHANGES
|
|
13
13
|
|
|
14
14
|
- Minimum supported Node version is v14.18; we're dropping v12 support
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
## 4.1.0 (2022-08-12)
|
|
17
17
|
|
|
18
18
|
### Features
|
|
19
19
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name array-includes-with-glob
|
|
3
3
|
* @fileoverview Like _.includes but with wildcards
|
|
4
|
-
* @version 5.0.
|
|
4
|
+
* @version 5.0.2
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/array-includes-with-glob/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
function
|
|
10
|
+
function d(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var p=new Map,y=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter(r=>{if(typeof r!="string"){if(typeof r>"u")return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof r}' in the array`)}return!0})},m=(e,t)=>{t={caseSensitive:!1,...t};let r=e+JSON.stringify(t);if(p.has(r))return p.get(r);let s=e[0]==="!";s&&(e=e.slice(1)),e=d(e).replace(/\\\*/g,"[\\s\\S]*");let n=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return n.negated=s,p.set(r,n),n},h=(e,t,r,s)=>{if(e=y(e,"inputs"),t=y(t,"patterns"),t.length===0)return[];t=t.map(o=>m(o,r));let{allPatterns:n}=r||{},i=[];for(let o of e){let c,f=[...t].fill(!1);for(let[a,l]of t.entries())if(l.test(o)&&(f[a]=!0,c=!l.negated,!c))break;if(!(c===!1||c===void 0&&t.some(a=>!a.negated)||n&&f.some((a,l)=>!a&&!t[l].negated))&&(i.push(o),s))break}return i};function u(e,t,r){return h(e,t,r,!0).length>0}var g="5.0.2";var E=g,b={arrayVsArrayAllMustBeFound:"any",caseSensitive:!0};function M(e,t,r){if(!e.length||!t.length)return!1;let s={...b,...r},n=typeof e=="string"?[e]:Array.from(e);return typeof t=="string"?n.some(i=>u(i,t,{caseSensitive:s.caseSensitive})):s.arrayVsArrayAllMustBeFound==="any"?t.some(i=>n.some(o=>u(o,i,{caseSensitive:s.caseSensitive}))):t.every(i=>n.some(o=>u(o,i,{caseSensitive:s.caseSensitive})))}export{b as defaults,M as includesWithGlob,E as version};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name array-includes-with-glob
|
|
3
3
|
* @fileoverview Like _.includes but with wildcards
|
|
4
|
-
* @version 5.0.
|
|
4
|
+
* @version 5.0.2
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/array-includes-with-glob/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var arrayIncludesWithGlob=(()=>{var
|
|
10
|
+
"use strict";var arrayIncludesWithGlob=(()=>{var d=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var h=(t,e,r)=>e in t?d(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,c=(t,e)=>{for(var r in e||(e={}))x.call(e,r)&&h(t,r,e[r]);if(m)for(var r of m(e))k.call(e,r)&&h(t,r,e[r]);return t};var A=(t,e)=>{for(var r in e)d(t,r,{get:e[r],enumerable:!0})},E=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of j(e))!x.call(t,s)&&s!==r&&d(t,s,{get:()=>e[s],enumerable:!(n=S(e,s))||n.enumerable});return t};var M=t=>E(d({},"__esModule",{value:!0}),t);var B={};A(B,{defaults:()=>w,includesWithGlob:()=>V,version:()=>F});function f(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var y=new Map,b=(t,e)=>{if(!Array.isArray(t))switch(typeof t){case"string":t=[t];break;case"undefined":t=[];break;default:throw new TypeError(`Expected '${e}' to be a string or an array, but got a type of '${typeof t}'`)}return t.filter(r=>{if(typeof r!="string"){if(typeof r>"u")return!1;throw new TypeError(`Expected '${e}' to be an array of strings, but found a type of '${typeof r}' in the array`)}return!0})},$=(t,e)=>{e=c({caseSensitive:!1},e);let r=t+JSON.stringify(e);if(y.has(r))return y.get(r);let n=t[0]==="!";n&&(t=t.slice(1)),t=f(t).replace(/\\\*/g,"[\\s\\S]*");let s=new RegExp(`^${t}$`,e.caseSensitive?"":"i");return s.negated=n,y.set(r,s),s},R=(t,e,r,n)=>{if(t=b(t,"inputs"),e=b(e,"patterns"),e.length===0)return[];e=e.map(o=>$(o,r));let{allPatterns:s}=r||{},i=[];for(let o of t){let l,g=[...e].fill(!1);for(let[a,u]of e.entries())if(u.test(o)&&(g[a]=!0,l=!u.negated,!l))break;if(!(l===!1||l===void 0&&e.some(a=>!a.negated)||s&&g.some((a,u)=>!a&&!e[u].negated))&&(i.push(o),n))break}return i};function p(t,e,r){return R(t,e,r,!0).length>0}var v="5.0.2";var F=v,w={arrayVsArrayAllMustBeFound:"any",caseSensitive:!0};function V(t,e,r){if(!t.length||!e.length)return!1;let n=c(c({},w),r),s=typeof t=="string"?[t]:Array.from(t);return typeof e=="string"?s.some(i=>p(i,e,{caseSensitive:n.caseSensitive})):n.arrayVsArrayAllMustBeFound==="any"?e.some(i=>s.some(o=>p(o,i,{caseSensitive:n.caseSensitive}))):e.every(i=>s.some(o=>p(o,i,{caseSensitive:n.caseSensitive})))}return M(B);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "array-includes-with-glob",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "Like _.includes but with wildcards",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -38,22 +38,22 @@
|
|
|
38
38
|
},
|
|
39
39
|
"types": "types/index.d.ts",
|
|
40
40
|
"scripts": {
|
|
41
|
-
"build": "node '../../ops/scripts/esbuild.js' &&
|
|
41
|
+
"build": "node '../../ops/scripts/esbuild.js' && npm run dts",
|
|
42
42
|
"cjs-off": "exit 0",
|
|
43
43
|
"cjs-on": "exit 0",
|
|
44
|
-
"dev": "DEV=true node '../../ops/scripts/esbuild.js' &&
|
|
45
|
-
"devtest": "c8
|
|
46
|
-
"dts": "rollup -c &&
|
|
44
|
+
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
|
|
45
|
+
"devtest": "c8 npm run unit && npm run examples && npm run lint",
|
|
46
|
+
"dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --loglevel 'silent'",
|
|
47
47
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
48
|
-
"lect": "node '../../ops/lect/lect.js' &&
|
|
49
|
-
"letspublish": "
|
|
48
|
+
"lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
|
|
49
|
+
"letspublish": "npm publish || :",
|
|
50
50
|
"lint": "eslint . --ext .js --ext .ts --fix",
|
|
51
51
|
"perf": "node perf/check.js",
|
|
52
|
-
"
|
|
52
|
+
"prep": "echo 'ready'",
|
|
53
53
|
"prettier": "prettier",
|
|
54
|
-
"prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
|
|
55
|
-
"pretest": "
|
|
56
|
-
"test": "
|
|
54
|
+
"prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --loglevel 'silent'",
|
|
55
|
+
"pretest": "npm run lect && npm run build",
|
|
56
|
+
"test": "npm run devtest",
|
|
57
57
|
"unit": "uvu test"
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|