@storm-software/linting-tools 1.125.9 → 1.125.11
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/README.md +1 -1
- package/bin/lint.cjs +131 -182
- package/bin/lint.js +131 -182
- package/dist/index.cjs +131 -182
- package/dist/index.js +131 -182
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
package/bin/lint.cjs
CHANGED
|
@@ -36733,9 +36733,9 @@ var require_picomatch = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
36733
36733
|
var utils = require_utils2();
|
|
36734
36734
|
var constants = require_constants2();
|
|
36735
36735
|
var isObject3 = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
36736
|
-
var
|
|
36736
|
+
var picomatch2 = (glob5, options, returnState = false) => {
|
|
36737
36737
|
if (Array.isArray(glob5)) {
|
|
36738
|
-
const fns = glob5.map((input) =>
|
|
36738
|
+
const fns = glob5.map((input) => picomatch2(input, options, returnState));
|
|
36739
36739
|
const arrayMatcher = (str2) => {
|
|
36740
36740
|
for (const isMatch of fns) {
|
|
36741
36741
|
const state2 = isMatch(str2);
|
|
@@ -36751,16 +36751,16 @@ var require_picomatch = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
36751
36751
|
}
|
|
36752
36752
|
const opts = options || {};
|
|
36753
36753
|
const posix6 = utils.isWindows(options);
|
|
36754
|
-
const regex3 = isState ?
|
|
36754
|
+
const regex3 = isState ? picomatch2.compileRe(glob5, options) : picomatch2.makeRe(glob5, options, false, true);
|
|
36755
36755
|
const state = regex3.state;
|
|
36756
36756
|
delete regex3.state;
|
|
36757
36757
|
let isIgnored = () => false;
|
|
36758
36758
|
if (opts.ignore) {
|
|
36759
36759
|
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
36760
|
-
isIgnored =
|
|
36760
|
+
isIgnored = picomatch2(opts.ignore, ignoreOpts, returnState);
|
|
36761
36761
|
}
|
|
36762
36762
|
const matcher = (input, returnObject = false) => {
|
|
36763
|
-
const { isMatch, match: match4, output } =
|
|
36763
|
+
const { isMatch, match: match4, output } = picomatch2.test(input, regex3, options, { glob: glob5, posix: posix6 });
|
|
36764
36764
|
const result = { glob: glob5, state, regex: regex3, posix: posix6, input, output, match: match4, isMatch };
|
|
36765
36765
|
if (typeof opts.onResult === "function") {
|
|
36766
36766
|
opts.onResult(result);
|
|
@@ -36786,7 +36786,7 @@ var require_picomatch = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
36786
36786
|
}
|
|
36787
36787
|
return matcher;
|
|
36788
36788
|
};
|
|
36789
|
-
|
|
36789
|
+
picomatch2.test = (input, regex3, options, { glob: glob5, posix: posix6 } = {}) => {
|
|
36790
36790
|
if (typeof input !== "string") {
|
|
36791
36791
|
throw new TypeError("Expected input to be a string");
|
|
36792
36792
|
}
|
|
@@ -36803,24 +36803,24 @@ var require_picomatch = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
36803
36803
|
}
|
|
36804
36804
|
if (match4 === false || opts.capture === true) {
|
|
36805
36805
|
if (opts.matchBase === true || opts.basename === true) {
|
|
36806
|
-
match4 =
|
|
36806
|
+
match4 = picomatch2.matchBase(input, regex3, options, posix6);
|
|
36807
36807
|
} else {
|
|
36808
36808
|
match4 = regex3.exec(output);
|
|
36809
36809
|
}
|
|
36810
36810
|
}
|
|
36811
36811
|
return { isMatch: Boolean(match4), match: match4, output };
|
|
36812
36812
|
};
|
|
36813
|
-
|
|
36814
|
-
const regex3 = glob5 instanceof RegExp ? glob5 :
|
|
36813
|
+
picomatch2.matchBase = (input, glob5, options, posix6 = utils.isWindows(options)) => {
|
|
36814
|
+
const regex3 = glob5 instanceof RegExp ? glob5 : picomatch2.makeRe(glob5, options);
|
|
36815
36815
|
return regex3.test(path32.basename(input));
|
|
36816
36816
|
};
|
|
36817
|
-
|
|
36818
|
-
|
|
36819
|
-
if (Array.isArray(pattern)) return pattern.map((p) =>
|
|
36817
|
+
picomatch2.isMatch = (str2, patterns2, options) => picomatch2(patterns2, options)(str2);
|
|
36818
|
+
picomatch2.parse = (pattern, options) => {
|
|
36819
|
+
if (Array.isArray(pattern)) return pattern.map((p) => picomatch2.parse(p, options));
|
|
36820
36820
|
return parse7(pattern, { ...options, fastpaths: false });
|
|
36821
36821
|
};
|
|
36822
|
-
|
|
36823
|
-
|
|
36822
|
+
picomatch2.scan = (input, options) => scan3(input, options);
|
|
36823
|
+
picomatch2.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
36824
36824
|
if (returnOutput === true) {
|
|
36825
36825
|
return state.output;
|
|
36826
36826
|
}
|
|
@@ -36831,13 +36831,13 @@ var require_picomatch = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
36831
36831
|
if (state && state.negated === true) {
|
|
36832
36832
|
source = `^(?!${source}).*$`;
|
|
36833
36833
|
}
|
|
36834
|
-
const regex3 =
|
|
36834
|
+
const regex3 = picomatch2.toRegex(source, options);
|
|
36835
36835
|
if (returnState === true) {
|
|
36836
36836
|
regex3.state = state;
|
|
36837
36837
|
}
|
|
36838
36838
|
return regex3;
|
|
36839
36839
|
};
|
|
36840
|
-
|
|
36840
|
+
picomatch2.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
36841
36841
|
if (!input || typeof input !== "string") {
|
|
36842
36842
|
throw new TypeError("Expected a non-empty string");
|
|
36843
36843
|
}
|
|
@@ -36848,9 +36848,9 @@ var require_picomatch = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
36848
36848
|
if (!parsed.output) {
|
|
36849
36849
|
parsed = parse7(input, options);
|
|
36850
36850
|
}
|
|
36851
|
-
return
|
|
36851
|
+
return picomatch2.compileRe(parsed, options, returnOutput, returnState);
|
|
36852
36852
|
};
|
|
36853
|
-
|
|
36853
|
+
picomatch2.toRegex = (source, options) => {
|
|
36854
36854
|
try {
|
|
36855
36855
|
const opts = options || {};
|
|
36856
36856
|
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
@@ -36859,8 +36859,8 @@ var require_picomatch = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
36859
36859
|
return /$^/;
|
|
36860
36860
|
}
|
|
36861
36861
|
};
|
|
36862
|
-
|
|
36863
|
-
module.exports =
|
|
36862
|
+
picomatch2.constants = constants;
|
|
36863
|
+
module.exports = picomatch2;
|
|
36864
36864
|
}
|
|
36865
36865
|
});
|
|
36866
36866
|
|
|
@@ -36880,7 +36880,7 @@ var require_micromatch = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
36880
36880
|
_chunkKA2ITQ5Scjs.init_cjs_shims.call(void 0, );
|
|
36881
36881
|
var util3 = _chunkKA2ITQ5Scjs.__require.call(void 0, "util");
|
|
36882
36882
|
var braces = require_braces();
|
|
36883
|
-
var
|
|
36883
|
+
var picomatch2 = require_picomatch2();
|
|
36884
36884
|
var utils = require_utils2();
|
|
36885
36885
|
var isEmptyString = (v) => v === "" || v === "./";
|
|
36886
36886
|
var hasBraces = (v) => {
|
|
@@ -36901,7 +36901,7 @@ var require_micromatch = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
36901
36901
|
}
|
|
36902
36902
|
};
|
|
36903
36903
|
for (let i = 0; i < patterns2.length; i++) {
|
|
36904
|
-
let isMatch =
|
|
36904
|
+
let isMatch = picomatch2(String(patterns2[i]), { ...options, onResult }, true);
|
|
36905
36905
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
36906
36906
|
if (negated) negatives++;
|
|
36907
36907
|
for (let item of list) {
|
|
@@ -36929,8 +36929,8 @@ var require_micromatch = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
36929
36929
|
return matches;
|
|
36930
36930
|
};
|
|
36931
36931
|
micromatch.match = micromatch;
|
|
36932
|
-
micromatch.matcher = (pattern, options) =>
|
|
36933
|
-
micromatch.isMatch = (str2, patterns2, options) =>
|
|
36932
|
+
micromatch.matcher = (pattern, options) => picomatch2(pattern, options);
|
|
36933
|
+
micromatch.isMatch = (str2, patterns2, options) => picomatch2(patterns2, options)(str2);
|
|
36934
36934
|
micromatch.any = micromatch.isMatch;
|
|
36935
36935
|
micromatch.not = (list, patterns2, options = {}) => {
|
|
36936
36936
|
patterns2 = [].concat(patterns2).map(String);
|
|
@@ -36977,7 +36977,7 @@ var require_micromatch = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
36977
36977
|
micromatch.some = (list, patterns2, options) => {
|
|
36978
36978
|
let items = [].concat(list);
|
|
36979
36979
|
for (let pattern of [].concat(patterns2)) {
|
|
36980
|
-
let isMatch =
|
|
36980
|
+
let isMatch = picomatch2(String(pattern), options);
|
|
36981
36981
|
if (items.some((item) => isMatch(item))) {
|
|
36982
36982
|
return true;
|
|
36983
36983
|
}
|
|
@@ -36987,7 +36987,7 @@ var require_micromatch = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
36987
36987
|
micromatch.every = (list, patterns2, options) => {
|
|
36988
36988
|
let items = [].concat(list);
|
|
36989
36989
|
for (let pattern of [].concat(patterns2)) {
|
|
36990
|
-
let isMatch =
|
|
36990
|
+
let isMatch = picomatch2(String(pattern), options);
|
|
36991
36991
|
if (!items.every((item) => isMatch(item))) {
|
|
36992
36992
|
return false;
|
|
36993
36993
|
}
|
|
@@ -36998,23 +36998,23 @@ var require_micromatch = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
36998
36998
|
if (typeof str2 !== "string") {
|
|
36999
36999
|
throw new TypeError(`Expected a string: "${util3.inspect(str2)}"`);
|
|
37000
37000
|
}
|
|
37001
|
-
return [].concat(patterns2).every((p) =>
|
|
37001
|
+
return [].concat(patterns2).every((p) => picomatch2(p, options)(str2));
|
|
37002
37002
|
};
|
|
37003
37003
|
micromatch.capture = (glob5, input, options) => {
|
|
37004
37004
|
let posix6 = utils.isWindows(options);
|
|
37005
|
-
let regex3 =
|
|
37005
|
+
let regex3 = picomatch2.makeRe(String(glob5), { ...options, capture: true });
|
|
37006
37006
|
let match4 = regex3.exec(posix6 ? utils.toPosixSlashes(input) : input);
|
|
37007
37007
|
if (match4) {
|
|
37008
37008
|
return match4.slice(1).map((v) => v === void 0 ? "" : v);
|
|
37009
37009
|
}
|
|
37010
37010
|
};
|
|
37011
|
-
micromatch.makeRe = (...args) =>
|
|
37012
|
-
micromatch.scan = (...args) =>
|
|
37011
|
+
micromatch.makeRe = (...args) => picomatch2.makeRe(...args);
|
|
37012
|
+
micromatch.scan = (...args) => picomatch2.scan(...args);
|
|
37013
37013
|
micromatch.parse = (patterns2, options) => {
|
|
37014
37014
|
let res = [];
|
|
37015
37015
|
for (let pattern of [].concat(patterns2 || [])) {
|
|
37016
37016
|
for (let str2 of braces(String(pattern), options)) {
|
|
37017
|
-
res.push(
|
|
37017
|
+
res.push(picomatch2.parse(str2, options));
|
|
37018
37018
|
}
|
|
37019
37019
|
}
|
|
37020
37020
|
return res;
|
|
@@ -49177,9 +49177,9 @@ var require_picomatch3 = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
49177
49177
|
var utils = require_utils6();
|
|
49178
49178
|
var constants = require_constants4();
|
|
49179
49179
|
var isObject3 = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
49180
|
-
var
|
|
49180
|
+
var picomatch2 = (glob5, options, returnState = false) => {
|
|
49181
49181
|
if (Array.isArray(glob5)) {
|
|
49182
|
-
const fns = glob5.map((input) =>
|
|
49182
|
+
const fns = glob5.map((input) => picomatch2(input, options, returnState));
|
|
49183
49183
|
const arrayMatcher = (str2) => {
|
|
49184
49184
|
for (const isMatch of fns) {
|
|
49185
49185
|
const state2 = isMatch(str2);
|
|
@@ -49195,16 +49195,16 @@ var require_picomatch3 = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
49195
49195
|
}
|
|
49196
49196
|
const opts = options || {};
|
|
49197
49197
|
const posix6 = opts.windows;
|
|
49198
|
-
const regex3 = isState ?
|
|
49198
|
+
const regex3 = isState ? picomatch2.compileRe(glob5, options) : picomatch2.makeRe(glob5, options, false, true);
|
|
49199
49199
|
const state = regex3.state;
|
|
49200
49200
|
delete regex3.state;
|
|
49201
49201
|
let isIgnored = () => false;
|
|
49202
49202
|
if (opts.ignore) {
|
|
49203
49203
|
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
49204
|
-
isIgnored =
|
|
49204
|
+
isIgnored = picomatch2(opts.ignore, ignoreOpts, returnState);
|
|
49205
49205
|
}
|
|
49206
49206
|
const matcher = (input, returnObject = false) => {
|
|
49207
|
-
const { isMatch, match: match4, output } =
|
|
49207
|
+
const { isMatch, match: match4, output } = picomatch2.test(input, regex3, options, { glob: glob5, posix: posix6 });
|
|
49208
49208
|
const result = { glob: glob5, state, regex: regex3, posix: posix6, input, output, match: match4, isMatch };
|
|
49209
49209
|
if (typeof opts.onResult === "function") {
|
|
49210
49210
|
opts.onResult(result);
|
|
@@ -49230,7 +49230,7 @@ var require_picomatch3 = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
49230
49230
|
}
|
|
49231
49231
|
return matcher;
|
|
49232
49232
|
};
|
|
49233
|
-
|
|
49233
|
+
picomatch2.test = (input, regex3, options, { glob: glob5, posix: posix6 } = {}) => {
|
|
49234
49234
|
if (typeof input !== "string") {
|
|
49235
49235
|
throw new TypeError("Expected input to be a string");
|
|
49236
49236
|
}
|
|
@@ -49247,24 +49247,24 @@ var require_picomatch3 = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
49247
49247
|
}
|
|
49248
49248
|
if (match4 === false || opts.capture === true) {
|
|
49249
49249
|
if (opts.matchBase === true || opts.basename === true) {
|
|
49250
|
-
match4 =
|
|
49250
|
+
match4 = picomatch2.matchBase(input, regex3, options, posix6);
|
|
49251
49251
|
} else {
|
|
49252
49252
|
match4 = regex3.exec(output);
|
|
49253
49253
|
}
|
|
49254
49254
|
}
|
|
49255
49255
|
return { isMatch: Boolean(match4), match: match4, output };
|
|
49256
49256
|
};
|
|
49257
|
-
|
|
49258
|
-
const regex3 = glob5 instanceof RegExp ? glob5 :
|
|
49257
|
+
picomatch2.matchBase = (input, glob5, options) => {
|
|
49258
|
+
const regex3 = glob5 instanceof RegExp ? glob5 : picomatch2.makeRe(glob5, options);
|
|
49259
49259
|
return regex3.test(utils.basename(input));
|
|
49260
49260
|
};
|
|
49261
|
-
|
|
49262
|
-
|
|
49263
|
-
if (Array.isArray(pattern)) return pattern.map((p) =>
|
|
49261
|
+
picomatch2.isMatch = (str2, patterns2, options) => picomatch2(patterns2, options)(str2);
|
|
49262
|
+
picomatch2.parse = (pattern, options) => {
|
|
49263
|
+
if (Array.isArray(pattern)) return pattern.map((p) => picomatch2.parse(p, options));
|
|
49264
49264
|
return parse7(pattern, { ...options, fastpaths: false });
|
|
49265
49265
|
};
|
|
49266
|
-
|
|
49267
|
-
|
|
49266
|
+
picomatch2.scan = (input, options) => scan3(input, options);
|
|
49267
|
+
picomatch2.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
49268
49268
|
if (returnOutput === true) {
|
|
49269
49269
|
return state.output;
|
|
49270
49270
|
}
|
|
@@ -49275,13 +49275,13 @@ var require_picomatch3 = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
49275
49275
|
if (state && state.negated === true) {
|
|
49276
49276
|
source = `^(?!${source}).*$`;
|
|
49277
49277
|
}
|
|
49278
|
-
const regex3 =
|
|
49278
|
+
const regex3 = picomatch2.toRegex(source, options);
|
|
49279
49279
|
if (returnState === true) {
|
|
49280
49280
|
regex3.state = state;
|
|
49281
49281
|
}
|
|
49282
49282
|
return regex3;
|
|
49283
49283
|
};
|
|
49284
|
-
|
|
49284
|
+
picomatch2.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
49285
49285
|
if (!input || typeof input !== "string") {
|
|
49286
49286
|
throw new TypeError("Expected a non-empty string");
|
|
49287
49287
|
}
|
|
@@ -49292,9 +49292,9 @@ var require_picomatch3 = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
49292
49292
|
if (!parsed.output) {
|
|
49293
49293
|
parsed = parse7(input, options);
|
|
49294
49294
|
}
|
|
49295
|
-
return
|
|
49295
|
+
return picomatch2.compileRe(parsed, options, returnOutput, returnState);
|
|
49296
49296
|
};
|
|
49297
|
-
|
|
49297
|
+
picomatch2.toRegex = (source, options) => {
|
|
49298
49298
|
try {
|
|
49299
49299
|
const opts = options || {};
|
|
49300
49300
|
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
@@ -49303,8 +49303,8 @@ var require_picomatch3 = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
49303
49303
|
return /$^/;
|
|
49304
49304
|
}
|
|
49305
49305
|
};
|
|
49306
|
-
|
|
49307
|
-
module.exports =
|
|
49306
|
+
picomatch2.constants = constants;
|
|
49307
|
+
module.exports = picomatch2;
|
|
49308
49308
|
}
|
|
49309
49309
|
});
|
|
49310
49310
|
|
|
@@ -49315,14 +49315,14 @@ var require_picomatch4 = _chunkKA2ITQ5Scjs.__commonJS.call(void 0, {
|
|
|
49315
49315
|
_chunkKA2ITQ5Scjs.init_cjs_shims.call(void 0, );
|
|
49316
49316
|
var pico = require_picomatch3();
|
|
49317
49317
|
var utils = require_utils6();
|
|
49318
|
-
function
|
|
49318
|
+
function picomatch2(glob5, options, returnState = false) {
|
|
49319
49319
|
if (options && (options.windows === null || options.windows === void 0)) {
|
|
49320
49320
|
options = { ...options, windows: utils.isWindows() };
|
|
49321
49321
|
}
|
|
49322
49322
|
return pico(glob5, options, returnState);
|
|
49323
49323
|
}
|
|
49324
|
-
Object.assign(
|
|
49325
|
-
module.exports =
|
|
49324
|
+
Object.assign(picomatch2, pico);
|
|
49325
|
+
module.exports = picomatch2;
|
|
49326
49326
|
}
|
|
49327
49327
|
});
|
|
49328
49328
|
|
|
@@ -345517,11 +345517,10 @@ _chunkKA2ITQ5Scjs.init_cjs_shims.call(void 0, );
|
|
|
345517
345517
|
|
|
345518
345518
|
|
|
345519
345519
|
|
|
345520
|
-
// ../../node_modules/.pnpm/tinyglobby@0.2.
|
|
345520
|
+
// ../../node_modules/.pnpm/tinyglobby@0.2.14/node_modules/tinyglobby/dist/index.mjs
|
|
345521
345521
|
_chunkKA2ITQ5Scjs.init_cjs_shims.call(void 0, );
|
|
345522
345522
|
var import_fdir = _chunkKA2ITQ5Scjs.__toESM.call(void 0, require_dist2(), 1);
|
|
345523
345523
|
var import_picomatch2 = _chunkKA2ITQ5Scjs.__toESM.call(void 0, require_picomatch4(), 1);
|
|
345524
|
-
var import_picomatch3 = _chunkKA2ITQ5Scjs.__toESM.call(void 0, require_picomatch4(), 1);
|
|
345525
345524
|
|
|
345526
345525
|
var ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
345527
345526
|
function getPartialMatcher(patterns2, options) {
|
|
@@ -345533,16 +345532,12 @@ function getPartialMatcher(patterns2, options) {
|
|
|
345533
345532
|
patternsParts[i] = parts;
|
|
345534
345533
|
const partsCount = parts.length;
|
|
345535
345534
|
const partRegexes = Array(partsCount);
|
|
345536
|
-
for (let j = 0; j < partsCount; j++)
|
|
345537
|
-
partRegexes[j] = import_picomatch3.default.makeRe(parts[j], options);
|
|
345538
|
-
}
|
|
345535
|
+
for (let j = 0; j < partsCount; j++) partRegexes[j] = import_picomatch2.default.makeRe(parts[j], options);
|
|
345539
345536
|
regexes[i] = partRegexes;
|
|
345540
345537
|
}
|
|
345541
345538
|
return (input) => {
|
|
345542
345539
|
const inputParts = input.split("/");
|
|
345543
|
-
if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input))
|
|
345544
|
-
return true;
|
|
345545
|
-
}
|
|
345540
|
+
if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) return true;
|
|
345546
345541
|
for (let i = 0; i < patterns2.length; i++) {
|
|
345547
345542
|
const patternParts = patternsParts[i];
|
|
345548
345543
|
const regex3 = regexes[i];
|
|
@@ -345551,42 +345546,32 @@ function getPartialMatcher(patterns2, options) {
|
|
|
345551
345546
|
let j = 0;
|
|
345552
345547
|
while (j < minParts) {
|
|
345553
345548
|
const part = patternParts[j];
|
|
345554
|
-
if (part.includes("/"))
|
|
345555
|
-
return true;
|
|
345556
|
-
}
|
|
345549
|
+
if (part.includes("/")) return true;
|
|
345557
345550
|
const match4 = regex3[j].test(inputParts[j]);
|
|
345558
|
-
if (!match4)
|
|
345559
|
-
|
|
345560
|
-
}
|
|
345561
|
-
if (part === "**") {
|
|
345562
|
-
return true;
|
|
345563
|
-
}
|
|
345551
|
+
if (!match4) break;
|
|
345552
|
+
if (part === "**") return true;
|
|
345564
345553
|
j++;
|
|
345565
345554
|
}
|
|
345566
|
-
if (j === inputPatternCount)
|
|
345567
|
-
return true;
|
|
345568
|
-
}
|
|
345555
|
+
if (j === inputPatternCount) return true;
|
|
345569
345556
|
}
|
|
345570
345557
|
return false;
|
|
345571
345558
|
};
|
|
345572
345559
|
}
|
|
345573
345560
|
var splitPatternOptions = { parts: true };
|
|
345574
|
-
function splitPattern(
|
|
345575
|
-
var
|
|
345576
|
-
const result =
|
|
345577
|
-
return ((
|
|
345561
|
+
function splitPattern(path$1) {
|
|
345562
|
+
var _result$parts;
|
|
345563
|
+
const result = import_picomatch2.default.scan(path$1, splitPatternOptions);
|
|
345564
|
+
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1];
|
|
345578
345565
|
}
|
|
345579
345566
|
var isWin = process.platform === "win32";
|
|
345580
345567
|
var POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
|
|
345581
345568
|
var WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
345582
|
-
var escapePosixPath = (
|
|
345583
|
-
var escapeWin32Path = (
|
|
345569
|
+
var escapePosixPath = (path$1) => path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
345570
|
+
var escapeWin32Path = (path$1) => path$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
345584
345571
|
var escapePath = isWin ? escapeWin32Path : escapePosixPath;
|
|
345585
345572
|
function isDynamicPattern2(pattern, options) {
|
|
345586
|
-
if ((options
|
|
345587
|
-
|
|
345588
|
-
}
|
|
345589
|
-
const scan3 = import_picomatch3.default.scan(pattern);
|
|
345573
|
+
if ((options === null || options === void 0 ? void 0 : options.caseSensitiveMatch) === false) return true;
|
|
345574
|
+
const scan3 = import_picomatch2.default.scan(pattern);
|
|
345590
345575
|
return scan3.isGlob || scan3.negated;
|
|
345591
345576
|
}
|
|
345592
345577
|
function log2(...tasks) {
|
|
@@ -345596,29 +345581,31 @@ var PARENT_DIRECTORY = /^(\/?\.\.)+/;
|
|
|
345596
345581
|
var ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
|
|
345597
345582
|
var BACKSLASHES = /\\/g;
|
|
345598
345583
|
function normalizePattern3(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
345599
|
-
var _a;
|
|
345600
345584
|
let result = pattern;
|
|
345601
|
-
if (pattern.endsWith("/"))
|
|
345602
|
-
|
|
345603
|
-
|
|
345604
|
-
if (
|
|
345605
|
-
|
|
345606
|
-
}
|
|
345607
|
-
if (path6.default.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) {
|
|
345608
|
-
result = _path2.posix.relative(escapePath(cwd), result);
|
|
345609
|
-
} else {
|
|
345610
|
-
result = _path2.posix.normalize(result);
|
|
345611
|
-
}
|
|
345585
|
+
if (pattern.endsWith("/")) result = pattern.slice(0, -1);
|
|
345586
|
+
if (!result.endsWith("*") && expandDirectories) result += "/**";
|
|
345587
|
+
const escapedCwd = escapePath(cwd);
|
|
345588
|
+
if (path6.default.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) result = _path2.posix.relative(escapedCwd, result);
|
|
345589
|
+
else result = _path2.posix.normalize(result);
|
|
345612
345590
|
const parentDirectoryMatch = PARENT_DIRECTORY.exec(result);
|
|
345613
|
-
|
|
345614
|
-
|
|
345615
|
-
|
|
345591
|
+
const parts = splitPattern(result);
|
|
345592
|
+
if (parentDirectoryMatch === null || parentDirectoryMatch === void 0 ? void 0 : parentDirectoryMatch[0]) {
|
|
345593
|
+
const n = (parentDirectoryMatch[0].length + 1) / 3;
|
|
345594
|
+
let i = 0;
|
|
345595
|
+
const cwdParts = escapedCwd.split("/");
|
|
345596
|
+
while (i < n && parts[i + n] === cwdParts[cwdParts.length + i - n]) {
|
|
345597
|
+
result = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || ".";
|
|
345598
|
+
i++;
|
|
345599
|
+
}
|
|
345600
|
+
const potentialRoot = _path2.posix.join(cwd, parentDirectoryMatch[0].slice(i * 3));
|
|
345601
|
+
if (!potentialRoot.startsWith(".") && props.root.length > potentialRoot.length) {
|
|
345616
345602
|
props.root = potentialRoot;
|
|
345617
|
-
props.depthOffset = -
|
|
345603
|
+
props.depthOffset = -n + i;
|
|
345618
345604
|
}
|
|
345619
|
-
}
|
|
345620
|
-
|
|
345621
|
-
|
|
345605
|
+
}
|
|
345606
|
+
if (!isIgnore && props.depthOffset >= 0) {
|
|
345607
|
+
var _props$commonPath;
|
|
345608
|
+
(_props$commonPath = props.commonPath) !== null && _props$commonPath !== void 0 || (props.commonPath = parts);
|
|
345622
345609
|
const newCommonPath = [];
|
|
345623
345610
|
const length = Math.min(props.commonPath.length, parts.length);
|
|
345624
345611
|
for (let i = 0; i < length; i++) {
|
|
@@ -345627,9 +345614,7 @@ function normalizePattern3(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
|
345627
345614
|
newCommonPath.pop();
|
|
345628
345615
|
break;
|
|
345629
345616
|
}
|
|
345630
|
-
if (part !== props.commonPath[i] || isDynamicPattern2(part) || i === parts.length - 1)
|
|
345631
|
-
break;
|
|
345632
|
-
}
|
|
345617
|
+
if (part !== props.commonPath[i] || isDynamicPattern2(part) || i === parts.length - 1) break;
|
|
345633
345618
|
newCommonPath.push(part);
|
|
345634
345619
|
}
|
|
345635
345620
|
props.depthOffset = newCommonPath.length;
|
|
@@ -345639,63 +345624,44 @@ function normalizePattern3(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
|
345639
345624
|
return result;
|
|
345640
345625
|
}
|
|
345641
345626
|
function processPatterns({ patterns: patterns2, ignore: ignore3 = [], expandDirectories = true }, cwd, props) {
|
|
345642
|
-
if (typeof patterns2 === "string")
|
|
345643
|
-
|
|
345644
|
-
|
|
345645
|
-
patterns2 = ["**/*"];
|
|
345646
|
-
}
|
|
345647
|
-
if (typeof ignore3 === "string") {
|
|
345648
|
-
ignore3 = [ignore3];
|
|
345649
|
-
}
|
|
345627
|
+
if (typeof patterns2 === "string") patterns2 = [patterns2];
|
|
345628
|
+
else if (!patterns2) patterns2 = ["**/*"];
|
|
345629
|
+
if (typeof ignore3 === "string") ignore3 = [ignore3];
|
|
345650
345630
|
const matchPatterns = [];
|
|
345651
345631
|
const ignorePatterns = [];
|
|
345652
345632
|
for (const pattern of ignore3) {
|
|
345653
|
-
if (!pattern)
|
|
345654
|
-
|
|
345655
|
-
}
|
|
345656
|
-
if (pattern[0] !== "!" || pattern[1] === "(") {
|
|
345657
|
-
ignorePatterns.push(normalizePattern3(pattern, expandDirectories, cwd, props, true));
|
|
345658
|
-
}
|
|
345633
|
+
if (!pattern) continue;
|
|
345634
|
+
if (pattern[0] !== "!" || pattern[1] === "(") ignorePatterns.push(normalizePattern3(pattern, expandDirectories, cwd, props, true));
|
|
345659
345635
|
}
|
|
345660
345636
|
for (const pattern of patterns2) {
|
|
345661
|
-
if (!pattern)
|
|
345662
|
-
|
|
345663
|
-
|
|
345664
|
-
if (pattern[0] !== "!" || pattern[1] === "(") {
|
|
345665
|
-
matchPatterns.push(normalizePattern3(pattern, expandDirectories, cwd, props, false));
|
|
345666
|
-
} else if (pattern[1] !== "!" || pattern[2] === "(") {
|
|
345667
|
-
ignorePatterns.push(normalizePattern3(pattern.slice(1), expandDirectories, cwd, props, true));
|
|
345668
|
-
}
|
|
345637
|
+
if (!pattern) continue;
|
|
345638
|
+
if (pattern[0] !== "!" || pattern[1] === "(") matchPatterns.push(normalizePattern3(pattern, expandDirectories, cwd, props, false));
|
|
345639
|
+
else if (pattern[1] !== "!" || pattern[2] === "(") ignorePatterns.push(normalizePattern3(pattern.slice(1), expandDirectories, cwd, props, true));
|
|
345669
345640
|
}
|
|
345670
|
-
return {
|
|
345641
|
+
return {
|
|
345642
|
+
match: matchPatterns,
|
|
345643
|
+
ignore: ignorePatterns
|
|
345644
|
+
};
|
|
345671
345645
|
}
|
|
345672
|
-
function getRelativePath(
|
|
345673
|
-
return _path2.posix.relative(cwd, `${root}/${
|
|
345646
|
+
function getRelativePath(path$1, cwd, root) {
|
|
345647
|
+
return _path2.posix.relative(cwd, `${root}/${path$1}`) || ".";
|
|
345674
345648
|
}
|
|
345675
|
-
function processPath(
|
|
345676
|
-
const relativePath2 = absolute ?
|
|
345677
|
-
if (root === cwd)
|
|
345678
|
-
return isDirectory2 && relativePath2 !== "." ? relativePath2.slice(0, -1) : relativePath2;
|
|
345679
|
-
}
|
|
345649
|
+
function processPath(path$1, cwd, root, isDirectory2, absolute) {
|
|
345650
|
+
const relativePath2 = absolute ? path$1.slice(root === "/" ? 1 : root.length + 1) || "." : path$1;
|
|
345651
|
+
if (root === cwd) return isDirectory2 && relativePath2 !== "." ? relativePath2.slice(0, -1) : relativePath2;
|
|
345680
345652
|
return getRelativePath(relativePath2, cwd, root);
|
|
345681
345653
|
}
|
|
345682
345654
|
function formatPaths(paths, cwd, root) {
|
|
345683
345655
|
for (let i = paths.length - 1; i >= 0; i--) {
|
|
345684
|
-
const
|
|
345685
|
-
paths[i] = getRelativePath(
|
|
345656
|
+
const path$1 = paths[i];
|
|
345657
|
+
paths[i] = getRelativePath(path$1, cwd, root) + (!path$1 || path$1.endsWith("/") ? "/" : "");
|
|
345686
345658
|
}
|
|
345687
345659
|
return paths;
|
|
345688
345660
|
}
|
|
345689
345661
|
function crawl(options, cwd, sync3) {
|
|
345690
|
-
if (process.env.TINYGLOBBY_DEBUG)
|
|
345691
|
-
|
|
345692
|
-
|
|
345693
|
-
if (options.debug) {
|
|
345694
|
-
log2("globbing with options:", options, "cwd:", cwd);
|
|
345695
|
-
}
|
|
345696
|
-
if (Array.isArray(options.patterns) && options.patterns.length === 0) {
|
|
345697
|
-
return sync3 ? [] : Promise.resolve([]);
|
|
345698
|
-
}
|
|
345662
|
+
if (process.env.TINYGLOBBY_DEBUG) options.debug = true;
|
|
345663
|
+
if (options.debug) log2("globbing with options:", options, "cwd:", cwd);
|
|
345664
|
+
if (Array.isArray(options.patterns) && options.patterns.length === 0) return sync3 ? [] : Promise.resolve([]);
|
|
345699
345665
|
const props = {
|
|
345700
345666
|
root: cwd,
|
|
345701
345667
|
commonPath: null,
|
|
@@ -345703,9 +345669,7 @@ function crawl(options, cwd, sync3) {
|
|
|
345703
345669
|
};
|
|
345704
345670
|
const processed = processPatterns(options, cwd, props);
|
|
345705
345671
|
const nocase = options.caseSensitiveMatch === false;
|
|
345706
|
-
if (options.debug)
|
|
345707
|
-
log2("internal processing patterns:", processed);
|
|
345708
|
-
}
|
|
345672
|
+
if (options.debug) log2("internal processing patterns:", processed);
|
|
345709
345673
|
const matcher = (0, import_picomatch2.default)(processed.match, {
|
|
345710
345674
|
dot: options.dot,
|
|
345711
345675
|
nocase,
|
|
@@ -345720,25 +345684,17 @@ function crawl(options, cwd, sync3) {
|
|
|
345720
345684
|
nocase
|
|
345721
345685
|
});
|
|
345722
345686
|
const fdirOptions = {
|
|
345723
|
-
|
|
345724
|
-
|
|
345725
|
-
|
|
345726
|
-
|
|
345727
|
-
|
|
345728
|
-
|
|
345729
|
-
log2(`matched ${path210}`);
|
|
345730
|
-
}
|
|
345731
|
-
return matches;
|
|
345732
|
-
} : (p, isDirectory2) => matcher(processPath(p, cwd, props.root, isDirectory2, options.absolute))
|
|
345733
|
-
],
|
|
345687
|
+
filters: [options.debug ? (p, isDirectory2) => {
|
|
345688
|
+
const path$1 = processPath(p, cwd, props.root, isDirectory2, options.absolute);
|
|
345689
|
+
const matches = matcher(path$1);
|
|
345690
|
+
if (matches) log2(`matched ${path$1}`);
|
|
345691
|
+
return matches;
|
|
345692
|
+
} : (p, isDirectory2) => matcher(processPath(p, cwd, props.root, isDirectory2, options.absolute))],
|
|
345734
345693
|
exclude: options.debug ? (_, p) => {
|
|
345735
345694
|
const relativePath2 = processPath(p, cwd, props.root, true, true);
|
|
345736
345695
|
const skipped = relativePath2 !== "." && !partialMatcher(relativePath2) || ignore3(relativePath2);
|
|
345737
|
-
if (skipped) {
|
|
345738
|
-
|
|
345739
|
-
} else {
|
|
345740
|
-
log2(`crawling ${p}`);
|
|
345741
|
-
}
|
|
345696
|
+
if (skipped) log2(`skipped ${p}`);
|
|
345697
|
+
else log2(`crawling ${p}`);
|
|
345742
345698
|
return skipped;
|
|
345743
345699
|
} : (_, p) => {
|
|
345744
345700
|
const relativePath2 = processPath(p, cwd, props.root, true, true);
|
|
@@ -345748,9 +345704,7 @@ function crawl(options, cwd, sync3) {
|
|
|
345748
345704
|
relativePaths: true,
|
|
345749
345705
|
resolveSymlinks: true
|
|
345750
345706
|
};
|
|
345751
|
-
if (options.deep)
|
|
345752
|
-
fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset);
|
|
345753
|
-
}
|
|
345707
|
+
if (options.deep !== void 0) fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset);
|
|
345754
345708
|
if (options.absolute) {
|
|
345755
345709
|
fdirOptions.relativePaths = false;
|
|
345756
345710
|
fdirOptions.resolvePaths = true;
|
|
@@ -345763,25 +345717,20 @@ function crawl(options, cwd, sync3) {
|
|
|
345763
345717
|
if (options.onlyDirectories) {
|
|
345764
345718
|
fdirOptions.excludeFiles = true;
|
|
345765
345719
|
fdirOptions.includeDirs = true;
|
|
345766
|
-
} else if (options.onlyFiles === false)
|
|
345767
|
-
fdirOptions.includeDirs = true;
|
|
345768
|
-
}
|
|
345720
|
+
} else if (options.onlyFiles === false) fdirOptions.includeDirs = true;
|
|
345769
345721
|
props.root = props.root.replace(BACKSLASHES, "");
|
|
345770
345722
|
const root = props.root;
|
|
345771
|
-
if (options.debug)
|
|
345772
|
-
log2("internal properties:", props);
|
|
345773
|
-
}
|
|
345723
|
+
if (options.debug) log2("internal properties:", props);
|
|
345774
345724
|
const api = new import_fdir.fdir(fdirOptions).crawl(root);
|
|
345775
|
-
if (cwd === root || options.absolute)
|
|
345776
|
-
return sync3 ? api.sync() : api.withPromise();
|
|
345777
|
-
}
|
|
345725
|
+
if (cwd === root || options.absolute) return sync3 ? api.sync() : api.withPromise();
|
|
345778
345726
|
return sync3 ? formatPaths(api.sync(), cwd, root) : api.withPromise().then((paths) => formatPaths(paths, cwd, root));
|
|
345779
345727
|
}
|
|
345780
345728
|
async function glob(patternsOrOptions, options) {
|
|
345781
|
-
if (patternsOrOptions && (options
|
|
345782
|
-
|
|
345783
|
-
|
|
345784
|
-
|
|
345729
|
+
if (patternsOrOptions && (options === null || options === void 0 ? void 0 : options.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
|
|
345730
|
+
const opts = Array.isArray(patternsOrOptions) || typeof patternsOrOptions === "string" ? {
|
|
345731
|
+
...options,
|
|
345732
|
+
patterns: patternsOrOptions
|
|
345733
|
+
} : patternsOrOptions;
|
|
345785
345734
|
const cwd = opts.cwd ? path6.default.resolve(opts.cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
|
|
345786
345735
|
return crawl(opts, cwd, false);
|
|
345787
345736
|
}
|