array-pull-all-with-glob 6.0.4 → 6.0.10

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,26 +3,6 @@
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.0.3 (2021-11-02)
7
-
8
- ### Bug Fixes
9
-
10
- - bump TS and separate ESLint plugins away from this monorepo ([b1ebce1](https://github.com/codsen/codsen/commit/b1ebce1637d8c41c2d848fc24b0ba4058865bd5d))
11
-
12
- ### Features
13
-
14
- - migrate to ES Modules ([c579dff](https://github.com/codsen/codsen/commit/c579dff3b23205e383035ca10ddcec671e35d0fe))
15
-
16
- ### BREAKING CHANGES
17
-
18
- - programs now are in ES Modules and won't work with Common JS require()
19
-
20
- ## 6.0.1 (2021-09-13)
21
-
22
- ### Bug Fixes
23
-
24
- - bump TS and separate ESLint plugins away from this monorepo ([2e07d42](https://github.com/codsen/codsen/commit/2e07d424222b6ffedf5fb45c83ad453627ec2904))
25
-
26
6
  ## 6.0.0 (2021-09-09)
27
7
 
28
8
  ### Features
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-%YEAR% Roy Revelt and other contributors
3
+ Copyright (c) 2010-2021 Roy Revelt and other contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # array-pull-all-with-glob
2
2
 
3
- > Like \_.pullAll but with globs (wildcards)
3
+ > Like _.pullAll but with globs (wildcards)
4
4
 
5
5
  <div class="package-badges">
6
6
  <a href="https://www.npmjs.com/package/array-pull-all-with-glob" rel="nofollow noreferrer noopener">
@@ -38,6 +38,7 @@ If you need a legacy version which works with `require`, use version 5.1.0
38
38
 
39
39
  ```js
40
40
  import { strict as assert } from "assert";
41
+
41
42
  import { pull } from "array-pull-all-with-glob";
42
43
 
43
44
  assert.deepEqual(
@@ -51,7 +52,7 @@ assert.deepEqual(
51
52
 
52
53
  ## Documentation
53
54
 
54
- Please [visit codsen.com](https://codsen.com/os/array-pull-all-with-glob/) for a full description of the API and examples.
55
+ Please [visit codsen.com](https://codsen.com/os/array-pull-all-with-glob/) for a full description of the API.
55
56
 
56
57
  ## Contributing
57
58
 
@@ -63,4 +64,6 @@ MIT License
63
64
 
64
65
  Copyright (c) 2010-2021 Roy Revelt and other contributors
65
66
 
67
+
66
68
  <img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center">
69
+
@@ -1,35 +1,10 @@
1
1
  /**
2
2
  * @name array-pull-all-with-glob
3
3
  * @fileoverview Like _.pullAll but with globs (wildcards)
4
- * @version 6.0.4
4
+ * @version 6.0.10
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/array-pull-all-with-glob/}
8
8
  */
9
9
 
10
- import { isMatch } from 'matcher';
11
-
12
- var version$1 = "6.0.4";
13
-
14
- const version = version$1;
15
- function pull(originalInput, originalToBeRemoved, originalOpts) {
16
- if (!originalInput.length) {
17
- return [];
18
- }
19
- if (!originalInput.length || !originalToBeRemoved.length) {
20
- return Array.from(originalInput);
21
- }
22
- const toBeRemoved = typeof originalToBeRemoved === "string" ? [originalToBeRemoved] : Array.from(originalToBeRemoved);
23
- const defaults = {
24
- caseSensitive: true
25
- };
26
- const opts = { ...defaults,
27
- ...originalOpts
28
- };
29
- const res = Array.from(originalInput).filter(originalVal => !toBeRemoved.some(remVal => isMatch(originalVal, remVal, {
30
- caseSensitive: opts.caseSensitive
31
- })));
32
- return res;
33
- }
34
-
35
- export { pull, version };
10
+ import{isMatch as p}from"matcher";var s="6.0.10";var h=s;function g(e,t,r){if(!e.length)return[];if(!e.length||!t.length)return Array.from(e);let l=typeof t=="string"?[t]:Array.from(t),n={...{caseSensitive:!0},...r};return Array.from(e).filter(i=>!l.some(a=>p(i,a,{caseSensitive:n.caseSensitive})))}export{g as pull,h as version};
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name array-pull-all-with-glob
3
3
  * @fileoverview Like _.pullAll but with globs (wildcards)
4
- * @version 6.0.4
4
+ * @version 6.0.10
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/array-pull-all-with-glob/}
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).arrayPullAllWithGlob={})}(this,(function(e){"use strict";const t=new Map,r=(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((e=>{if("string"!=typeof e){if(void 0===e)return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof e}' in the array`)}return!0}))},n=(e,r)=>{r={caseSensitive:!1,...r};const n=e+JSON.stringify(r);if(t.has(n))return t.get(n);const o="!"===e[0];o&&(e=e.slice(1)),e=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e).replace(/\\\*/g,"[\\s\\S]*");const i=new RegExp(`^${e}$`,r.caseSensitive?"":"i");return i.negated=o,t.set(n,i),i};function o(e,t,o){return((e,t,o,i)=>{if(e=r(e,"inputs"),0===(t=r(t,"patterns")).length)return[];t=t.map((e=>n(e,o)));const{allPatterns:s}=o||{},f=[];for(const r of e){let e;const n=[...t].fill(!1);for(const[o,i]of t.entries())if(i.test(r)&&(n[o]=!0,e=!i.negated,!e))break;if(!(!1===e||void 0===e&&t.some((e=>!e.negated))||s&&n.some(((e,r)=>!e&&!t[r].negated)))&&(f.push(r),i))break}return f})(e,t,o,!0).length>0}e.pull=function(e,t,r){if(!e.length)return[];if(!e.length||!t.length)return Array.from(e);const n="string"==typeof t?[t]:Array.from(t),i={caseSensitive:!0,...r};return Array.from(e).filter((e=>!n.some((t=>o(e,t,{caseSensitive:i.caseSensitive})))))},e.version="6.0.4",Object.defineProperty(e,"__esModule",{value:!0})}));
10
+ var arrayPullAllWithGlob=(()=>{var f=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var m=(e,t,r)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,i=(e,t)=>{for(var r in t||(t={}))h.call(t,r)&&m(e,r,t[r]);if(g)for(var r of g(t))S.call(t,r)&&m(e,r,t[r]);return e};var E=e=>f(e,"__esModule",{value:!0});var $=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0})},j=(e,t,r,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of k(t))!h.call(e,s)&&(r||s!=="default")&&f(e,s,{get:()=>t[s],enumerable:!(l=v(t,s))||l.enumerable});return e};var A=(e=>(t,r)=>e&&e.get(t)||(r=j(E({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var D={};$(D,{pull:()=>C,version:()=>z});function d(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var y=new Map,b=(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=="undefined")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=i({caseSensitive:!1},t);let r=e+JSON.stringify(t);if(y.has(r))return y.get(r);let l=e[0]==="!";l&&(e=e.slice(1)),e=d(e).replace(/\\\*/g,"[\\s\\S]*");let s=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return s.negated=l,y.set(r,s),s},O=(e,t,r,l)=>{if(e=b(e,"inputs"),t=b(t,"patterns"),t.length===0)return[];t=t.map(a=>M(a,r));let{allPatterns:s}=r||{},c=[];for(let a of e){let n,u=[...t].fill(!1);for(let[o,p]of t.entries())if(p.test(a)&&(u[o]=!0,n=!p.negated,!n))break;if(!(n===!1||n===void 0&&t.some(o=>!o.negated)||s&&u.some((o,p)=>!o&&!t[p].negated))&&(c.push(a),l))break}return c};function x(e,t,r){return O(e,t,r,!0).length>0}var w="6.0.10";var z=w;function C(e,t,r){if(!e.length)return[];if(!e.length||!t.length)return Array.from(e);let l=typeof t=="string"?[t]:Array.from(t),c=i(i({},{caseSensitive:!0}),r);return Array.from(e).filter(n=>!l.some(u=>x(n,u,{caseSensitive:c.caseSensitive})))}return A(D);})();
@@ -1,6 +1,7 @@
1
1
  // Quick Take
2
2
 
3
3
  import { strict as assert } from "assert";
4
+
4
5
  import { pull } from "../dist/array-pull-all-with-glob.esm.js";
5
6
 
6
7
  assert.deepEqual(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "array-pull-all-with-glob",
3
- "version": "6.0.4",
3
+ "version": "6.0.10",
4
4
  "description": "Like _.pullAll but with globs (wildcards)",
5
5
  "keywords": [
6
6
  "array",
@@ -38,94 +38,37 @@
38
38
  },
39
39
  "types": "types/index.d.ts",
40
40
  "scripts": {
41
- "build": "rollup -c",
42
- "ci_test": "npm run build && npm run format && tap --no-only --reporter=silent --output-file=testStats.md && npm run clean_cov",
43
- "clean_cov": "../../scripts/leaveCoverageTotalOnly.js",
44
- "clean_types": "../../scripts/cleanTypes.js",
45
- "dev": "rollup -c --dev",
46
- "devunittest": "npm run dev && tap --only -R 'base'",
47
- "esbuild": "node '../../scripts/esbuild.js'",
48
- "esbuild_dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
49
- "format": "npm run lect && npm run prettier && npm run lint",
50
- "lect": "lect",
51
- "lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet",
52
- "perf": "node perf/check",
53
- "prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent",
54
- "republish": "npm publish || :",
55
- "tap": "tap",
56
- "pretest": "npm run build",
57
- "test": "npm run lint && npm run unittest && npm run test:examples && npm run clean_cov && npm run format",
58
- "test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
59
- "tsc": "tsc",
60
- "unittest": "tap --no-only --output-file=testStats.md --reporter=terse && tsc -p tsconfig.json --noEmit && npm run clean_cov && npm run perf"
41
+ "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
42
+ "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
43
+ "dts": "rollup -c",
44
+ "examples": "node '../../ops/scripts/run-examples.js'",
45
+ "lect": "node '../../ops/lect/lect.js'",
46
+ "letspublish": "yarn publish || :",
47
+ "lint": "eslint . --fix",
48
+ "perf": "node perf/check.js",
49
+ "prepare": "echo 'ready'",
50
+ "pretest": "yarn run lect && yarn run build",
51
+ "test": "c8 yarn run unit && yarn run examples && yarn run lint",
52
+ "unit": "uvu test"
61
53
  },
62
- "tap": {
63
- "check-coverage": false,
64
- "coverage-report": [
65
- "json-summary",
66
- "text"
67
- ],
68
- "node-arg": [
69
- "--no-warnings",
70
- "--experimental-loader",
71
- "@istanbuljs/esm-loader-hook"
54
+ "engines": {
55
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
56
+ },
57
+ "c8": {
58
+ "check-coverage": true,
59
+ "exclude": [
60
+ "**/test/**/*.*"
72
61
  ],
73
- "timeout": 0
62
+ "lines": 100
74
63
  },
75
64
  "lect": {
76
65
  "licence": {
77
66
  "extras": [
78
67
  ""
79
68
  ]
80
- },
81
- "req": "{ pull }",
82
- "various": {
83
- "devDependencies": []
84
69
  }
85
70
  },
86
71
  "dependencies": {
87
- "@babel/runtime": "^7.16.0",
88
72
  "matcher": "^5.0.0"
89
- },
90
- "devDependencies": {
91
- "@babel/cli": "^7.16.0",
92
- "@babel/core": "^7.16.0",
93
- "@babel/node": "^7.16.0",
94
- "@babel/plugin-external-helpers": "^7.16.0",
95
- "@babel/plugin-proposal-class-properties": "^7.16.0",
96
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
97
- "@babel/plugin-proposal-object-rest-spread": "^7.16.0",
98
- "@babel/plugin-proposal-optional-chaining": "^7.16.0",
99
- "@babel/plugin-transform-runtime": "^7.16.0",
100
- "@babel/preset-env": "^7.16.0",
101
- "@babel/preset-typescript": "^7.16.0",
102
- "@babel/register": "^7.16.0",
103
- "@istanbuljs/esm-loader-hook": "^0.1.2",
104
- "@rollup/plugin-babel": "^5.3.0",
105
- "@rollup/plugin-commonjs": "^21.0.1",
106
- "@rollup/plugin-json": "^4.1.0",
107
- "@rollup/plugin-node-resolve": "^13.0.6",
108
- "@rollup/plugin-strip": "^2.1.0",
109
- "@rollup/plugin-typescript": "^8.3.0",
110
- "@types/node": "^16.11.6",
111
- "@types/tap": "^15.0.5",
112
- "@typescript-eslint/eslint-plugin": "^5.3.0",
113
- "@typescript-eslint/parser": "^5.3.0",
114
- "core-js": "^3.19.1",
115
- "cross-env": "^7.0.3",
116
- "eslint": "^8.1.0",
117
- "lect": "^0.18.4",
118
- "rollup": "^2.59.0",
119
- "rollup-plugin-ascii": "^0.0.3",
120
- "rollup-plugin-banner": "^0.2.1",
121
- "rollup-plugin-cleanup": "^3.2.1",
122
- "rollup-plugin-dts": "^4.0.0",
123
- "rollup-plugin-terser": "^7.0.2",
124
- "tap": "^15.0.10",
125
- "tslib": "^2.3.1",
126
- "typescript": "^4.4.4"
127
- },
128
- "engines": {
129
- "node": ">=12"
130
73
  }
131
74
  }
package/types/index.d.ts CHANGED
File without changes
package/examples/api.json DELETED
@@ -1 +0,0 @@
1
- {"_quickTake.js":{"title":"Quick Take","content":"import &#x7B; strict as assert &#x7D; from \"assert\";\nimport &#x7B; pull &#x7D; from \"array-pull-all-with-glob\";\n\nassert.deepEqual(\n pull(\n [\"keep_me\", \"name-1\", \"name-2\", \"name-jhkgdhgkhdfghdkghfdk\"],\n [\"name-*\"]\n ),\n [\"keep_me\"]\n);"}}