rollup 2.39.1 → 2.40.0
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 +14 -0
- package/dist/bin/rollup +2 -2
- package/dist/es/rollup.browser.js +3 -3
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/rollup.js +258 -253
- package/dist/es/shared/watch.js +448 -448
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +442 -442
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/mergeOptions.js +2 -2
- package/dist/shared/rollup.js +258 -253
- package/dist/shared/watch-cli.js +18 -18
- package/dist/shared/watch.js +2 -2
- package/package.json +1 -1
package/dist/es/shared/watch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.40.0
|
|
4
|
+
Fri, 26 Feb 2021 14:39:44 GMT - commit 0a0958ff926554abe9916178f56762ba71301ddd
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -17,7 +17,7 @@ import require$$1 from 'stream';
|
|
|
17
17
|
import require$$2, { platform } from 'os';
|
|
18
18
|
import 'crypto';
|
|
19
19
|
|
|
20
|
-
var utils = {};
|
|
20
|
+
var utils$8 = {};
|
|
21
21
|
|
|
22
22
|
(function (exports) {
|
|
23
23
|
|
|
@@ -131,18 +131,18 @@ exports.flatten = (...args) => {
|
|
|
131
131
|
flat(args);
|
|
132
132
|
return result;
|
|
133
133
|
};
|
|
134
|
-
}(utils));
|
|
134
|
+
}(utils$8));
|
|
135
135
|
|
|
136
|
-
const utils$
|
|
136
|
+
const utils$7 = utils$8;
|
|
137
137
|
|
|
138
|
-
var stringify = (ast, options = {}) => {
|
|
138
|
+
var stringify$4 = (ast, options = {}) => {
|
|
139
139
|
let stringify = (node, parent = {}) => {
|
|
140
|
-
let invalidBlock = options.escapeInvalid && utils$
|
|
140
|
+
let invalidBlock = options.escapeInvalid && utils$7.isInvalidBrace(parent);
|
|
141
141
|
let invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
142
142
|
let output = '';
|
|
143
143
|
|
|
144
144
|
if (node.value) {
|
|
145
|
-
if ((invalidBlock || invalidNode) && utils$
|
|
145
|
+
if ((invalidBlock || invalidNode) && utils$7.isOpenOrClose(node)) {
|
|
146
146
|
return '\\' + node.value;
|
|
147
147
|
}
|
|
148
148
|
return node.value;
|
|
@@ -170,7 +170,7 @@ var stringify = (ast, options = {}) => {
|
|
|
170
170
|
* Released under the MIT License.
|
|
171
171
|
*/
|
|
172
172
|
|
|
173
|
-
var isNumber = function(num) {
|
|
173
|
+
var isNumber$2 = function(num) {
|
|
174
174
|
if (typeof num === 'number') {
|
|
175
175
|
return num - num === 0;
|
|
176
176
|
}
|
|
@@ -187,9 +187,9 @@ var isNumber = function(num) {
|
|
|
187
187
|
* Released under the MIT License.
|
|
188
188
|
*/
|
|
189
189
|
|
|
190
|
-
const isNumber$1 = isNumber;
|
|
190
|
+
const isNumber$1 = isNumber$2;
|
|
191
191
|
|
|
192
|
-
const toRegexRange = (min, max, options) => {
|
|
192
|
+
const toRegexRange$1 = (min, max, options) => {
|
|
193
193
|
if (isNumber$1(min) === false) {
|
|
194
194
|
throw new TypeError('toRegexRange: expected the first argument to be a number');
|
|
195
195
|
}
|
|
@@ -213,8 +213,8 @@ const toRegexRange = (min, max, options) => {
|
|
|
213
213
|
let wrap = String(opts.wrap);
|
|
214
214
|
let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap;
|
|
215
215
|
|
|
216
|
-
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
217
|
-
return toRegexRange.cache[cacheKey].result;
|
|
216
|
+
if (toRegexRange$1.cache.hasOwnProperty(cacheKey)) {
|
|
217
|
+
return toRegexRange$1.cache[cacheKey].result;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
let a = Math.min(min, max);
|
|
@@ -261,7 +261,7 @@ const toRegexRange = (min, max, options) => {
|
|
|
261
261
|
state.result = `(?:${state.result})`;
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
toRegexRange.cache[cacheKey] = state;
|
|
264
|
+
toRegexRange$1.cache[cacheKey] = state;
|
|
265
265
|
return state.result;
|
|
266
266
|
};
|
|
267
267
|
|
|
@@ -458,14 +458,14 @@ function padZeros(value, tok, options) {
|
|
|
458
458
|
* Cache
|
|
459
459
|
*/
|
|
460
460
|
|
|
461
|
-
toRegexRange.cache = {};
|
|
462
|
-
toRegexRange.clearCache = () => (toRegexRange.cache = {});
|
|
461
|
+
toRegexRange$1.cache = {};
|
|
462
|
+
toRegexRange$1.clearCache = () => (toRegexRange$1.cache = {});
|
|
463
463
|
|
|
464
464
|
/**
|
|
465
465
|
* Expose `toRegexRange`
|
|
466
466
|
*/
|
|
467
467
|
|
|
468
|
-
var toRegexRange_1 = toRegexRange;
|
|
468
|
+
var toRegexRange_1 = toRegexRange$1;
|
|
469
469
|
|
|
470
470
|
/*!
|
|
471
471
|
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|
@@ -474,10 +474,10 @@ var toRegexRange_1 = toRegexRange;
|
|
|
474
474
|
* Licensed under the MIT License.
|
|
475
475
|
*/
|
|
476
476
|
|
|
477
|
-
const util = require$$0$1;
|
|
478
|
-
const toRegexRange
|
|
477
|
+
const util$1 = require$$0$1;
|
|
478
|
+
const toRegexRange = toRegexRange_1;
|
|
479
479
|
|
|
480
|
-
const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
|
480
|
+
const isObject$1 = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
|
481
481
|
|
|
482
482
|
const transform = toNumber => {
|
|
483
483
|
return value => toNumber === true ? Number(value) : String(value);
|
|
@@ -487,7 +487,7 @@ const isValidValue = value => {
|
|
|
487
487
|
return typeof value === 'number' || (typeof value === 'string' && value !== '');
|
|
488
488
|
};
|
|
489
489
|
|
|
490
|
-
const isNumber
|
|
490
|
+
const isNumber = num => Number.isInteger(+num);
|
|
491
491
|
|
|
492
492
|
const zeros = input => {
|
|
493
493
|
let value = `${input}`;
|
|
@@ -498,7 +498,7 @@ const zeros = input => {
|
|
|
498
498
|
return index > 0;
|
|
499
499
|
};
|
|
500
500
|
|
|
501
|
-
const stringify$
|
|
501
|
+
const stringify$3 = (start, end, options) => {
|
|
502
502
|
if (typeof start === 'string' || typeof end === 'string') {
|
|
503
503
|
return true;
|
|
504
504
|
}
|
|
@@ -559,7 +559,7 @@ const toSequence = (parts, options) => {
|
|
|
559
559
|
|
|
560
560
|
const toRange = (a, b, isNumbers, options) => {
|
|
561
561
|
if (isNumbers) {
|
|
562
|
-
return toRegexRange
|
|
562
|
+
return toRegexRange(a, b, { wrap: false, ...options });
|
|
563
563
|
}
|
|
564
564
|
|
|
565
565
|
let start = String.fromCharCode(a);
|
|
@@ -575,11 +575,11 @@ const toRegex = (start, end, options) => {
|
|
|
575
575
|
let prefix = options.capture ? '' : '?:';
|
|
576
576
|
return wrap ? `(${prefix}${start.join('|')})` : start.join('|');
|
|
577
577
|
}
|
|
578
|
-
return toRegexRange
|
|
578
|
+
return toRegexRange(start, end, options);
|
|
579
579
|
};
|
|
580
580
|
|
|
581
581
|
const rangeError = (...args) => {
|
|
582
|
-
return new RangeError('Invalid range arguments: ' + util.inspect(...args));
|
|
582
|
+
return new RangeError('Invalid range arguments: ' + util$1.inspect(...args));
|
|
583
583
|
};
|
|
584
584
|
|
|
585
585
|
const invalidRange = (start, end, options) => {
|
|
@@ -615,7 +615,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
|
|
|
615
615
|
|
|
616
616
|
let padded = zeros(startString) || zeros(endString) || zeros(stepString);
|
|
617
617
|
let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
|
618
|
-
let toNumber = padded === false && stringify$
|
|
618
|
+
let toNumber = padded === false && stringify$3(start, end, options) === false;
|
|
619
619
|
let format = options.transform || transform(toNumber);
|
|
620
620
|
|
|
621
621
|
if (options.toRegex && step === 1) {
|
|
@@ -647,7 +647,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
|
|
|
647
647
|
};
|
|
648
648
|
|
|
649
649
|
const fillLetters = (start, end, step = 1, options = {}) => {
|
|
650
|
-
if ((!isNumber
|
|
650
|
+
if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) {
|
|
651
651
|
return invalidRange(start, end, options);
|
|
652
652
|
}
|
|
653
653
|
|
|
@@ -680,7 +680,7 @@ const fillLetters = (start, end, step = 1, options = {}) => {
|
|
|
680
680
|
return range;
|
|
681
681
|
};
|
|
682
682
|
|
|
683
|
-
const fill = (start, end, step, options = {}) => {
|
|
683
|
+
const fill$2 = (start, end, step, options = {}) => {
|
|
684
684
|
if (end == null && isValidValue(start)) {
|
|
685
685
|
return [start];
|
|
686
686
|
}
|
|
@@ -690,37 +690,37 @@ const fill = (start, end, step, options = {}) => {
|
|
|
690
690
|
}
|
|
691
691
|
|
|
692
692
|
if (typeof step === 'function') {
|
|
693
|
-
return fill(start, end, 1, { transform: step });
|
|
693
|
+
return fill$2(start, end, 1, { transform: step });
|
|
694
694
|
}
|
|
695
695
|
|
|
696
|
-
if (isObject(step)) {
|
|
697
|
-
return fill(start, end, 0, step);
|
|
696
|
+
if (isObject$1(step)) {
|
|
697
|
+
return fill$2(start, end, 0, step);
|
|
698
698
|
}
|
|
699
699
|
|
|
700
700
|
let opts = { ...options };
|
|
701
701
|
if (opts.capture === true) opts.wrap = true;
|
|
702
702
|
step = step || opts.step || 1;
|
|
703
703
|
|
|
704
|
-
if (!isNumber
|
|
705
|
-
if (step != null && !isObject(step)) return invalidStep(step, opts);
|
|
706
|
-
return fill(start, end, 1, step);
|
|
704
|
+
if (!isNumber(step)) {
|
|
705
|
+
if (step != null && !isObject$1(step)) return invalidStep(step, opts);
|
|
706
|
+
return fill$2(start, end, 1, step);
|
|
707
707
|
}
|
|
708
708
|
|
|
709
|
-
if (isNumber
|
|
709
|
+
if (isNumber(start) && isNumber(end)) {
|
|
710
710
|
return fillNumbers(start, end, step, opts);
|
|
711
711
|
}
|
|
712
712
|
|
|
713
713
|
return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
|
|
714
714
|
};
|
|
715
715
|
|
|
716
|
-
var fillRange = fill;
|
|
716
|
+
var fillRange = fill$2;
|
|
717
717
|
|
|
718
718
|
const fill$1 = fillRange;
|
|
719
|
-
const utils$
|
|
719
|
+
const utils$6 = utils$8;
|
|
720
720
|
|
|
721
|
-
const compile = (ast, options = {}) => {
|
|
721
|
+
const compile$1 = (ast, options = {}) => {
|
|
722
722
|
let walk = (node, parent = {}) => {
|
|
723
|
-
let invalidBlock = utils$
|
|
723
|
+
let invalidBlock = utils$6.isInvalidBrace(parent);
|
|
724
724
|
let invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
725
725
|
let invalid = invalidBlock === true || invalidNode === true;
|
|
726
726
|
let prefix = options.escapeInvalid === true ? '\\' : '';
|
|
@@ -750,7 +750,7 @@ const compile = (ast, options = {}) => {
|
|
|
750
750
|
}
|
|
751
751
|
|
|
752
752
|
if (node.nodes && node.ranges > 0) {
|
|
753
|
-
let args = utils$
|
|
753
|
+
let args = utils$6.reduce(node.nodes);
|
|
754
754
|
let range = fill$1(...args, { ...options, wrap: false, toRegex: true });
|
|
755
755
|
|
|
756
756
|
if (range.length !== 0) {
|
|
@@ -769,11 +769,11 @@ const compile = (ast, options = {}) => {
|
|
|
769
769
|
return walk(ast);
|
|
770
770
|
};
|
|
771
771
|
|
|
772
|
-
var compile_1 = compile;
|
|
772
|
+
var compile_1 = compile$1;
|
|
773
773
|
|
|
774
|
-
const fill
|
|
775
|
-
const stringify$2 = stringify;
|
|
776
|
-
const utils$
|
|
774
|
+
const fill = fillRange;
|
|
775
|
+
const stringify$2 = stringify$4;
|
|
776
|
+
const utils$5 = utils$8;
|
|
777
777
|
|
|
778
778
|
const append = (queue = '', stash = '', enclose = false) => {
|
|
779
779
|
let result = [];
|
|
@@ -783,7 +783,7 @@ const append = (queue = '', stash = '', enclose = false) => {
|
|
|
783
783
|
|
|
784
784
|
if (!stash.length) return queue;
|
|
785
785
|
if (!queue.length) {
|
|
786
|
-
return enclose ? utils$
|
|
786
|
+
return enclose ? utils$5.flatten(stash).map(ele => `{${ele}}`) : stash;
|
|
787
787
|
}
|
|
788
788
|
|
|
789
789
|
for (let item of queue) {
|
|
@@ -798,10 +798,10 @@ const append = (queue = '', stash = '', enclose = false) => {
|
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
800
|
}
|
|
801
|
-
return utils$
|
|
801
|
+
return utils$5.flatten(result);
|
|
802
802
|
};
|
|
803
803
|
|
|
804
|
-
const expand = (ast, options = {}) => {
|
|
804
|
+
const expand$1 = (ast, options = {}) => {
|
|
805
805
|
let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit;
|
|
806
806
|
|
|
807
807
|
let walk = (node, parent = {}) => {
|
|
@@ -826,13 +826,13 @@ const expand = (ast, options = {}) => {
|
|
|
826
826
|
}
|
|
827
827
|
|
|
828
828
|
if (node.nodes && node.ranges > 0) {
|
|
829
|
-
let args = utils$
|
|
829
|
+
let args = utils$5.reduce(node.nodes);
|
|
830
830
|
|
|
831
|
-
if (utils$
|
|
831
|
+
if (utils$5.exceedsLimit(...args, options.step, rangeLimit)) {
|
|
832
832
|
throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
|
|
833
833
|
}
|
|
834
834
|
|
|
835
|
-
let range = fill
|
|
835
|
+
let range = fill(...args, options);
|
|
836
836
|
if (range.length === 0) {
|
|
837
837
|
range = stringify$2(node, options);
|
|
838
838
|
}
|
|
@@ -842,7 +842,7 @@ const expand = (ast, options = {}) => {
|
|
|
842
842
|
return;
|
|
843
843
|
}
|
|
844
844
|
|
|
845
|
-
let enclose = utils$
|
|
845
|
+
let enclose = utils$5.encloseBrace(node);
|
|
846
846
|
let queue = node.queue;
|
|
847
847
|
let block = node;
|
|
848
848
|
|
|
@@ -878,12 +878,12 @@ const expand = (ast, options = {}) => {
|
|
|
878
878
|
return queue;
|
|
879
879
|
};
|
|
880
880
|
|
|
881
|
-
return utils$
|
|
881
|
+
return utils$5.flatten(walk(ast));
|
|
882
882
|
};
|
|
883
883
|
|
|
884
|
-
var expand_1 = expand;
|
|
884
|
+
var expand_1 = expand$1;
|
|
885
885
|
|
|
886
|
-
var constants = {
|
|
886
|
+
var constants$4 = {
|
|
887
887
|
MAX_LENGTH: 1024 * 64,
|
|
888
888
|
|
|
889
889
|
// Digits
|
|
@@ -939,41 +939,41 @@ var constants = {
|
|
|
939
939
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */
|
|
940
940
|
};
|
|
941
941
|
|
|
942
|
-
const stringify$
|
|
942
|
+
const stringify$1 = stringify$4;
|
|
943
943
|
|
|
944
944
|
/**
|
|
945
945
|
* Constants
|
|
946
946
|
*/
|
|
947
947
|
|
|
948
948
|
const {
|
|
949
|
-
MAX_LENGTH,
|
|
949
|
+
MAX_LENGTH: MAX_LENGTH$1,
|
|
950
950
|
CHAR_BACKSLASH, /* \ */
|
|
951
951
|
CHAR_BACKTICK, /* ` */
|
|
952
|
-
CHAR_COMMA, /* , */
|
|
953
|
-
CHAR_DOT, /* . */
|
|
954
|
-
CHAR_LEFT_PARENTHESES, /* ( */
|
|
955
|
-
CHAR_RIGHT_PARENTHESES, /* ) */
|
|
956
|
-
CHAR_LEFT_CURLY_BRACE, /* { */
|
|
957
|
-
CHAR_RIGHT_CURLY_BRACE, /* } */
|
|
958
|
-
CHAR_LEFT_SQUARE_BRACKET, /* [ */
|
|
959
|
-
CHAR_RIGHT_SQUARE_BRACKET, /* ] */
|
|
952
|
+
CHAR_COMMA: CHAR_COMMA$1, /* , */
|
|
953
|
+
CHAR_DOT: CHAR_DOT$1, /* . */
|
|
954
|
+
CHAR_LEFT_PARENTHESES: CHAR_LEFT_PARENTHESES$1, /* ( */
|
|
955
|
+
CHAR_RIGHT_PARENTHESES: CHAR_RIGHT_PARENTHESES$1, /* ) */
|
|
956
|
+
CHAR_LEFT_CURLY_BRACE: CHAR_LEFT_CURLY_BRACE$1, /* { */
|
|
957
|
+
CHAR_RIGHT_CURLY_BRACE: CHAR_RIGHT_CURLY_BRACE$1, /* } */
|
|
958
|
+
CHAR_LEFT_SQUARE_BRACKET: CHAR_LEFT_SQUARE_BRACKET$1, /* [ */
|
|
959
|
+
CHAR_RIGHT_SQUARE_BRACKET: CHAR_RIGHT_SQUARE_BRACKET$1, /* ] */
|
|
960
960
|
CHAR_DOUBLE_QUOTE, /* " */
|
|
961
961
|
CHAR_SINGLE_QUOTE, /* ' */
|
|
962
962
|
CHAR_NO_BREAK_SPACE,
|
|
963
963
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE
|
|
964
|
-
} = constants;
|
|
964
|
+
} = constants$4;
|
|
965
965
|
|
|
966
966
|
/**
|
|
967
967
|
* parse
|
|
968
968
|
*/
|
|
969
969
|
|
|
970
|
-
const parse = (input, options = {}) => {
|
|
970
|
+
const parse$3 = (input, options = {}) => {
|
|
971
971
|
if (typeof input !== 'string') {
|
|
972
972
|
throw new TypeError('Expected a string');
|
|
973
973
|
}
|
|
974
974
|
|
|
975
975
|
let opts = options || {};
|
|
976
|
-
let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
976
|
+
let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
|
|
977
977
|
if (input.length > max) {
|
|
978
978
|
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
|
979
979
|
}
|
|
@@ -1037,7 +1037,7 @@ const parse = (input, options = {}) => {
|
|
|
1037
1037
|
* Right square bracket (literal): ']'
|
|
1038
1038
|
*/
|
|
1039
1039
|
|
|
1040
|
-
if (value === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
1040
|
+
if (value === CHAR_RIGHT_SQUARE_BRACKET$1) {
|
|
1041
1041
|
push({ type: 'text', value: '\\' + value });
|
|
1042
1042
|
continue;
|
|
1043
1043
|
}
|
|
@@ -1046,14 +1046,14 @@ const parse = (input, options = {}) => {
|
|
|
1046
1046
|
* Left square bracket: '['
|
|
1047
1047
|
*/
|
|
1048
1048
|
|
|
1049
|
-
if (value === CHAR_LEFT_SQUARE_BRACKET) {
|
|
1049
|
+
if (value === CHAR_LEFT_SQUARE_BRACKET$1) {
|
|
1050
1050
|
brackets++;
|
|
1051
1051
|
let next;
|
|
1052
1052
|
|
|
1053
1053
|
while (index < length && (next = advance())) {
|
|
1054
1054
|
value += next;
|
|
1055
1055
|
|
|
1056
|
-
if (next === CHAR_LEFT_SQUARE_BRACKET) {
|
|
1056
|
+
if (next === CHAR_LEFT_SQUARE_BRACKET$1) {
|
|
1057
1057
|
brackets++;
|
|
1058
1058
|
continue;
|
|
1059
1059
|
}
|
|
@@ -1063,7 +1063,7 @@ const parse = (input, options = {}) => {
|
|
|
1063
1063
|
continue;
|
|
1064
1064
|
}
|
|
1065
1065
|
|
|
1066
|
-
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
1066
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET$1) {
|
|
1067
1067
|
brackets--;
|
|
1068
1068
|
|
|
1069
1069
|
if (brackets === 0) {
|
|
@@ -1080,14 +1080,14 @@ const parse = (input, options = {}) => {
|
|
|
1080
1080
|
* Parentheses
|
|
1081
1081
|
*/
|
|
1082
1082
|
|
|
1083
|
-
if (value === CHAR_LEFT_PARENTHESES) {
|
|
1083
|
+
if (value === CHAR_LEFT_PARENTHESES$1) {
|
|
1084
1084
|
block = push({ type: 'paren', nodes: [] });
|
|
1085
1085
|
stack.push(block);
|
|
1086
1086
|
push({ type: 'text', value });
|
|
1087
1087
|
continue;
|
|
1088
1088
|
}
|
|
1089
1089
|
|
|
1090
|
-
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
1090
|
+
if (value === CHAR_RIGHT_PARENTHESES$1) {
|
|
1091
1091
|
if (block.type !== 'paren') {
|
|
1092
1092
|
push({ type: 'text', value });
|
|
1093
1093
|
continue;
|
|
@@ -1132,7 +1132,7 @@ const parse = (input, options = {}) => {
|
|
|
1132
1132
|
* Left curly brace: '{'
|
|
1133
1133
|
*/
|
|
1134
1134
|
|
|
1135
|
-
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
1135
|
+
if (value === CHAR_LEFT_CURLY_BRACE$1) {
|
|
1136
1136
|
depth++;
|
|
1137
1137
|
|
|
1138
1138
|
let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
|
|
@@ -1157,7 +1157,7 @@ const parse = (input, options = {}) => {
|
|
|
1157
1157
|
* Right curly brace: '}'
|
|
1158
1158
|
*/
|
|
1159
1159
|
|
|
1160
|
-
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
1160
|
+
if (value === CHAR_RIGHT_CURLY_BRACE$1) {
|
|
1161
1161
|
if (block.type !== 'brace') {
|
|
1162
1162
|
push({ type: 'text', value });
|
|
1163
1163
|
continue;
|
|
@@ -1178,11 +1178,11 @@ const parse = (input, options = {}) => {
|
|
|
1178
1178
|
* Comma: ','
|
|
1179
1179
|
*/
|
|
1180
1180
|
|
|
1181
|
-
if (value === CHAR_COMMA && depth > 0) {
|
|
1181
|
+
if (value === CHAR_COMMA$1 && depth > 0) {
|
|
1182
1182
|
if (block.ranges > 0) {
|
|
1183
1183
|
block.ranges = 0;
|
|
1184
1184
|
let open = block.nodes.shift();
|
|
1185
|
-
block.nodes = [open, { type: 'text', value: stringify$
|
|
1185
|
+
block.nodes = [open, { type: 'text', value: stringify$1(block) }];
|
|
1186
1186
|
}
|
|
1187
1187
|
|
|
1188
1188
|
push({ type: 'comma', value });
|
|
@@ -1194,7 +1194,7 @@ const parse = (input, options = {}) => {
|
|
|
1194
1194
|
* Dot: '.'
|
|
1195
1195
|
*/
|
|
1196
1196
|
|
|
1197
|
-
if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
|
|
1197
|
+
if (value === CHAR_DOT$1 && depth > 0 && block.commas === 0) {
|
|
1198
1198
|
let siblings = block.nodes;
|
|
1199
1199
|
|
|
1200
1200
|
if (depth === 0 || siblings.length === 0) {
|
|
@@ -1266,12 +1266,12 @@ const parse = (input, options = {}) => {
|
|
|
1266
1266
|
return ast;
|
|
1267
1267
|
};
|
|
1268
1268
|
|
|
1269
|
-
var parse_1 = parse;
|
|
1269
|
+
var parse_1$1 = parse$3;
|
|
1270
1270
|
|
|
1271
|
-
const stringify
|
|
1272
|
-
const compile
|
|
1273
|
-
const expand
|
|
1274
|
-
const parse$
|
|
1271
|
+
const stringify = stringify$4;
|
|
1272
|
+
const compile = compile_1;
|
|
1273
|
+
const expand = expand_1;
|
|
1274
|
+
const parse$2 = parse_1$1;
|
|
1275
1275
|
|
|
1276
1276
|
/**
|
|
1277
1277
|
* Expand the given pattern or create a regex-compatible string.
|
|
@@ -1287,12 +1287,12 @@ const parse$1 = parse_1;
|
|
|
1287
1287
|
* @api public
|
|
1288
1288
|
*/
|
|
1289
1289
|
|
|
1290
|
-
const braces = (input, options = {}) => {
|
|
1290
|
+
const braces$2 = (input, options = {}) => {
|
|
1291
1291
|
let output = [];
|
|
1292
1292
|
|
|
1293
1293
|
if (Array.isArray(input)) {
|
|
1294
1294
|
for (let pattern of input) {
|
|
1295
|
-
let result = braces.create(pattern, options);
|
|
1295
|
+
let result = braces$2.create(pattern, options);
|
|
1296
1296
|
if (Array.isArray(result)) {
|
|
1297
1297
|
output.push(...result);
|
|
1298
1298
|
} else {
|
|
@@ -1300,7 +1300,7 @@ const braces = (input, options = {}) => {
|
|
|
1300
1300
|
}
|
|
1301
1301
|
}
|
|
1302
1302
|
} else {
|
|
1303
|
-
output = [].concat(braces.create(input, options));
|
|
1303
|
+
output = [].concat(braces$2.create(input, options));
|
|
1304
1304
|
}
|
|
1305
1305
|
|
|
1306
1306
|
if (options && options.expand === true && options.nodupes === true) {
|
|
@@ -1323,7 +1323,7 @@ const braces = (input, options = {}) => {
|
|
|
1323
1323
|
* @api public
|
|
1324
1324
|
*/
|
|
1325
1325
|
|
|
1326
|
-
braces.parse = (input, options = {}) => parse$
|
|
1326
|
+
braces$2.parse = (input, options = {}) => parse$2(input, options);
|
|
1327
1327
|
|
|
1328
1328
|
/**
|
|
1329
1329
|
* Creates a braces string from an AST, or an AST node.
|
|
@@ -1339,11 +1339,11 @@ braces.parse = (input, options = {}) => parse$1(input, options);
|
|
|
1339
1339
|
* @api public
|
|
1340
1340
|
*/
|
|
1341
1341
|
|
|
1342
|
-
braces.stringify = (input, options = {}) => {
|
|
1342
|
+
braces$2.stringify = (input, options = {}) => {
|
|
1343
1343
|
if (typeof input === 'string') {
|
|
1344
|
-
return stringify
|
|
1344
|
+
return stringify(braces$2.parse(input, options), options);
|
|
1345
1345
|
}
|
|
1346
|
-
return stringify
|
|
1346
|
+
return stringify(input, options);
|
|
1347
1347
|
};
|
|
1348
1348
|
|
|
1349
1349
|
/**
|
|
@@ -1361,11 +1361,11 @@ braces.stringify = (input, options = {}) => {
|
|
|
1361
1361
|
* @api public
|
|
1362
1362
|
*/
|
|
1363
1363
|
|
|
1364
|
-
braces.compile = (input, options = {}) => {
|
|
1364
|
+
braces$2.compile = (input, options = {}) => {
|
|
1365
1365
|
if (typeof input === 'string') {
|
|
1366
|
-
input = braces.parse(input, options);
|
|
1366
|
+
input = braces$2.parse(input, options);
|
|
1367
1367
|
}
|
|
1368
|
-
return compile
|
|
1368
|
+
return compile(input, options);
|
|
1369
1369
|
};
|
|
1370
1370
|
|
|
1371
1371
|
/**
|
|
@@ -1385,12 +1385,12 @@ braces.compile = (input, options = {}) => {
|
|
|
1385
1385
|
* @api public
|
|
1386
1386
|
*/
|
|
1387
1387
|
|
|
1388
|
-
braces.expand = (input, options = {}) => {
|
|
1388
|
+
braces$2.expand = (input, options = {}) => {
|
|
1389
1389
|
if (typeof input === 'string') {
|
|
1390
|
-
input = braces.parse(input, options);
|
|
1390
|
+
input = braces$2.parse(input, options);
|
|
1391
1391
|
}
|
|
1392
1392
|
|
|
1393
|
-
let result = expand
|
|
1393
|
+
let result = expand(input, options);
|
|
1394
1394
|
|
|
1395
1395
|
// filter out empty strings if specified
|
|
1396
1396
|
if (options.noempty === true) {
|
|
@@ -1421,25 +1421,25 @@ braces.expand = (input, options = {}) => {
|
|
|
1421
1421
|
* @api public
|
|
1422
1422
|
*/
|
|
1423
1423
|
|
|
1424
|
-
braces.create = (input, options = {}) => {
|
|
1424
|
+
braces$2.create = (input, options = {}) => {
|
|
1425
1425
|
if (input === '' || input.length < 3) {
|
|
1426
1426
|
return [input];
|
|
1427
1427
|
}
|
|
1428
1428
|
|
|
1429
1429
|
return options.expand !== true
|
|
1430
|
-
? braces.compile(input, options)
|
|
1431
|
-
: braces.expand(input, options);
|
|
1430
|
+
? braces$2.compile(input, options)
|
|
1431
|
+
: braces$2.expand(input, options);
|
|
1432
1432
|
};
|
|
1433
1433
|
|
|
1434
1434
|
/**
|
|
1435
1435
|
* Expose "braces"
|
|
1436
1436
|
*/
|
|
1437
1437
|
|
|
1438
|
-
var braces_1 = braces;
|
|
1438
|
+
var braces_1 = braces$2;
|
|
1439
1439
|
|
|
1440
1440
|
var utils$4 = {};
|
|
1441
1441
|
|
|
1442
|
-
const path = require$$0$2;
|
|
1442
|
+
const path$2 = require$$0$2;
|
|
1443
1443
|
const WIN_SLASH = '\\\\/';
|
|
1444
1444
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
1445
1445
|
|
|
@@ -1461,7 +1461,7 @@ const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
|
|
1461
1461
|
const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
|
1462
1462
|
const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
|
1463
1463
|
const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
|
1464
|
-
const STAR = `${QMARK}*?`;
|
|
1464
|
+
const STAR$1 = `${QMARK}*?`;
|
|
1465
1465
|
|
|
1466
1466
|
const POSIX_CHARS = {
|
|
1467
1467
|
DOT_LITERAL,
|
|
@@ -1477,7 +1477,7 @@ const POSIX_CHARS = {
|
|
|
1477
1477
|
NO_DOT_SLASH,
|
|
1478
1478
|
NO_DOTS_SLASH,
|
|
1479
1479
|
QMARK_NO_DOT,
|
|
1480
|
-
STAR,
|
|
1480
|
+
STAR: STAR$1,
|
|
1481
1481
|
START_ANCHOR
|
|
1482
1482
|
};
|
|
1483
1483
|
|
|
@@ -1505,7 +1505,7 @@ const WINDOWS_CHARS = {
|
|
|
1505
1505
|
* POSIX Bracket Regex
|
|
1506
1506
|
*/
|
|
1507
1507
|
|
|
1508
|
-
const POSIX_REGEX_SOURCE = {
|
|
1508
|
+
const POSIX_REGEX_SOURCE$1 = {
|
|
1509
1509
|
alnum: 'a-zA-Z0-9',
|
|
1510
1510
|
alpha: 'a-zA-Z',
|
|
1511
1511
|
ascii: '\\x00-\\x7F',
|
|
@@ -1522,9 +1522,9 @@ const POSIX_REGEX_SOURCE = {
|
|
|
1522
1522
|
xdigit: 'A-Fa-f0-9'
|
|
1523
1523
|
};
|
|
1524
1524
|
|
|
1525
|
-
var constants$
|
|
1525
|
+
var constants$3 = {
|
|
1526
1526
|
MAX_LENGTH: 1024 * 64,
|
|
1527
|
-
POSIX_REGEX_SOURCE,
|
|
1527
|
+
POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1,
|
|
1528
1528
|
|
|
1529
1529
|
// regular expressions
|
|
1530
1530
|
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
@@ -1592,7 +1592,7 @@ var constants$1 = {
|
|
|
1592
1592
|
CHAR_VERTICAL_LINE: 124, /* | */
|
|
1593
1593
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
|
|
1594
1594
|
|
|
1595
|
-
SEP: path.sep,
|
|
1595
|
+
SEP: path$2.sep,
|
|
1596
1596
|
|
|
1597
1597
|
/**
|
|
1598
1598
|
* Create EXTGLOB_CHARS
|
|
@@ -1626,7 +1626,7 @@ const {
|
|
|
1626
1626
|
REGEX_REMOVE_BACKSLASH,
|
|
1627
1627
|
REGEX_SPECIAL_CHARS,
|
|
1628
1628
|
REGEX_SPECIAL_CHARS_GLOBAL
|
|
1629
|
-
} = constants$
|
|
1629
|
+
} = constants$3;
|
|
1630
1630
|
|
|
1631
1631
|
exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
|
1632
1632
|
exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
|
|
@@ -1683,24 +1683,24 @@ exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
|
1683
1683
|
};
|
|
1684
1684
|
}(utils$4));
|
|
1685
1685
|
|
|
1686
|
-
const utils$
|
|
1686
|
+
const utils$3 = utils$4;
|
|
1687
1687
|
const {
|
|
1688
1688
|
CHAR_ASTERISK, /* * */
|
|
1689
1689
|
CHAR_AT, /* @ */
|
|
1690
1690
|
CHAR_BACKWARD_SLASH, /* \ */
|
|
1691
|
-
CHAR_COMMA
|
|
1692
|
-
CHAR_DOT
|
|
1691
|
+
CHAR_COMMA, /* , */
|
|
1692
|
+
CHAR_DOT, /* . */
|
|
1693
1693
|
CHAR_EXCLAMATION_MARK, /* ! */
|
|
1694
1694
|
CHAR_FORWARD_SLASH, /* / */
|
|
1695
|
-
CHAR_LEFT_CURLY_BRACE
|
|
1696
|
-
CHAR_LEFT_PARENTHESES
|
|
1697
|
-
CHAR_LEFT_SQUARE_BRACKET
|
|
1695
|
+
CHAR_LEFT_CURLY_BRACE, /* { */
|
|
1696
|
+
CHAR_LEFT_PARENTHESES, /* ( */
|
|
1697
|
+
CHAR_LEFT_SQUARE_BRACKET, /* [ */
|
|
1698
1698
|
CHAR_PLUS, /* + */
|
|
1699
1699
|
CHAR_QUESTION_MARK, /* ? */
|
|
1700
|
-
CHAR_RIGHT_CURLY_BRACE
|
|
1701
|
-
CHAR_RIGHT_PARENTHESES
|
|
1702
|
-
CHAR_RIGHT_SQUARE_BRACKET
|
|
1703
|
-
} = constants$
|
|
1700
|
+
CHAR_RIGHT_CURLY_BRACE, /* } */
|
|
1701
|
+
CHAR_RIGHT_PARENTHESES, /* ) */
|
|
1702
|
+
CHAR_RIGHT_SQUARE_BRACKET /* ] */
|
|
1703
|
+
} = constants$3;
|
|
1704
1704
|
|
|
1705
1705
|
const isPathSeparator = code => {
|
|
1706
1706
|
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
@@ -1728,7 +1728,7 @@ const depth = token => {
|
|
|
1728
1728
|
* @api public
|
|
1729
1729
|
*/
|
|
1730
1730
|
|
|
1731
|
-
const scan = (input, options) => {
|
|
1731
|
+
const scan$1 = (input, options) => {
|
|
1732
1732
|
const opts = options || {};
|
|
1733
1733
|
|
|
1734
1734
|
const length = input.length - 1;
|
|
@@ -1770,13 +1770,13 @@ const scan = (input, options) => {
|
|
|
1770
1770
|
backslashes = token.backslashes = true;
|
|
1771
1771
|
code = advance();
|
|
1772
1772
|
|
|
1773
|
-
if (code === CHAR_LEFT_CURLY_BRACE
|
|
1773
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
1774
1774
|
braceEscaped = true;
|
|
1775
1775
|
}
|
|
1776
1776
|
continue;
|
|
1777
1777
|
}
|
|
1778
1778
|
|
|
1779
|
-
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE
|
|
1779
|
+
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
|
1780
1780
|
braces++;
|
|
1781
1781
|
|
|
1782
1782
|
while (eos() !== true && (code = advance())) {
|
|
@@ -1786,12 +1786,12 @@ const scan = (input, options) => {
|
|
|
1786
1786
|
continue;
|
|
1787
1787
|
}
|
|
1788
1788
|
|
|
1789
|
-
if (code === CHAR_LEFT_CURLY_BRACE
|
|
1789
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
1790
1790
|
braces++;
|
|
1791
1791
|
continue;
|
|
1792
1792
|
}
|
|
1793
1793
|
|
|
1794
|
-
if (braceEscaped !== true && code === CHAR_DOT
|
|
1794
|
+
if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
1795
1795
|
isBrace = token.isBrace = true;
|
|
1796
1796
|
isGlob = token.isGlob = true;
|
|
1797
1797
|
finished = true;
|
|
@@ -1803,7 +1803,7 @@ const scan = (input, options) => {
|
|
|
1803
1803
|
break;
|
|
1804
1804
|
}
|
|
1805
1805
|
|
|
1806
|
-
if (braceEscaped !== true && code === CHAR_COMMA
|
|
1806
|
+
if (braceEscaped !== true && code === CHAR_COMMA) {
|
|
1807
1807
|
isBrace = token.isBrace = true;
|
|
1808
1808
|
isGlob = token.isGlob = true;
|
|
1809
1809
|
finished = true;
|
|
@@ -1815,7 +1815,7 @@ const scan = (input, options) => {
|
|
|
1815
1815
|
break;
|
|
1816
1816
|
}
|
|
1817
1817
|
|
|
1818
|
-
if (code === CHAR_RIGHT_CURLY_BRACE
|
|
1818
|
+
if (code === CHAR_RIGHT_CURLY_BRACE) {
|
|
1819
1819
|
braces--;
|
|
1820
1820
|
|
|
1821
1821
|
if (braces === 0) {
|
|
@@ -1840,7 +1840,7 @@ const scan = (input, options) => {
|
|
|
1840
1840
|
token = { value: '', depth: 0, isGlob: false };
|
|
1841
1841
|
|
|
1842
1842
|
if (finished === true) continue;
|
|
1843
|
-
if (prev === CHAR_DOT
|
|
1843
|
+
if (prev === CHAR_DOT && index === (start + 1)) {
|
|
1844
1844
|
start += 2;
|
|
1845
1845
|
continue;
|
|
1846
1846
|
}
|
|
@@ -1856,7 +1856,7 @@ const scan = (input, options) => {
|
|
|
1856
1856
|
|| code === CHAR_QUESTION_MARK
|
|
1857
1857
|
|| code === CHAR_EXCLAMATION_MARK;
|
|
1858
1858
|
|
|
1859
|
-
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES
|
|
1859
|
+
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
1860
1860
|
isGlob = token.isGlob = true;
|
|
1861
1861
|
isExtglob = token.isExtglob = true;
|
|
1862
1862
|
finished = true;
|
|
@@ -1869,7 +1869,7 @@ const scan = (input, options) => {
|
|
|
1869
1869
|
continue;
|
|
1870
1870
|
}
|
|
1871
1871
|
|
|
1872
|
-
if (code === CHAR_RIGHT_PARENTHESES
|
|
1872
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
1873
1873
|
isGlob = token.isGlob = true;
|
|
1874
1874
|
finished = true;
|
|
1875
1875
|
break;
|
|
@@ -1902,7 +1902,7 @@ const scan = (input, options) => {
|
|
|
1902
1902
|
break;
|
|
1903
1903
|
}
|
|
1904
1904
|
|
|
1905
|
-
if (code === CHAR_LEFT_SQUARE_BRACKET
|
|
1905
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
1906
1906
|
while (eos() !== true && (next = advance())) {
|
|
1907
1907
|
if (next === CHAR_BACKWARD_SLASH) {
|
|
1908
1908
|
backslashes = token.backslashes = true;
|
|
@@ -1910,7 +1910,7 @@ const scan = (input, options) => {
|
|
|
1910
1910
|
continue;
|
|
1911
1911
|
}
|
|
1912
1912
|
|
|
1913
|
-
if (next === CHAR_RIGHT_SQUARE_BRACKET
|
|
1913
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
1914
1914
|
isBracket = token.isBracket = true;
|
|
1915
1915
|
isGlob = token.isGlob = true;
|
|
1916
1916
|
finished = true;
|
|
@@ -1929,18 +1929,18 @@ const scan = (input, options) => {
|
|
|
1929
1929
|
continue;
|
|
1930
1930
|
}
|
|
1931
1931
|
|
|
1932
|
-
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES
|
|
1932
|
+
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
1933
1933
|
isGlob = token.isGlob = true;
|
|
1934
1934
|
|
|
1935
1935
|
if (scanToEnd === true) {
|
|
1936
1936
|
while (eos() !== true && (code = advance())) {
|
|
1937
|
-
if (code === CHAR_LEFT_PARENTHESES
|
|
1937
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
1938
1938
|
backslashes = token.backslashes = true;
|
|
1939
1939
|
code = advance();
|
|
1940
1940
|
continue;
|
|
1941
1941
|
}
|
|
1942
1942
|
|
|
1943
|
-
if (code === CHAR_RIGHT_PARENTHESES
|
|
1943
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
1944
1944
|
finished = true;
|
|
1945
1945
|
break;
|
|
1946
1946
|
}
|
|
@@ -1993,10 +1993,10 @@ const scan = (input, options) => {
|
|
|
1993
1993
|
}
|
|
1994
1994
|
|
|
1995
1995
|
if (opts.unescape === true) {
|
|
1996
|
-
if (glob) glob = utils$
|
|
1996
|
+
if (glob) glob = utils$3.removeBackslashes(glob);
|
|
1997
1997
|
|
|
1998
1998
|
if (base && backslashes === true) {
|
|
1999
|
-
base = utils$
|
|
1999
|
+
base = utils$3.removeBackslashes(base);
|
|
2000
2000
|
}
|
|
2001
2001
|
}
|
|
2002
2002
|
|
|
@@ -2063,18 +2063,18 @@ const scan = (input, options) => {
|
|
|
2063
2063
|
return state;
|
|
2064
2064
|
};
|
|
2065
2065
|
|
|
2066
|
-
var scan_1 = scan;
|
|
2066
|
+
var scan_1 = scan$1;
|
|
2067
2067
|
|
|
2068
|
-
const constants$2 = constants$
|
|
2069
|
-
const utils$
|
|
2068
|
+
const constants$2 = constants$3;
|
|
2069
|
+
const utils$2 = utils$4;
|
|
2070
2070
|
|
|
2071
2071
|
/**
|
|
2072
2072
|
* Constants
|
|
2073
2073
|
*/
|
|
2074
2074
|
|
|
2075
2075
|
const {
|
|
2076
|
-
MAX_LENGTH
|
|
2077
|
-
POSIX_REGEX_SOURCE
|
|
2076
|
+
MAX_LENGTH,
|
|
2077
|
+
POSIX_REGEX_SOURCE,
|
|
2078
2078
|
REGEX_NON_SPECIAL_CHARS,
|
|
2079
2079
|
REGEX_SPECIAL_CHARS_BACKREF,
|
|
2080
2080
|
REPLACEMENTS
|
|
@@ -2110,7 +2110,7 @@ const syntaxError = (type, char) => {
|
|
|
2110
2110
|
* @return {Object}
|
|
2111
2111
|
*/
|
|
2112
2112
|
|
|
2113
|
-
const parse$
|
|
2113
|
+
const parse$1 = (input, options) => {
|
|
2114
2114
|
if (typeof input !== 'string') {
|
|
2115
2115
|
throw new TypeError('Expected a string');
|
|
2116
2116
|
}
|
|
@@ -2118,7 +2118,7 @@ const parse$2 = (input, options) => {
|
|
|
2118
2118
|
input = REPLACEMENTS[input] || input;
|
|
2119
2119
|
|
|
2120
2120
|
const opts = { ...options };
|
|
2121
|
-
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH
|
|
2121
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
2122
2122
|
|
|
2123
2123
|
let len = input.length;
|
|
2124
2124
|
if (len > max) {
|
|
@@ -2129,7 +2129,7 @@ const parse$2 = (input, options) => {
|
|
|
2129
2129
|
const tokens = [bos];
|
|
2130
2130
|
|
|
2131
2131
|
const capture = opts.capture ? '' : '?:';
|
|
2132
|
-
const win32 = utils$
|
|
2132
|
+
const win32 = utils$2.isWindows(options);
|
|
2133
2133
|
|
|
2134
2134
|
// create constants based on platform, for windows or posix
|
|
2135
2135
|
const PLATFORM_CHARS = constants$2.globChars(win32);
|
|
@@ -2185,7 +2185,7 @@ const parse$2 = (input, options) => {
|
|
|
2185
2185
|
tokens
|
|
2186
2186
|
};
|
|
2187
2187
|
|
|
2188
|
-
input = utils$
|
|
2188
|
+
input = utils$2.removePrefix(input, state);
|
|
2189
2189
|
len = input.length;
|
|
2190
2190
|
|
|
2191
2191
|
const extglobs = [];
|
|
@@ -2365,7 +2365,7 @@ const parse$2 = (input, options) => {
|
|
|
2365
2365
|
return state;
|
|
2366
2366
|
}
|
|
2367
2367
|
|
|
2368
|
-
state.output = utils$
|
|
2368
|
+
state.output = utils$2.wrapOutput(output, state, options);
|
|
2369
2369
|
return state;
|
|
2370
2370
|
}
|
|
2371
2371
|
|
|
@@ -2440,7 +2440,7 @@ const parse$2 = (input, options) => {
|
|
|
2440
2440
|
const idx = prev.value.lastIndexOf('[');
|
|
2441
2441
|
const pre = prev.value.slice(0, idx);
|
|
2442
2442
|
const rest = prev.value.slice(idx + 2);
|
|
2443
|
-
const posix = POSIX_REGEX_SOURCE
|
|
2443
|
+
const posix = POSIX_REGEX_SOURCE[rest];
|
|
2444
2444
|
if (posix) {
|
|
2445
2445
|
prev.value = pre + posix;
|
|
2446
2446
|
state.backtrack = true;
|
|
@@ -2478,7 +2478,7 @@ const parse$2 = (input, options) => {
|
|
|
2478
2478
|
*/
|
|
2479
2479
|
|
|
2480
2480
|
if (state.quotes === 1 && value !== '"') {
|
|
2481
|
-
value = utils$
|
|
2481
|
+
value = utils$2.escapeRegex(value);
|
|
2482
2482
|
prev.value += value;
|
|
2483
2483
|
append({ value });
|
|
2484
2484
|
continue;
|
|
@@ -2568,11 +2568,11 @@ const parse$2 = (input, options) => {
|
|
|
2568
2568
|
|
|
2569
2569
|
// when literal brackets are explicitly disabled
|
|
2570
2570
|
// assume we should match with a regex character class
|
|
2571
|
-
if (opts.literalBrackets === false || utils$
|
|
2571
|
+
if (opts.literalBrackets === false || utils$2.hasRegexChars(prevValue)) {
|
|
2572
2572
|
continue;
|
|
2573
2573
|
}
|
|
2574
2574
|
|
|
2575
|
-
const escaped = utils$
|
|
2575
|
+
const escaped = utils$2.escapeRegex(prev.value);
|
|
2576
2576
|
state.output = state.output.slice(0, -prev.value.length);
|
|
2577
2577
|
|
|
2578
2578
|
// when literal brackets are explicitly enabled
|
|
@@ -2744,7 +2744,7 @@ const parse$2 = (input, options) => {
|
|
|
2744
2744
|
const next = peek();
|
|
2745
2745
|
let output = value;
|
|
2746
2746
|
|
|
2747
|
-
if (next === '<' && !utils$
|
|
2747
|
+
if (next === '<' && !utils$2.supportsLookbehinds()) {
|
|
2748
2748
|
throw new Error('Node.js v10 or higher is required for regex lookbehinds');
|
|
2749
2749
|
}
|
|
2750
2750
|
|
|
@@ -3004,19 +3004,19 @@ const parse$2 = (input, options) => {
|
|
|
3004
3004
|
|
|
3005
3005
|
while (state.brackets > 0) {
|
|
3006
3006
|
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
|
|
3007
|
-
state.output = utils$
|
|
3007
|
+
state.output = utils$2.escapeLast(state.output, '[');
|
|
3008
3008
|
decrement('brackets');
|
|
3009
3009
|
}
|
|
3010
3010
|
|
|
3011
3011
|
while (state.parens > 0) {
|
|
3012
3012
|
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
|
|
3013
|
-
state.output = utils$
|
|
3013
|
+
state.output = utils$2.escapeLast(state.output, '(');
|
|
3014
3014
|
decrement('parens');
|
|
3015
3015
|
}
|
|
3016
3016
|
|
|
3017
3017
|
while (state.braces > 0) {
|
|
3018
3018
|
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
|
|
3019
|
-
state.output = utils$
|
|
3019
|
+
state.output = utils$2.escapeLast(state.output, '{');
|
|
3020
3020
|
decrement('braces');
|
|
3021
3021
|
}
|
|
3022
3022
|
|
|
@@ -3046,16 +3046,16 @@ const parse$2 = (input, options) => {
|
|
|
3046
3046
|
* impact when none of the fast paths match.
|
|
3047
3047
|
*/
|
|
3048
3048
|
|
|
3049
|
-
parse$
|
|
3049
|
+
parse$1.fastpaths = (input, options) => {
|
|
3050
3050
|
const opts = { ...options };
|
|
3051
|
-
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH
|
|
3051
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
3052
3052
|
const len = input.length;
|
|
3053
3053
|
if (len > max) {
|
|
3054
3054
|
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
3055
3055
|
}
|
|
3056
3056
|
|
|
3057
3057
|
input = REPLACEMENTS[input] || input;
|
|
3058
|
-
const win32 = utils$
|
|
3058
|
+
const win32 = utils$2.isWindows(options);
|
|
3059
3059
|
|
|
3060
3060
|
// create constants based on platform, for windows or posix
|
|
3061
3061
|
const {
|
|
@@ -3123,7 +3123,7 @@ parse$2.fastpaths = (input, options) => {
|
|
|
3123
3123
|
}
|
|
3124
3124
|
};
|
|
3125
3125
|
|
|
3126
|
-
const output = utils$
|
|
3126
|
+
const output = utils$2.removePrefix(input, state);
|
|
3127
3127
|
let source = create(output);
|
|
3128
3128
|
|
|
3129
3129
|
if (source && opts.strictSlashes !== true) {
|
|
@@ -3133,14 +3133,14 @@ parse$2.fastpaths = (input, options) => {
|
|
|
3133
3133
|
return source;
|
|
3134
3134
|
};
|
|
3135
3135
|
|
|
3136
|
-
var parse_1
|
|
3136
|
+
var parse_1 = parse$1;
|
|
3137
3137
|
|
|
3138
3138
|
const path$1 = require$$0$2;
|
|
3139
|
-
const scan
|
|
3140
|
-
const parse
|
|
3141
|
-
const utils$
|
|
3142
|
-
const constants$
|
|
3143
|
-
const isObject
|
|
3139
|
+
const scan = scan_1;
|
|
3140
|
+
const parse = parse_1;
|
|
3141
|
+
const utils$1 = utils$4;
|
|
3142
|
+
const constants$1 = constants$3;
|
|
3143
|
+
const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
|
|
3144
3144
|
|
|
3145
3145
|
/**
|
|
3146
3146
|
* Creates a matcher function from one or more glob patterns. The
|
|
@@ -3164,9 +3164,9 @@ const isObject$1 = val => val && typeof val === 'object' && !Array.isArray(val);
|
|
|
3164
3164
|
* @api public
|
|
3165
3165
|
*/
|
|
3166
3166
|
|
|
3167
|
-
const picomatch = (glob, options, returnState = false) => {
|
|
3167
|
+
const picomatch$4 = (glob, options, returnState = false) => {
|
|
3168
3168
|
if (Array.isArray(glob)) {
|
|
3169
|
-
const fns = glob.map(input => picomatch(input, options, returnState));
|
|
3169
|
+
const fns = glob.map(input => picomatch$4(input, options, returnState));
|
|
3170
3170
|
const arrayMatcher = str => {
|
|
3171
3171
|
for (const isMatch of fns) {
|
|
3172
3172
|
const state = isMatch(str);
|
|
@@ -3177,17 +3177,17 @@ const picomatch = (glob, options, returnState = false) => {
|
|
|
3177
3177
|
return arrayMatcher;
|
|
3178
3178
|
}
|
|
3179
3179
|
|
|
3180
|
-
const isState = isObject
|
|
3180
|
+
const isState = isObject(glob) && glob.tokens && glob.input;
|
|
3181
3181
|
|
|
3182
3182
|
if (glob === '' || (typeof glob !== 'string' && !isState)) {
|
|
3183
3183
|
throw new TypeError('Expected pattern to be a non-empty string');
|
|
3184
3184
|
}
|
|
3185
3185
|
|
|
3186
3186
|
const opts = options || {};
|
|
3187
|
-
const posix = utils$
|
|
3187
|
+
const posix = utils$1.isWindows(options);
|
|
3188
3188
|
const regex = isState
|
|
3189
|
-
? picomatch.compileRe(glob, options)
|
|
3190
|
-
: picomatch.makeRe(glob, options, false, true);
|
|
3189
|
+
? picomatch$4.compileRe(glob, options)
|
|
3190
|
+
: picomatch$4.makeRe(glob, options, false, true);
|
|
3191
3191
|
|
|
3192
3192
|
const state = regex.state;
|
|
3193
3193
|
delete regex.state;
|
|
@@ -3195,11 +3195,11 @@ const picomatch = (glob, options, returnState = false) => {
|
|
|
3195
3195
|
let isIgnored = () => false;
|
|
3196
3196
|
if (opts.ignore) {
|
|
3197
3197
|
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
3198
|
-
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
3198
|
+
isIgnored = picomatch$4(opts.ignore, ignoreOpts, returnState);
|
|
3199
3199
|
}
|
|
3200
3200
|
|
|
3201
3201
|
const matcher = (input, returnObject = false) => {
|
|
3202
|
-
const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
|
|
3202
|
+
const { isMatch, match, output } = picomatch$4.test(input, regex, options, { glob, posix });
|
|
3203
3203
|
const result = { glob, state, regex, posix, input, output, match, isMatch };
|
|
3204
3204
|
|
|
3205
3205
|
if (typeof opts.onResult === 'function') {
|
|
@@ -3249,7 +3249,7 @@ const picomatch = (glob, options, returnState = false) => {
|
|
|
3249
3249
|
* @api public
|
|
3250
3250
|
*/
|
|
3251
3251
|
|
|
3252
|
-
picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
3252
|
+
picomatch$4.test = (input, regex, options, { glob, posix } = {}) => {
|
|
3253
3253
|
if (typeof input !== 'string') {
|
|
3254
3254
|
throw new TypeError('Expected input to be a string');
|
|
3255
3255
|
}
|
|
@@ -3259,7 +3259,7 @@ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
|
3259
3259
|
}
|
|
3260
3260
|
|
|
3261
3261
|
const opts = options || {};
|
|
3262
|
-
const format = opts.format || (posix ? utils$
|
|
3262
|
+
const format = opts.format || (posix ? utils$1.toPosixSlashes : null);
|
|
3263
3263
|
let match = input === glob;
|
|
3264
3264
|
let output = (match && format) ? format(input) : input;
|
|
3265
3265
|
|
|
@@ -3270,7 +3270,7 @@ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
|
3270
3270
|
|
|
3271
3271
|
if (match === false || opts.capture === true) {
|
|
3272
3272
|
if (opts.matchBase === true || opts.basename === true) {
|
|
3273
|
-
match = picomatch.matchBase(input, regex, options, posix);
|
|
3273
|
+
match = picomatch$4.matchBase(input, regex, options, posix);
|
|
3274
3274
|
} else {
|
|
3275
3275
|
match = regex.exec(output);
|
|
3276
3276
|
}
|
|
@@ -3293,8 +3293,8 @@ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
|
3293
3293
|
* @api public
|
|
3294
3294
|
*/
|
|
3295
3295
|
|
|
3296
|
-
picomatch.matchBase = (input, glob, options, posix = utils$
|
|
3297
|
-
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
3296
|
+
picomatch$4.matchBase = (input, glob, options, posix = utils$1.isWindows(options)) => {
|
|
3297
|
+
const regex = glob instanceof RegExp ? glob : picomatch$4.makeRe(glob, options);
|
|
3298
3298
|
return regex.test(path$1.basename(input));
|
|
3299
3299
|
};
|
|
3300
3300
|
|
|
@@ -3315,7 +3315,7 @@ picomatch.matchBase = (input, glob, options, posix = utils$7.isWindows(options))
|
|
|
3315
3315
|
* @api public
|
|
3316
3316
|
*/
|
|
3317
3317
|
|
|
3318
|
-
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
3318
|
+
picomatch$4.isMatch = (str, patterns, options) => picomatch$4(patterns, options)(str);
|
|
3319
3319
|
|
|
3320
3320
|
/**
|
|
3321
3321
|
* Parse a glob pattern to create the source string for a regular
|
|
@@ -3331,9 +3331,9 @@ picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str
|
|
|
3331
3331
|
* @api public
|
|
3332
3332
|
*/
|
|
3333
3333
|
|
|
3334
|
-
picomatch.parse = (pattern, options) => {
|
|
3335
|
-
if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));
|
|
3336
|
-
return parse
|
|
3334
|
+
picomatch$4.parse = (pattern, options) => {
|
|
3335
|
+
if (Array.isArray(pattern)) return pattern.map(p => picomatch$4.parse(p, options));
|
|
3336
|
+
return parse(pattern, { ...options, fastpaths: false });
|
|
3337
3337
|
};
|
|
3338
3338
|
|
|
3339
3339
|
/**
|
|
@@ -3363,7 +3363,7 @@ picomatch.parse = (pattern, options) => {
|
|
|
3363
3363
|
* @api public
|
|
3364
3364
|
*/
|
|
3365
3365
|
|
|
3366
|
-
picomatch.scan = (input, options) => scan
|
|
3366
|
+
picomatch$4.scan = (input, options) => scan(input, options);
|
|
3367
3367
|
|
|
3368
3368
|
/**
|
|
3369
3369
|
* Create a regular expression from a parsed glob pattern.
|
|
@@ -3382,7 +3382,7 @@ picomatch.scan = (input, options) => scan$1(input, options);
|
|
|
3382
3382
|
* @api public
|
|
3383
3383
|
*/
|
|
3384
3384
|
|
|
3385
|
-
picomatch.compileRe = (parsed, options, returnOutput = false, returnState = false) => {
|
|
3385
|
+
picomatch$4.compileRe = (parsed, options, returnOutput = false, returnState = false) => {
|
|
3386
3386
|
if (returnOutput === true) {
|
|
3387
3387
|
return parsed.output;
|
|
3388
3388
|
}
|
|
@@ -3396,7 +3396,7 @@ picomatch.compileRe = (parsed, options, returnOutput = false, returnState = fals
|
|
|
3396
3396
|
source = `^(?!${source}).*$`;
|
|
3397
3397
|
}
|
|
3398
3398
|
|
|
3399
|
-
const regex = picomatch.toRegex(source, options);
|
|
3399
|
+
const regex = picomatch$4.toRegex(source, options);
|
|
3400
3400
|
if (returnState === true) {
|
|
3401
3401
|
regex.state = parsed;
|
|
3402
3402
|
}
|
|
@@ -3404,7 +3404,7 @@ picomatch.compileRe = (parsed, options, returnOutput = false, returnState = fals
|
|
|
3404
3404
|
return regex;
|
|
3405
3405
|
};
|
|
3406
3406
|
|
|
3407
|
-
picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => {
|
|
3407
|
+
picomatch$4.makeRe = (input, options, returnOutput = false, returnState = false) => {
|
|
3408
3408
|
if (!input || typeof input !== 'string') {
|
|
3409
3409
|
throw new TypeError('Expected a non-empty string');
|
|
3410
3410
|
}
|
|
@@ -3420,17 +3420,17 @@ picomatch.makeRe = (input, options, returnOutput = false, returnState = false) =
|
|
|
3420
3420
|
}
|
|
3421
3421
|
|
|
3422
3422
|
if (opts.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
|
|
3423
|
-
output = parse
|
|
3423
|
+
output = parse.fastpaths(input, options);
|
|
3424
3424
|
}
|
|
3425
3425
|
|
|
3426
3426
|
if (output === undefined) {
|
|
3427
|
-
parsed = parse
|
|
3427
|
+
parsed = parse(input, options);
|
|
3428
3428
|
parsed.prefix = prefix + (parsed.prefix || '');
|
|
3429
3429
|
} else {
|
|
3430
3430
|
parsed.output = output;
|
|
3431
3431
|
}
|
|
3432
3432
|
|
|
3433
|
-
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
3433
|
+
return picomatch$4.compileRe(parsed, options, returnOutput, returnState);
|
|
3434
3434
|
};
|
|
3435
3435
|
|
|
3436
3436
|
/**
|
|
@@ -3450,7 +3450,7 @@ picomatch.makeRe = (input, options, returnOutput = false, returnState = false) =
|
|
|
3450
3450
|
* @api public
|
|
3451
3451
|
*/
|
|
3452
3452
|
|
|
3453
|
-
picomatch.toRegex = (source, options) => {
|
|
3453
|
+
picomatch$4.toRegex = (source, options) => {
|
|
3454
3454
|
try {
|
|
3455
3455
|
const opts = options || {};
|
|
3456
3456
|
return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
|
|
@@ -3465,20 +3465,20 @@ picomatch.toRegex = (source, options) => {
|
|
|
3465
3465
|
* @return {Object}
|
|
3466
3466
|
*/
|
|
3467
3467
|
|
|
3468
|
-
picomatch.constants = constants$
|
|
3468
|
+
picomatch$4.constants = constants$1;
|
|
3469
3469
|
|
|
3470
3470
|
/**
|
|
3471
3471
|
* Expose "picomatch"
|
|
3472
3472
|
*/
|
|
3473
3473
|
|
|
3474
|
-
var picomatch_1 = picomatch;
|
|
3474
|
+
var picomatch_1 = picomatch$4;
|
|
3475
3475
|
|
|
3476
|
-
var picomatch$
|
|
3476
|
+
var picomatch$3 = picomatch_1;
|
|
3477
3477
|
|
|
3478
|
-
const util
|
|
3478
|
+
const util = require$$0$1;
|
|
3479
3479
|
const braces$1 = braces_1;
|
|
3480
|
-
const picomatch$2 = picomatch$
|
|
3481
|
-
const utils
|
|
3480
|
+
const picomatch$2 = picomatch$3;
|
|
3481
|
+
const utils = utils$4;
|
|
3482
3482
|
const isEmptyString = val => typeof val === 'string' && (val === '' || val === './');
|
|
3483
3483
|
|
|
3484
3484
|
/**
|
|
@@ -3662,7 +3662,7 @@ micromatch.not = (list, patterns, options = {}) => {
|
|
|
3662
3662
|
|
|
3663
3663
|
micromatch.contains = (str, pattern, options) => {
|
|
3664
3664
|
if (typeof str !== 'string') {
|
|
3665
|
-
throw new TypeError(`Expected a string: "${util
|
|
3665
|
+
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
3666
3666
|
}
|
|
3667
3667
|
|
|
3668
3668
|
if (Array.isArray(pattern)) {
|
|
@@ -3703,7 +3703,7 @@ micromatch.contains = (str, pattern, options) => {
|
|
|
3703
3703
|
*/
|
|
3704
3704
|
|
|
3705
3705
|
micromatch.matchKeys = (obj, patterns, options) => {
|
|
3706
|
-
if (!utils
|
|
3706
|
+
if (!utils.isObject(obj)) {
|
|
3707
3707
|
throw new TypeError('Expected the first argument to be an object');
|
|
3708
3708
|
}
|
|
3709
3709
|
let keys = micromatch(Object.keys(obj), patterns, options);
|
|
@@ -3808,7 +3808,7 @@ micromatch.every = (list, patterns, options) => {
|
|
|
3808
3808
|
|
|
3809
3809
|
micromatch.all = (str, patterns, options) => {
|
|
3810
3810
|
if (typeof str !== 'string') {
|
|
3811
|
-
throw new TypeError(`Expected a string: "${util
|
|
3811
|
+
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
3812
3812
|
}
|
|
3813
3813
|
|
|
3814
3814
|
return [].concat(patterns).every(p => picomatch$2(p, options)(str));
|
|
@@ -3834,9 +3834,9 @@ micromatch.all = (str, patterns, options) => {
|
|
|
3834
3834
|
*/
|
|
3835
3835
|
|
|
3836
3836
|
micromatch.capture = (glob, input, options) => {
|
|
3837
|
-
let posix = utils
|
|
3837
|
+
let posix = utils.isWindows(options);
|
|
3838
3838
|
let regex = picomatch$2.makeRe(String(glob), { ...options, capture: true });
|
|
3839
|
-
let match = regex.exec(posix ? utils
|
|
3839
|
+
let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
|
|
3840
3840
|
|
|
3841
3841
|
if (match) {
|
|
3842
3842
|
return match.slice(1).map(v => v === void 0 ? '' : v);
|
|
@@ -4144,16 +4144,16 @@ function mergeOutputOptions(config, overrides, warn) {
|
|
|
4144
4144
|
|
|
4145
4145
|
var chokidar = {};
|
|
4146
4146
|
|
|
4147
|
-
const fs = fs$4;
|
|
4147
|
+
const fs$3 = fs$4;
|
|
4148
4148
|
const { Readable } = require$$1;
|
|
4149
|
-
const sysPath = require$$0$2;
|
|
4150
|
-
const { promisify } = require$$0$1;
|
|
4151
|
-
const picomatch$
|
|
4149
|
+
const sysPath$3 = require$$0$2;
|
|
4150
|
+
const { promisify: promisify$3 } = require$$0$1;
|
|
4151
|
+
const picomatch$1 = picomatch$3;
|
|
4152
4152
|
|
|
4153
|
-
const readdir = promisify(fs.readdir);
|
|
4154
|
-
const stat = promisify(fs.stat);
|
|
4155
|
-
const lstat = promisify(fs.lstat);
|
|
4156
|
-
const realpath = promisify(fs.realpath);
|
|
4153
|
+
const readdir$1 = promisify$3(fs$3.readdir);
|
|
4154
|
+
const stat$3 = promisify$3(fs$3.stat);
|
|
4155
|
+
const lstat$2 = promisify$3(fs$3.lstat);
|
|
4156
|
+
const realpath$1 = promisify$3(fs$3.realpath);
|
|
4157
4157
|
|
|
4158
4158
|
/**
|
|
4159
4159
|
* @typedef {Object} EntryInfo
|
|
@@ -4164,7 +4164,7 @@ const realpath = promisify(fs.realpath);
|
|
|
4164
4164
|
* @property {String} basename
|
|
4165
4165
|
*/
|
|
4166
4166
|
|
|
4167
|
-
const BANG = '!';
|
|
4167
|
+
const BANG$2 = '!';
|
|
4168
4168
|
const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP']);
|
|
4169
4169
|
const FILE_TYPE = 'files';
|
|
4170
4170
|
const DIR_TYPE = 'directories';
|
|
@@ -4179,7 +4179,7 @@ const normalizeFilter = filter => {
|
|
|
4179
4179
|
if (typeof filter === 'function') return filter;
|
|
4180
4180
|
|
|
4181
4181
|
if (typeof filter === 'string') {
|
|
4182
|
-
const glob = picomatch$
|
|
4182
|
+
const glob = picomatch$1(filter.trim());
|
|
4183
4183
|
return entry => glob(entry.basename);
|
|
4184
4184
|
}
|
|
4185
4185
|
|
|
@@ -4188,10 +4188,10 @@ const normalizeFilter = filter => {
|
|
|
4188
4188
|
const negative = [];
|
|
4189
4189
|
for (const item of filter) {
|
|
4190
4190
|
const trimmed = item.trim();
|
|
4191
|
-
if (trimmed.charAt(0) === BANG) {
|
|
4192
|
-
negative.push(picomatch$
|
|
4191
|
+
if (trimmed.charAt(0) === BANG$2) {
|
|
4192
|
+
negative.push(picomatch$1(trimmed.slice(1)));
|
|
4193
4193
|
} else {
|
|
4194
|
-
positive.push(picomatch$
|
|
4194
|
+
positive.push(picomatch$1(trimmed));
|
|
4195
4195
|
}
|
|
4196
4196
|
}
|
|
4197
4197
|
|
|
@@ -4233,9 +4233,9 @@ class ReaddirpStream extends Readable {
|
|
|
4233
4233
|
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
4234
4234
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
4235
4235
|
|
|
4236
|
-
const statMethod = opts.lstat ? lstat : stat;
|
|
4236
|
+
const statMethod = opts.lstat ? lstat$2 : stat$3;
|
|
4237
4237
|
// Use bigint stats if it's windows and stat() supports options (node 10+).
|
|
4238
|
-
if (process.platform === 'win32' && stat.length === 3) {
|
|
4238
|
+
if (process.platform === 'win32' && stat$3.length === 3) {
|
|
4239
4239
|
this._stat = path => statMethod(path, { bigint: true });
|
|
4240
4240
|
} else {
|
|
4241
4241
|
this._stat = statMethod;
|
|
@@ -4245,8 +4245,8 @@ class ReaddirpStream extends Readable {
|
|
|
4245
4245
|
this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
|
|
4246
4246
|
this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
|
|
4247
4247
|
this._wantsEverything = type === EVERYTHING_TYPE;
|
|
4248
|
-
this._root = sysPath.resolve(root);
|
|
4249
|
-
this._isDirent = ('Dirent' in fs) && !opts.alwaysStat;
|
|
4248
|
+
this._root = sysPath$3.resolve(root);
|
|
4249
|
+
this._isDirent = ('Dirent' in fs$3) && !opts.alwaysStat;
|
|
4250
4250
|
this._statsProp = this._isDirent ? 'dirent' : 'stats';
|
|
4251
4251
|
this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent };
|
|
4252
4252
|
|
|
@@ -4306,7 +4306,7 @@ class ReaddirpStream extends Readable {
|
|
|
4306
4306
|
async _exploreDir(path, depth) {
|
|
4307
4307
|
let files;
|
|
4308
4308
|
try {
|
|
4309
|
-
files = await readdir(path, this._rdOptions);
|
|
4309
|
+
files = await readdir$1(path, this._rdOptions);
|
|
4310
4310
|
} catch (error) {
|
|
4311
4311
|
this._onError(error);
|
|
4312
4312
|
}
|
|
@@ -4317,8 +4317,8 @@ class ReaddirpStream extends Readable {
|
|
|
4317
4317
|
let entry;
|
|
4318
4318
|
try {
|
|
4319
4319
|
const basename = this._isDirent ? dirent.name : dirent;
|
|
4320
|
-
const fullPath = sysPath.resolve(sysPath.join(path, basename));
|
|
4321
|
-
entry = {path: sysPath.relative(this._root, fullPath), fullPath, basename};
|
|
4320
|
+
const fullPath = sysPath$3.resolve(sysPath$3.join(path, basename));
|
|
4321
|
+
entry = {path: sysPath$3.relative(this._root, fullPath), fullPath, basename};
|
|
4322
4322
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
4323
4323
|
} catch (err) {
|
|
4324
4324
|
this._onError(err);
|
|
@@ -4350,14 +4350,14 @@ class ReaddirpStream extends Readable {
|
|
|
4350
4350
|
if (stats && stats.isSymbolicLink()) {
|
|
4351
4351
|
const full = entry.fullPath;
|
|
4352
4352
|
try {
|
|
4353
|
-
const entryRealPath = await realpath(full);
|
|
4354
|
-
const entryRealPathStats = await lstat(entryRealPath);
|
|
4353
|
+
const entryRealPath = await realpath$1(full);
|
|
4354
|
+
const entryRealPathStats = await lstat$2(entryRealPath);
|
|
4355
4355
|
if (entryRealPathStats.isFile()) {
|
|
4356
4356
|
return 'file';
|
|
4357
4357
|
}
|
|
4358
4358
|
if (entryRealPathStats.isDirectory()) {
|
|
4359
4359
|
const len = entryRealPath.length;
|
|
4360
|
-
if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) {
|
|
4360
|
+
if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath$3.sep) {
|
|
4361
4361
|
return this._onError(new Error(
|
|
4362
4362
|
`Circular symlink detected: "${full}" points to "${entryRealPath}"`
|
|
4363
4363
|
));
|
|
@@ -4393,7 +4393,7 @@ class ReaddirpStream extends Readable {
|
|
|
4393
4393
|
* @param {String} root Root directory
|
|
4394
4394
|
* @param {ReaddirpArguments=} options Options to specify root (start directory), filters and recursion depth
|
|
4395
4395
|
*/
|
|
4396
|
-
const readdirp = (root, options = {}) => {
|
|
4396
|
+
const readdirp$1 = (root, options = {}) => {
|
|
4397
4397
|
let type = options.entryType || options.type;
|
|
4398
4398
|
if (type === 'both') type = FILE_DIR_TYPE; // backwards-compatibility
|
|
4399
4399
|
if (type) options.type = type;
|
|
@@ -4412,20 +4412,20 @@ const readdirp = (root, options = {}) => {
|
|
|
4412
4412
|
const readdirpPromise = (root, options = {}) => {
|
|
4413
4413
|
return new Promise((resolve, reject) => {
|
|
4414
4414
|
const files = [];
|
|
4415
|
-
readdirp(root, options)
|
|
4415
|
+
readdirp$1(root, options)
|
|
4416
4416
|
.on('data', entry => files.push(entry))
|
|
4417
4417
|
.on('end', () => resolve(files))
|
|
4418
4418
|
.on('error', error => reject(error));
|
|
4419
4419
|
});
|
|
4420
4420
|
};
|
|
4421
4421
|
|
|
4422
|
-
readdirp.promise = readdirpPromise;
|
|
4423
|
-
readdirp.ReaddirpStream = ReaddirpStream;
|
|
4424
|
-
readdirp.default = readdirp;
|
|
4422
|
+
readdirp$1.promise = readdirpPromise;
|
|
4423
|
+
readdirp$1.ReaddirpStream = ReaddirpStream;
|
|
4424
|
+
readdirp$1.default = readdirp$1;
|
|
4425
4425
|
|
|
4426
|
-
var readdirp_1 = readdirp;
|
|
4426
|
+
var readdirp_1 = readdirp$1;
|
|
4427
4427
|
|
|
4428
|
-
var anymatch = {exports: {}};
|
|
4428
|
+
var anymatch$2 = {exports: {}};
|
|
4429
4429
|
|
|
4430
4430
|
/*!
|
|
4431
4431
|
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
|
@@ -4434,7 +4434,7 @@ var anymatch = {exports: {}};
|
|
|
4434
4434
|
* Released under the MIT License.
|
|
4435
4435
|
*/
|
|
4436
4436
|
|
|
4437
|
-
var normalizePath = function(path, stripTrailing) {
|
|
4437
|
+
var normalizePath$2 = function(path, stripTrailing) {
|
|
4438
4438
|
if (typeof path !== 'string') {
|
|
4439
4439
|
throw new TypeError('expected path to be a string');
|
|
4440
4440
|
}
|
|
@@ -4463,10 +4463,10 @@ var normalizePath = function(path, stripTrailing) {
|
|
|
4463
4463
|
return prefix + segs.join('/');
|
|
4464
4464
|
};
|
|
4465
4465
|
|
|
4466
|
-
Object.defineProperty(anymatch.exports, "__esModule", { value: true });
|
|
4466
|
+
Object.defineProperty(anymatch$2.exports, "__esModule", { value: true });
|
|
4467
4467
|
|
|
4468
|
-
const picomatch
|
|
4469
|
-
const normalizePath$1 = normalizePath;
|
|
4468
|
+
const picomatch = picomatch$3;
|
|
4469
|
+
const normalizePath$1 = normalizePath$2;
|
|
4470
4470
|
|
|
4471
4471
|
/**
|
|
4472
4472
|
* @typedef {(testString: string) => boolean} AnymatchFn
|
|
@@ -4475,7 +4475,7 @@ const normalizePath$1 = normalizePath;
|
|
|
4475
4475
|
*/
|
|
4476
4476
|
const BANG$1 = '!';
|
|
4477
4477
|
const DEFAULT_OPTIONS = {returnIndex: false};
|
|
4478
|
-
const arrify = (item) => Array.isArray(item) ? item : [item];
|
|
4478
|
+
const arrify$1 = (item) => Array.isArray(item) ? item : [item];
|
|
4479
4479
|
|
|
4480
4480
|
/**
|
|
4481
4481
|
* @param {AnymatchPattern} matcher
|
|
@@ -4487,7 +4487,7 @@ const createPattern = (matcher, options) => {
|
|
|
4487
4487
|
return matcher;
|
|
4488
4488
|
}
|
|
4489
4489
|
if (typeof matcher === 'string') {
|
|
4490
|
-
const glob = picomatch
|
|
4490
|
+
const glob = picomatch(matcher, options);
|
|
4491
4491
|
return (string) => matcher === string || glob(string);
|
|
4492
4492
|
}
|
|
4493
4493
|
if (matcher instanceof RegExp) {
|
|
@@ -4544,11 +4544,11 @@ const anymatch$1 = (matchers, testString, options = DEFAULT_OPTIONS) => {
|
|
|
4544
4544
|
const returnIndex = opts.returnIndex || false;
|
|
4545
4545
|
|
|
4546
4546
|
// Early cache for matchers.
|
|
4547
|
-
const mtchers = arrify(matchers);
|
|
4547
|
+
const mtchers = arrify$1(matchers);
|
|
4548
4548
|
const negatedGlobs = mtchers
|
|
4549
4549
|
.filter(item => typeof item === 'string' && item.charAt(0) === BANG$1)
|
|
4550
4550
|
.map(item => item.slice(1))
|
|
4551
|
-
.map(item => picomatch
|
|
4551
|
+
.map(item => picomatch(item, opts));
|
|
4552
4552
|
const patterns = mtchers.map(matcher => createPattern(matcher, opts));
|
|
4553
4553
|
|
|
4554
4554
|
if (testString == null) {
|
|
@@ -4562,7 +4562,7 @@ const anymatch$1 = (matchers, testString, options = DEFAULT_OPTIONS) => {
|
|
|
4562
4562
|
};
|
|
4563
4563
|
|
|
4564
4564
|
anymatch$1.default = anymatch$1;
|
|
4565
|
-
anymatch.exports = anymatch$1;
|
|
4565
|
+
anymatch$2.exports = anymatch$1;
|
|
4566
4566
|
|
|
4567
4567
|
/*!
|
|
4568
4568
|
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
@@ -4571,7 +4571,7 @@ anymatch.exports = anymatch$1;
|
|
|
4571
4571
|
* Licensed under the MIT License.
|
|
4572
4572
|
*/
|
|
4573
4573
|
|
|
4574
|
-
var isExtglob = function isExtglob(str) {
|
|
4574
|
+
var isExtglob$1 = function isExtglob(str) {
|
|
4575
4575
|
if (typeof str !== 'string' || str === '') {
|
|
4576
4576
|
return false;
|
|
4577
4577
|
}
|
|
@@ -4592,17 +4592,17 @@ var isExtglob = function isExtglob(str) {
|
|
|
4592
4592
|
* Released under the MIT License.
|
|
4593
4593
|
*/
|
|
4594
4594
|
|
|
4595
|
-
var isExtglob
|
|
4595
|
+
var isExtglob = isExtglob$1;
|
|
4596
4596
|
var chars = { '{': '}', '(': ')', '[': ']'};
|
|
4597
4597
|
var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
|
|
4598
4598
|
var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/;
|
|
4599
4599
|
|
|
4600
|
-
var isGlob = function isGlob(str, options) {
|
|
4600
|
+
var isGlob$2 = function isGlob(str, options) {
|
|
4601
4601
|
if (typeof str !== 'string' || str === '') {
|
|
4602
4602
|
return false;
|
|
4603
4603
|
}
|
|
4604
4604
|
|
|
4605
|
-
if (isExtglob
|
|
4605
|
+
if (isExtglob(str)) {
|
|
4606
4606
|
return true;
|
|
4607
4607
|
}
|
|
4608
4608
|
|
|
@@ -4634,7 +4634,7 @@ var isGlob = function isGlob(str, options) {
|
|
|
4634
4634
|
return false;
|
|
4635
4635
|
};
|
|
4636
4636
|
|
|
4637
|
-
var isGlob$1 = isGlob;
|
|
4637
|
+
var isGlob$1 = isGlob$2;
|
|
4638
4638
|
var pathPosixDirname = require$$0$2.posix.dirname;
|
|
4639
4639
|
var isWin32 = require$$2.platform() === 'win32';
|
|
4640
4640
|
|
|
@@ -4649,7 +4649,7 @@ var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
|
|
|
4649
4649
|
* @param {Object} opts
|
|
4650
4650
|
* @param {boolean} [opts.flipBackslashes=true]
|
|
4651
4651
|
*/
|
|
4652
|
-
var globParent = function globParent(str, opts) {
|
|
4652
|
+
var globParent$1 = function globParent(str, opts) {
|
|
4653
4653
|
var options = Object.assign({ flipBackslashes: true }, opts);
|
|
4654
4654
|
|
|
4655
4655
|
// flip windows path separators
|
|
@@ -4935,16 +4935,16 @@ var require$$0 = [
|
|
|
4935
4935
|
"zipx"
|
|
4936
4936
|
];
|
|
4937
4937
|
|
|
4938
|
-
var binaryExtensions = require$$0;
|
|
4938
|
+
var binaryExtensions$1 = require$$0;
|
|
4939
4939
|
|
|
4940
|
-
const path
|
|
4941
|
-
const binaryExtensions
|
|
4940
|
+
const path = require$$0$2;
|
|
4941
|
+
const binaryExtensions = binaryExtensions$1;
|
|
4942
4942
|
|
|
4943
|
-
const extensions = new Set(binaryExtensions
|
|
4943
|
+
const extensions = new Set(binaryExtensions);
|
|
4944
4944
|
|
|
4945
|
-
var isBinaryPath = filePath => extensions.has(path
|
|
4945
|
+
var isBinaryPath$1 = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase());
|
|
4946
4946
|
|
|
4947
|
-
var constants
|
|
4947
|
+
var constants = {};
|
|
4948
4948
|
|
|
4949
4949
|
(function (exports) {
|
|
4950
4950
|
|
|
@@ -5009,40 +5009,40 @@ exports.IDENTITY_FN = val => val;
|
|
|
5009
5009
|
exports.isWindows = platform === 'win32';
|
|
5010
5010
|
exports.isMacos = platform === 'darwin';
|
|
5011
5011
|
exports.isLinux = platform === 'linux';
|
|
5012
|
-
}(constants
|
|
5012
|
+
}(constants));
|
|
5013
5013
|
|
|
5014
|
-
const fs$
|
|
5015
|
-
const sysPath$
|
|
5016
|
-
const { promisify: promisify$
|
|
5017
|
-
const isBinaryPath
|
|
5014
|
+
const fs$2 = fs$4;
|
|
5015
|
+
const sysPath$2 = require$$0$2;
|
|
5016
|
+
const { promisify: promisify$2 } = require$$0$1;
|
|
5017
|
+
const isBinaryPath = isBinaryPath$1;
|
|
5018
5018
|
const {
|
|
5019
|
-
isWindows,
|
|
5019
|
+
isWindows: isWindows$1,
|
|
5020
5020
|
isLinux,
|
|
5021
|
-
EMPTY_FN,
|
|
5022
|
-
EMPTY_STR,
|
|
5021
|
+
EMPTY_FN: EMPTY_FN$2,
|
|
5022
|
+
EMPTY_STR: EMPTY_STR$1,
|
|
5023
5023
|
KEY_LISTENERS,
|
|
5024
5024
|
KEY_ERR,
|
|
5025
5025
|
KEY_RAW,
|
|
5026
5026
|
HANDLER_KEYS,
|
|
5027
|
-
EV_CHANGE,
|
|
5028
|
-
EV_ADD,
|
|
5029
|
-
EV_ADD_DIR,
|
|
5030
|
-
EV_ERROR,
|
|
5031
|
-
STR_DATA,
|
|
5032
|
-
STR_END,
|
|
5033
|
-
BRACE_START,
|
|
5034
|
-
STAR
|
|
5035
|
-
} = constants
|
|
5027
|
+
EV_CHANGE: EV_CHANGE$2,
|
|
5028
|
+
EV_ADD: EV_ADD$2,
|
|
5029
|
+
EV_ADD_DIR: EV_ADD_DIR$2,
|
|
5030
|
+
EV_ERROR: EV_ERROR$2,
|
|
5031
|
+
STR_DATA: STR_DATA$1,
|
|
5032
|
+
STR_END: STR_END$2,
|
|
5033
|
+
BRACE_START: BRACE_START$1,
|
|
5034
|
+
STAR
|
|
5035
|
+
} = constants;
|
|
5036
5036
|
|
|
5037
5037
|
const THROTTLE_MODE_WATCH = 'watch';
|
|
5038
5038
|
|
|
5039
|
-
const open = promisify$
|
|
5040
|
-
const stat$
|
|
5041
|
-
const lstat$1 = promisify$
|
|
5042
|
-
const close = promisify$
|
|
5043
|
-
const fsrealpath = promisify$
|
|
5039
|
+
const open = promisify$2(fs$2.open);
|
|
5040
|
+
const stat$2 = promisify$2(fs$2.stat);
|
|
5041
|
+
const lstat$1 = promisify$2(fs$2.lstat);
|
|
5042
|
+
const close = promisify$2(fs$2.close);
|
|
5043
|
+
const fsrealpath = promisify$2(fs$2.realpath);
|
|
5044
5044
|
|
|
5045
|
-
const statMethods = { lstat: lstat$1, stat: stat$
|
|
5045
|
+
const statMethods$1 = { lstat: lstat$1, stat: stat$2 };
|
|
5046
5046
|
|
|
5047
5047
|
// TODO: emit errors properly. Example: EMFILE on Macos.
|
|
5048
5048
|
const foreach = (val, fn) => {
|
|
@@ -5122,12 +5122,12 @@ function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
|
|
|
5122
5122
|
// case the file's watcher misses it (and rely on throttling to de-dupe)
|
|
5123
5123
|
if (evPath && path !== evPath) {
|
|
5124
5124
|
fsWatchBroadcast(
|
|
5125
|
-
sysPath$
|
|
5125
|
+
sysPath$2.resolve(path, evPath), KEY_LISTENERS, sysPath$2.join(path, evPath)
|
|
5126
5126
|
);
|
|
5127
5127
|
}
|
|
5128
5128
|
};
|
|
5129
5129
|
try {
|
|
5130
|
-
return fs$
|
|
5130
|
+
return fs$2.watch(path, options, handleEvent);
|
|
5131
5131
|
} catch (error) {
|
|
5132
5132
|
errHandler(error);
|
|
5133
5133
|
}
|
|
@@ -5182,11 +5182,11 @@ const setFsWatchListener = (path, fullPath, options, handlers) => {
|
|
|
5182
5182
|
fsWatchBroadcast.bind(null, fullPath, KEY_RAW)
|
|
5183
5183
|
);
|
|
5184
5184
|
if (!watcher) return;
|
|
5185
|
-
watcher.on(EV_ERROR, async (error) => {
|
|
5185
|
+
watcher.on(EV_ERROR$2, async (error) => {
|
|
5186
5186
|
const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
|
|
5187
5187
|
cont.watcherUnusable = true; // documented since Node 10.4.1
|
|
5188
5188
|
// Workaround for https://github.com/joyent/node/issues/4337
|
|
5189
|
-
if (isWindows && error.code === 'EPERM') {
|
|
5189
|
+
if (isWindows$1 && error.code === 'EPERM') {
|
|
5190
5190
|
try {
|
|
5191
5191
|
const fd = await open(path, 'r');
|
|
5192
5192
|
await close(fd);
|
|
@@ -5246,7 +5246,7 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
|
|
|
5246
5246
|
|
|
5247
5247
|
const copts = cont && cont.options;
|
|
5248
5248
|
if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
|
|
5249
|
-
fs$
|
|
5249
|
+
fs$2.unwatchFile(fullPath);
|
|
5250
5250
|
cont = undefined;
|
|
5251
5251
|
}
|
|
5252
5252
|
|
|
@@ -5263,9 +5263,9 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
|
|
|
5263
5263
|
listeners: listener,
|
|
5264
5264
|
rawEmitters: rawEmitter,
|
|
5265
5265
|
options,
|
|
5266
|
-
watcher: fs$
|
|
5266
|
+
watcher: fs$2.watchFile(fullPath, options, (curr, prev) => {
|
|
5267
5267
|
foreach(cont.rawEmitters, (rawEmitter) => {
|
|
5268
|
-
rawEmitter(EV_CHANGE, fullPath, {curr, prev});
|
|
5268
|
+
rawEmitter(EV_CHANGE$2, fullPath, {curr, prev});
|
|
5269
5269
|
});
|
|
5270
5270
|
const currmtime = curr.mtimeMs;
|
|
5271
5271
|
if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
|
|
@@ -5284,7 +5284,7 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
|
|
|
5284
5284
|
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
5285
5285
|
if (isEmptySet(cont.listeners)) {
|
|
5286
5286
|
FsWatchFileInstances.delete(fullPath);
|
|
5287
|
-
fs$
|
|
5287
|
+
fs$2.unwatchFile(fullPath);
|
|
5288
5288
|
cont.options = cont.watcher = undefined;
|
|
5289
5289
|
Object.freeze(cont);
|
|
5290
5290
|
}
|
|
@@ -5294,7 +5294,7 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
|
|
|
5294
5294
|
/**
|
|
5295
5295
|
* @mixin
|
|
5296
5296
|
*/
|
|
5297
|
-
class NodeFsHandler {
|
|
5297
|
+
class NodeFsHandler$1 {
|
|
5298
5298
|
|
|
5299
5299
|
/**
|
|
5300
5300
|
* @param {import("../index").FSWatcher} fsW
|
|
@@ -5312,17 +5312,17 @@ constructor(fsW) {
|
|
|
5312
5312
|
*/
|
|
5313
5313
|
_watchWithNodeFs(path, listener) {
|
|
5314
5314
|
const opts = this.fsw.options;
|
|
5315
|
-
const directory = sysPath$
|
|
5316
|
-
const basename = sysPath$
|
|
5315
|
+
const directory = sysPath$2.dirname(path);
|
|
5316
|
+
const basename = sysPath$2.basename(path);
|
|
5317
5317
|
const parent = this.fsw._getWatchedDir(directory);
|
|
5318
5318
|
parent.add(basename);
|
|
5319
|
-
const absolutePath = sysPath$
|
|
5319
|
+
const absolutePath = sysPath$2.resolve(path);
|
|
5320
5320
|
const options = {persistent: opts.persistent};
|
|
5321
|
-
if (!listener) listener = EMPTY_FN;
|
|
5321
|
+
if (!listener) listener = EMPTY_FN$2;
|
|
5322
5322
|
|
|
5323
5323
|
let closer;
|
|
5324
5324
|
if (opts.usePolling) {
|
|
5325
|
-
options.interval = opts.enableBinaryInterval && isBinaryPath
|
|
5325
|
+
options.interval = opts.enableBinaryInterval && isBinaryPath(basename) ?
|
|
5326
5326
|
opts.binaryInterval : opts.interval;
|
|
5327
5327
|
closer = setFsWatchFileListener(path, absolutePath, options, {
|
|
5328
5328
|
listener,
|
|
@@ -5349,8 +5349,8 @@ _handleFile(file, stats, initialAdd) {
|
|
|
5349
5349
|
if (this.fsw.closed) {
|
|
5350
5350
|
return;
|
|
5351
5351
|
}
|
|
5352
|
-
const dirname = sysPath$
|
|
5353
|
-
const basename = sysPath$
|
|
5352
|
+
const dirname = sysPath$2.dirname(file);
|
|
5353
|
+
const basename = sysPath$2.basename(file);
|
|
5354
5354
|
const parent = this.fsw._getWatchedDir(dirname);
|
|
5355
5355
|
// stats is always present
|
|
5356
5356
|
let prevStats = stats;
|
|
@@ -5362,13 +5362,13 @@ _handleFile(file, stats, initialAdd) {
|
|
|
5362
5362
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return;
|
|
5363
5363
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
5364
5364
|
try {
|
|
5365
|
-
const newStats = await stat$
|
|
5365
|
+
const newStats = await stat$2(file);
|
|
5366
5366
|
if (this.fsw.closed) return;
|
|
5367
5367
|
// Check that change event was not fired because of changed only accessTime.
|
|
5368
5368
|
const at = newStats.atimeMs;
|
|
5369
5369
|
const mt = newStats.mtimeMs;
|
|
5370
5370
|
if (!at || at <= mt || mt !== prevStats.mtimeMs) {
|
|
5371
|
-
this.fsw._emit(EV_CHANGE, file, newStats);
|
|
5371
|
+
this.fsw._emit(EV_CHANGE$2, file, newStats);
|
|
5372
5372
|
}
|
|
5373
5373
|
if (isLinux && prevStats.ino !== newStats.ino) {
|
|
5374
5374
|
this.fsw._closeFile(path);
|
|
@@ -5387,7 +5387,7 @@ _handleFile(file, stats, initialAdd) {
|
|
|
5387
5387
|
const at = newStats.atimeMs;
|
|
5388
5388
|
const mt = newStats.mtimeMs;
|
|
5389
5389
|
if (!at || at <= mt || mt !== prevStats.mtimeMs) {
|
|
5390
|
-
this.fsw._emit(EV_CHANGE, file, newStats);
|
|
5390
|
+
this.fsw._emit(EV_CHANGE$2, file, newStats);
|
|
5391
5391
|
}
|
|
5392
5392
|
prevStats = newStats;
|
|
5393
5393
|
}
|
|
@@ -5397,8 +5397,8 @@ _handleFile(file, stats, initialAdd) {
|
|
|
5397
5397
|
|
|
5398
5398
|
// emit an add event if we're supposed to
|
|
5399
5399
|
if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) {
|
|
5400
|
-
if (!this.fsw._throttle(EV_ADD, file, 0)) return;
|
|
5401
|
-
this.fsw._emit(EV_ADD, file, stats);
|
|
5400
|
+
if (!this.fsw._throttle(EV_ADD$2, file, 0)) return;
|
|
5401
|
+
this.fsw._emit(EV_ADD$2, file, stats);
|
|
5402
5402
|
}
|
|
5403
5403
|
|
|
5404
5404
|
return closer;
|
|
@@ -5427,12 +5427,12 @@ async _handleSymlink(entry, directory, path, item) {
|
|
|
5427
5427
|
if (dir.has(item)) {
|
|
5428
5428
|
if (this.fsw._symlinkPaths.get(full) !== linkPath) {
|
|
5429
5429
|
this.fsw._symlinkPaths.set(full, linkPath);
|
|
5430
|
-
this.fsw._emit(EV_CHANGE, path, entry.stats);
|
|
5430
|
+
this.fsw._emit(EV_CHANGE$2, path, entry.stats);
|
|
5431
5431
|
}
|
|
5432
5432
|
} else {
|
|
5433
5433
|
dir.add(item);
|
|
5434
5434
|
this.fsw._symlinkPaths.set(full, linkPath);
|
|
5435
|
-
this.fsw._emit(EV_ADD, path, entry.stats);
|
|
5435
|
+
this.fsw._emit(EV_ADD$2, path, entry.stats);
|
|
5436
5436
|
}
|
|
5437
5437
|
this.fsw._emitReady();
|
|
5438
5438
|
return true;
|
|
@@ -5448,7 +5448,7 @@ async _handleSymlink(entry, directory, path, item) {
|
|
|
5448
5448
|
|
|
5449
5449
|
_handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
5450
5450
|
// Normalize the directory name on Windows
|
|
5451
|
-
directory = sysPath$
|
|
5451
|
+
directory = sysPath$2.join(directory, EMPTY_STR$1);
|
|
5452
5452
|
|
|
5453
5453
|
if (!wh.hasGlob) {
|
|
5454
5454
|
throttler = this.fsw._throttle('readdir', directory, 1000);
|
|
@@ -5462,13 +5462,13 @@ _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
|
5462
5462
|
fileFilter: entry => wh.filterPath(entry),
|
|
5463
5463
|
directoryFilter: entry => wh.filterDir(entry),
|
|
5464
5464
|
depth: 0
|
|
5465
|
-
}).on(STR_DATA, async (entry) => {
|
|
5465
|
+
}).on(STR_DATA$1, async (entry) => {
|
|
5466
5466
|
if (this.fsw.closed) {
|
|
5467
5467
|
stream = undefined;
|
|
5468
5468
|
return;
|
|
5469
5469
|
}
|
|
5470
5470
|
const item = entry.path;
|
|
5471
|
-
let path = sysPath$
|
|
5471
|
+
let path = sysPath$2.join(directory, item);
|
|
5472
5472
|
current.add(item);
|
|
5473
5473
|
|
|
5474
5474
|
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) {
|
|
@@ -5486,14 +5486,14 @@ _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
|
5486
5486
|
this.fsw._incrReadyCount();
|
|
5487
5487
|
|
|
5488
5488
|
// ensure relativeness of path is preserved in case of watcher reuse
|
|
5489
|
-
path = sysPath$
|
|
5489
|
+
path = sysPath$2.join(dir, sysPath$2.relative(dir, path));
|
|
5490
5490
|
|
|
5491
5491
|
this._addToNodeFs(path, initialAdd, wh, depth + 1);
|
|
5492
5492
|
}
|
|
5493
|
-
}).on(EV_ERROR, this._boundHandleError);
|
|
5493
|
+
}).on(EV_ERROR$2, this._boundHandleError);
|
|
5494
5494
|
|
|
5495
5495
|
return new Promise(resolve =>
|
|
5496
|
-
stream.once(STR_END, () => {
|
|
5496
|
+
stream.once(STR_END$2, () => {
|
|
5497
5497
|
if (this.fsw.closed) {
|
|
5498
5498
|
stream = undefined;
|
|
5499
5499
|
return;
|
|
@@ -5512,7 +5512,7 @@ _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
|
5512
5512
|
// a path may have been filtered out of this readdir, but
|
|
5513
5513
|
// shouldn't be removed because it matches a different glob
|
|
5514
5514
|
(!wh.hasGlob || wh.filterPath({
|
|
5515
|
-
fullPath: sysPath$
|
|
5515
|
+
fullPath: sysPath$2.resolve(directory, item)
|
|
5516
5516
|
}));
|
|
5517
5517
|
}).forEach((item) => {
|
|
5518
5518
|
this.fsw._remove(directory, item);
|
|
@@ -5538,14 +5538,14 @@ _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
|
5538
5538
|
* @returns {Promise<Function>} closer for the watcher instance.
|
|
5539
5539
|
*/
|
|
5540
5540
|
async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {
|
|
5541
|
-
const parentDir = this.fsw._getWatchedDir(sysPath$
|
|
5542
|
-
const tracked = parentDir.has(sysPath$
|
|
5541
|
+
const parentDir = this.fsw._getWatchedDir(sysPath$2.dirname(dir));
|
|
5542
|
+
const tracked = parentDir.has(sysPath$2.basename(dir));
|
|
5543
5543
|
if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
|
|
5544
|
-
if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR, dir, stats);
|
|
5544
|
+
if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR$2, dir, stats);
|
|
5545
5545
|
}
|
|
5546
5546
|
|
|
5547
5547
|
// ensure dir is tracked (harmless if redundant)
|
|
5548
|
-
parentDir.add(sysPath$
|
|
5548
|
+
parentDir.add(sysPath$2.basename(dir));
|
|
5549
5549
|
this.fsw._getWatchedDir(dir);
|
|
5550
5550
|
let throttler;
|
|
5551
5551
|
let closer;
|
|
@@ -5594,17 +5594,17 @@ async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
|
|
|
5594
5594
|
|
|
5595
5595
|
// evaluate what is at the path we're being asked to watch
|
|
5596
5596
|
try {
|
|
5597
|
-
const stats = await statMethods[wh.statMethod](wh.watchPath);
|
|
5597
|
+
const stats = await statMethods$1[wh.statMethod](wh.watchPath);
|
|
5598
5598
|
if (this.fsw.closed) return;
|
|
5599
5599
|
if (this.fsw._isIgnored(wh.watchPath, stats)) {
|
|
5600
5600
|
ready();
|
|
5601
5601
|
return false;
|
|
5602
5602
|
}
|
|
5603
5603
|
|
|
5604
|
-
const follow = this.fsw.options.followSymlinks && !path.includes(STAR
|
|
5604
|
+
const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START$1);
|
|
5605
5605
|
let closer;
|
|
5606
5606
|
if (stats.isDirectory()) {
|
|
5607
|
-
const absPath = sysPath$
|
|
5607
|
+
const absPath = sysPath$2.resolve(path);
|
|
5608
5608
|
const targetPath = follow ? await fsrealpath(path) : path;
|
|
5609
5609
|
if (this.fsw.closed) return;
|
|
5610
5610
|
closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
|
|
@@ -5616,15 +5616,15 @@ async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
|
|
|
5616
5616
|
} else if (stats.isSymbolicLink()) {
|
|
5617
5617
|
const targetPath = follow ? await fsrealpath(path) : path;
|
|
5618
5618
|
if (this.fsw.closed) return;
|
|
5619
|
-
const parent = sysPath$
|
|
5619
|
+
const parent = sysPath$2.dirname(wh.watchPath);
|
|
5620
5620
|
this.fsw._getWatchedDir(parent).add(wh.watchPath);
|
|
5621
|
-
this.fsw._emit(EV_ADD, wh.watchPath, stats);
|
|
5621
|
+
this.fsw._emit(EV_ADD$2, wh.watchPath, stats);
|
|
5622
5622
|
closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath);
|
|
5623
5623
|
if (this.fsw.closed) return;
|
|
5624
5624
|
|
|
5625
5625
|
// preserve this symlink's target path
|
|
5626
5626
|
if (targetPath !== undefined) {
|
|
5627
|
-
this.fsw._symlinkPaths.set(sysPath$
|
|
5627
|
+
this.fsw._symlinkPaths.set(sysPath$2.resolve(path), targetPath);
|
|
5628
5628
|
}
|
|
5629
5629
|
} else {
|
|
5630
5630
|
closer = this._handleFile(wh.watchPath, stats, initialAdd);
|
|
@@ -5644,15 +5644,15 @@ async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
|
|
|
5644
5644
|
|
|
5645
5645
|
}
|
|
5646
5646
|
|
|
5647
|
-
var nodefsHandler = NodeFsHandler;
|
|
5647
|
+
var nodefsHandler = NodeFsHandler$1;
|
|
5648
5648
|
|
|
5649
5649
|
var fseventsHandler = {exports: {}};
|
|
5650
5650
|
|
|
5651
5651
|
var require$$3 = /*@__PURE__*/getAugmentedNamespace(fseventsImporter);
|
|
5652
5652
|
|
|
5653
|
-
const fs$
|
|
5654
|
-
const sysPath$
|
|
5655
|
-
const { promisify: promisify$
|
|
5653
|
+
const fs$1 = fs$4;
|
|
5654
|
+
const sysPath$1 = require$$0$2;
|
|
5655
|
+
const { promisify: promisify$1 } = require$$0$1;
|
|
5656
5656
|
|
|
5657
5657
|
let fsevents;
|
|
5658
5658
|
try {
|
|
@@ -5677,9 +5677,9 @@ const {
|
|
|
5677
5677
|
EV_ADD: EV_ADD$1,
|
|
5678
5678
|
EV_CHANGE: EV_CHANGE$1,
|
|
5679
5679
|
EV_ADD_DIR: EV_ADD_DIR$1,
|
|
5680
|
-
EV_UNLINK,
|
|
5680
|
+
EV_UNLINK: EV_UNLINK$1,
|
|
5681
5681
|
EV_ERROR: EV_ERROR$1,
|
|
5682
|
-
STR_DATA
|
|
5682
|
+
STR_DATA,
|
|
5683
5683
|
STR_END: STR_END$1,
|
|
5684
5684
|
FSEVENT_CREATED,
|
|
5685
5685
|
FSEVENT_MODIFIED,
|
|
@@ -5694,18 +5694,18 @@ const {
|
|
|
5694
5694
|
ROOT_GLOBSTAR,
|
|
5695
5695
|
DIR_SUFFIX,
|
|
5696
5696
|
DOT_SLASH,
|
|
5697
|
-
FUNCTION_TYPE,
|
|
5697
|
+
FUNCTION_TYPE: FUNCTION_TYPE$1,
|
|
5698
5698
|
EMPTY_FN: EMPTY_FN$1,
|
|
5699
5699
|
IDENTITY_FN
|
|
5700
|
-
} = constants
|
|
5700
|
+
} = constants;
|
|
5701
5701
|
|
|
5702
5702
|
const Depth = (value) => isNaN(value) ? {} : {depth: value};
|
|
5703
5703
|
|
|
5704
|
-
const stat$
|
|
5705
|
-
const lstat
|
|
5706
|
-
const realpath
|
|
5704
|
+
const stat$1 = promisify$1(fs$1.stat);
|
|
5705
|
+
const lstat = promisify$1(fs$1.lstat);
|
|
5706
|
+
const realpath = promisify$1(fs$1.realpath);
|
|
5707
5707
|
|
|
5708
|
-
const statMethods
|
|
5708
|
+
const statMethods = { stat: stat$1, lstat };
|
|
5709
5709
|
|
|
5710
5710
|
/**
|
|
5711
5711
|
* @typedef {String} Path
|
|
@@ -5754,8 +5754,8 @@ const createFSEventsInstance = (path, callback) => {
|
|
|
5754
5754
|
* @returns {Function} closer
|
|
5755
5755
|
*/
|
|
5756
5756
|
function setFSEventsListener(path, realPath, listener, rawEmitter) {
|
|
5757
|
-
let watchPath = sysPath$
|
|
5758
|
-
const parentPath = sysPath$
|
|
5757
|
+
let watchPath = sysPath$1.extname(path) ? sysPath$1.dirname(path) : path;
|
|
5758
|
+
const parentPath = sysPath$1.dirname(watchPath);
|
|
5759
5759
|
let cont = FSEventsWatchers.get(watchPath);
|
|
5760
5760
|
|
|
5761
5761
|
// If we've accumulated a substantial number of paths that
|
|
@@ -5766,14 +5766,14 @@ function setFSEventsListener(path, realPath, listener, rawEmitter) {
|
|
|
5766
5766
|
watchPath = parentPath;
|
|
5767
5767
|
}
|
|
5768
5768
|
|
|
5769
|
-
const resolvedPath = sysPath$
|
|
5769
|
+
const resolvedPath = sysPath$1.resolve(path);
|
|
5770
5770
|
const hasSymlink = resolvedPath !== realPath;
|
|
5771
5771
|
|
|
5772
5772
|
const filteredListener = (fullPath, flags, info) => {
|
|
5773
5773
|
if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath);
|
|
5774
5774
|
if (
|
|
5775
5775
|
fullPath === resolvedPath ||
|
|
5776
|
-
!fullPath.indexOf(resolvedPath + sysPath$
|
|
5776
|
+
!fullPath.indexOf(resolvedPath + sysPath$1.sep)
|
|
5777
5777
|
) listener(fullPath, flags, info);
|
|
5778
5778
|
};
|
|
5779
5779
|
|
|
@@ -5781,7 +5781,7 @@ function setFSEventsListener(path, realPath, listener, rawEmitter) {
|
|
|
5781
5781
|
// modifies `watchPath` to the parent path when it finds a match
|
|
5782
5782
|
let watchedParent = false;
|
|
5783
5783
|
for (const watchedPath of FSEventsWatchers.keys()) {
|
|
5784
|
-
if (realPath.indexOf(sysPath$
|
|
5784
|
+
if (realPath.indexOf(sysPath$1.resolve(watchedPath) + sysPath$1.sep) === 0) {
|
|
5785
5785
|
watchPath = watchedPath;
|
|
5786
5786
|
cont = FSEventsWatchers.get(watchPath);
|
|
5787
5787
|
watchedParent = true;
|
|
@@ -5846,7 +5846,7 @@ const canUse = () => fsevents && FSEventsWatchers.size < 128;
|
|
|
5846
5846
|
// determines subdirectory traversal levels from root to path
|
|
5847
5847
|
const calcDepth = (path, root) => {
|
|
5848
5848
|
let i = 0;
|
|
5849
|
-
while (!path.indexOf(root) && (path = sysPath$
|
|
5849
|
+
while (!path.indexOf(root) && (path = sysPath$1.dirname(path)) !== root) i++;
|
|
5850
5850
|
return i;
|
|
5851
5851
|
};
|
|
5852
5852
|
|
|
@@ -5861,7 +5861,7 @@ const sameTypes = (info, stats) => (
|
|
|
5861
5861
|
/**
|
|
5862
5862
|
* @mixin
|
|
5863
5863
|
*/
|
|
5864
|
-
class FsEventsHandler {
|
|
5864
|
+
class FsEventsHandler$1 {
|
|
5865
5865
|
|
|
5866
5866
|
/**
|
|
5867
5867
|
* @param {import('../index').FSWatcher} fsw
|
|
@@ -5890,18 +5890,18 @@ addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
|
|
5890
5890
|
|
|
5891
5891
|
async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
|
5892
5892
|
try {
|
|
5893
|
-
const stats = await stat$
|
|
5893
|
+
const stats = await stat$1(path);
|
|
5894
5894
|
if (this.fsw.closed) return;
|
|
5895
5895
|
if (sameTypes(info, stats)) {
|
|
5896
5896
|
this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5897
5897
|
} else {
|
|
5898
|
-
this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5898
|
+
this.handleEvent(EV_UNLINK$1, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5899
5899
|
}
|
|
5900
5900
|
} catch (error) {
|
|
5901
5901
|
if (error.code === 'EACCES') {
|
|
5902
5902
|
this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5903
5903
|
} else {
|
|
5904
|
-
this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5904
|
+
this.handleEvent(EV_UNLINK$1, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5905
5905
|
}
|
|
5906
5906
|
}
|
|
5907
5907
|
}
|
|
@@ -5909,7 +5909,7 @@ async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts
|
|
|
5909
5909
|
handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
|
5910
5910
|
if (this.fsw.closed || this.checkIgnored(path)) return;
|
|
5911
5911
|
|
|
5912
|
-
if (event === EV_UNLINK) {
|
|
5912
|
+
if (event === EV_UNLINK$1) {
|
|
5913
5913
|
const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY;
|
|
5914
5914
|
// suppress unlink events on never before seen files
|
|
5915
5915
|
if (isDirectory || watchedDir.has(item)) {
|
|
@@ -5957,30 +5957,30 @@ _watchWithFsEvents(watchPath, realPath, transform, globFilter) {
|
|
|
5957
5957
|
opts.depth !== undefined &&
|
|
5958
5958
|
calcDepth(fullPath, realPath) > opts.depth
|
|
5959
5959
|
) return;
|
|
5960
|
-
const path = transform(sysPath$
|
|
5961
|
-
watchPath, sysPath$
|
|
5960
|
+
const path = transform(sysPath$1.join(
|
|
5961
|
+
watchPath, sysPath$1.relative(watchPath, fullPath)
|
|
5962
5962
|
));
|
|
5963
5963
|
if (globFilter && !globFilter(path)) return;
|
|
5964
5964
|
// ensure directories are tracked
|
|
5965
|
-
const parent = sysPath$
|
|
5966
|
-
const item = sysPath$
|
|
5965
|
+
const parent = sysPath$1.dirname(path);
|
|
5966
|
+
const item = sysPath$1.basename(path);
|
|
5967
5967
|
const watchedDir = this.fsw._getWatchedDir(
|
|
5968
5968
|
info.type === FSEVENT_TYPE_DIRECTORY ? path : parent
|
|
5969
5969
|
);
|
|
5970
5970
|
|
|
5971
5971
|
// correct for wrong events emitted
|
|
5972
5972
|
if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) {
|
|
5973
|
-
if (typeof opts.ignored === FUNCTION_TYPE) {
|
|
5973
|
+
if (typeof opts.ignored === FUNCTION_TYPE$1) {
|
|
5974
5974
|
let stats;
|
|
5975
5975
|
try {
|
|
5976
|
-
stats = await stat$
|
|
5976
|
+
stats = await stat$1(path);
|
|
5977
5977
|
} catch (error) {}
|
|
5978
5978
|
if (this.fsw.closed) return;
|
|
5979
5979
|
if (this.checkIgnored(path, stats)) return;
|
|
5980
5980
|
if (sameTypes(info, stats)) {
|
|
5981
5981
|
this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5982
5982
|
} else {
|
|
5983
|
-
this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5983
|
+
this.handleEvent(EV_UNLINK$1, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5984
5984
|
}
|
|
5985
5985
|
} else {
|
|
5986
5986
|
this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
@@ -6024,7 +6024,7 @@ async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) {
|
|
|
6024
6024
|
this.fsw._incrReadyCount();
|
|
6025
6025
|
|
|
6026
6026
|
try {
|
|
6027
|
-
const linkTarget = await realpath
|
|
6027
|
+
const linkTarget = await realpath(linkPath);
|
|
6028
6028
|
if (this.fsw.closed) return;
|
|
6029
6029
|
if (this.fsw._isIgnored(linkTarget)) {
|
|
6030
6030
|
return this.fsw._emitReady();
|
|
@@ -6039,7 +6039,7 @@ async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) {
|
|
|
6039
6039
|
if (linkTarget && linkTarget !== DOT_SLASH) {
|
|
6040
6040
|
aliasedPath = path.replace(linkTarget, linkPath);
|
|
6041
6041
|
} else if (path !== DOT_SLASH) {
|
|
6042
|
-
aliasedPath = sysPath$
|
|
6042
|
+
aliasedPath = sysPath$1.join(linkPath, path);
|
|
6043
6043
|
}
|
|
6044
6044
|
return transform(aliasedPath);
|
|
6045
6045
|
}, false, curDepth);
|
|
@@ -6058,8 +6058,8 @@ async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) {
|
|
|
6058
6058
|
emitAdd(newPath, stats, processPath, opts, forceAdd) {
|
|
6059
6059
|
const pp = processPath(newPath);
|
|
6060
6060
|
const isDir = stats.isDirectory();
|
|
6061
|
-
const dirObj = this.fsw._getWatchedDir(sysPath$
|
|
6062
|
-
const base = sysPath$
|
|
6061
|
+
const dirObj = this.fsw._getWatchedDir(sysPath$1.dirname(pp));
|
|
6062
|
+
const base = sysPath$1.basename(pp);
|
|
6063
6063
|
|
|
6064
6064
|
// ensure empty dirs get tracked
|
|
6065
6065
|
if (isDir) this.fsw._getWatchedDir(pp);
|
|
@@ -6075,7 +6075,7 @@ initWatch(realPath, path, wh, processPath) {
|
|
|
6075
6075
|
if (this.fsw.closed) return;
|
|
6076
6076
|
const closer = this._watchWithFsEvents(
|
|
6077
6077
|
wh.watchPath,
|
|
6078
|
-
sysPath$
|
|
6078
|
+
sysPath$1.resolve(realPath || wh.watchPath),
|
|
6079
6079
|
processPath,
|
|
6080
6080
|
wh.globFilter
|
|
6081
6081
|
);
|
|
@@ -6095,13 +6095,13 @@ async _addToFsEvents(path, transform, forceAdd, priorDepth) {
|
|
|
6095
6095
|
return;
|
|
6096
6096
|
}
|
|
6097
6097
|
const opts = this.fsw.options;
|
|
6098
|
-
const processPath = typeof transform === FUNCTION_TYPE ? transform : IDENTITY_FN;
|
|
6098
|
+
const processPath = typeof transform === FUNCTION_TYPE$1 ? transform : IDENTITY_FN;
|
|
6099
6099
|
|
|
6100
6100
|
const wh = this.fsw._getWatchHelpers(path);
|
|
6101
6101
|
|
|
6102
6102
|
// evaluate what is at the path we're being asked to watch
|
|
6103
6103
|
try {
|
|
6104
|
-
const stats = await statMethods
|
|
6104
|
+
const stats = await statMethods[wh.statMethod](wh.watchPath);
|
|
6105
6105
|
if (this.fsw.closed) return;
|
|
6106
6106
|
if (this.fsw._isIgnored(wh.watchPath, stats)) {
|
|
6107
6107
|
throw null;
|
|
@@ -6118,21 +6118,21 @@ async _addToFsEvents(path, transform, forceAdd, priorDepth) {
|
|
|
6118
6118
|
fileFilter: entry => wh.filterPath(entry),
|
|
6119
6119
|
directoryFilter: entry => wh.filterDir(entry),
|
|
6120
6120
|
...Depth(opts.depth - (priorDepth || 0))
|
|
6121
|
-
}).on(STR_DATA
|
|
6121
|
+
}).on(STR_DATA, (entry) => {
|
|
6122
6122
|
// need to check filterPath on dirs b/c filterDir is less restrictive
|
|
6123
6123
|
if (this.fsw.closed) {
|
|
6124
6124
|
return;
|
|
6125
6125
|
}
|
|
6126
6126
|
if (entry.stats.isDirectory() && !wh.filterPath(entry)) return;
|
|
6127
6127
|
|
|
6128
|
-
const joinedPath = sysPath$
|
|
6128
|
+
const joinedPath = sysPath$1.join(wh.watchPath, entry.path);
|
|
6129
6129
|
const {fullPath} = entry;
|
|
6130
6130
|
|
|
6131
6131
|
if (wh.followSymlinks && entry.stats.isSymbolicLink()) {
|
|
6132
6132
|
// preserve the current depth here since it can't be derived from
|
|
6133
6133
|
// real paths past the symlink
|
|
6134
6134
|
const curDepth = opts.depth === undefined ?
|
|
6135
|
-
undefined : calcDepth(joinedPath, sysPath$
|
|
6135
|
+
undefined : calcDepth(joinedPath, sysPath$1.resolve(wh.watchPath)) + 1;
|
|
6136
6136
|
|
|
6137
6137
|
this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth);
|
|
6138
6138
|
} else {
|
|
@@ -6154,13 +6154,13 @@ async _addToFsEvents(path, transform, forceAdd, priorDepth) {
|
|
|
6154
6154
|
}
|
|
6155
6155
|
|
|
6156
6156
|
if (opts.persistent && forceAdd !== true) {
|
|
6157
|
-
if (typeof transform === FUNCTION_TYPE) {
|
|
6157
|
+
if (typeof transform === FUNCTION_TYPE$1) {
|
|
6158
6158
|
// realpath has already been resolved
|
|
6159
6159
|
this.initWatch(undefined, path, wh, processPath);
|
|
6160
6160
|
} else {
|
|
6161
6161
|
let realPath;
|
|
6162
6162
|
try {
|
|
6163
|
-
realPath = await realpath
|
|
6163
|
+
realPath = await realpath(wh.watchPath);
|
|
6164
6164
|
} catch (e) {}
|
|
6165
6165
|
this.initWatch(realPath, path, wh, processPath);
|
|
6166
6166
|
}
|
|
@@ -6169,35 +6169,35 @@ async _addToFsEvents(path, transform, forceAdd, priorDepth) {
|
|
|
6169
6169
|
|
|
6170
6170
|
}
|
|
6171
6171
|
|
|
6172
|
-
fseventsHandler.exports = FsEventsHandler;
|
|
6172
|
+
fseventsHandler.exports = FsEventsHandler$1;
|
|
6173
6173
|
fseventsHandler.exports.canUse = canUse;
|
|
6174
6174
|
|
|
6175
6175
|
const { EventEmitter } = require$$0$3;
|
|
6176
|
-
const fs
|
|
6177
|
-
const sysPath
|
|
6178
|
-
const { promisify
|
|
6179
|
-
const readdirp
|
|
6180
|
-
const anymatch
|
|
6181
|
-
const globParent
|
|
6182
|
-
const isGlob
|
|
6183
|
-
const braces
|
|
6184
|
-
const normalizePath
|
|
6185
|
-
|
|
6186
|
-
const NodeFsHandler
|
|
6187
|
-
const FsEventsHandler
|
|
6176
|
+
const fs = fs$4;
|
|
6177
|
+
const sysPath = require$$0$2;
|
|
6178
|
+
const { promisify } = require$$0$1;
|
|
6179
|
+
const readdirp = readdirp_1;
|
|
6180
|
+
const anymatch = anymatch$2.exports.default;
|
|
6181
|
+
const globParent = globParent$1;
|
|
6182
|
+
const isGlob = isGlob$2;
|
|
6183
|
+
const braces = braces_1;
|
|
6184
|
+
const normalizePath = normalizePath$2;
|
|
6185
|
+
|
|
6186
|
+
const NodeFsHandler = nodefsHandler;
|
|
6187
|
+
const FsEventsHandler = fseventsHandler.exports;
|
|
6188
6188
|
const {
|
|
6189
6189
|
EV_ALL,
|
|
6190
6190
|
EV_READY,
|
|
6191
|
-
EV_ADD
|
|
6192
|
-
EV_CHANGE
|
|
6193
|
-
EV_UNLINK
|
|
6194
|
-
EV_ADD_DIR
|
|
6191
|
+
EV_ADD,
|
|
6192
|
+
EV_CHANGE,
|
|
6193
|
+
EV_UNLINK,
|
|
6194
|
+
EV_ADD_DIR,
|
|
6195
6195
|
EV_UNLINK_DIR,
|
|
6196
6196
|
EV_RAW,
|
|
6197
|
-
EV_ERROR
|
|
6197
|
+
EV_ERROR,
|
|
6198
6198
|
|
|
6199
6199
|
STR_CLOSE,
|
|
6200
|
-
STR_END
|
|
6200
|
+
STR_END,
|
|
6201
6201
|
|
|
6202
6202
|
BACK_SLASH_RE,
|
|
6203
6203
|
DOUBLE_SLASH_RE,
|
|
@@ -6207,24 +6207,24 @@ const {
|
|
|
6207
6207
|
|
|
6208
6208
|
SLASH,
|
|
6209
6209
|
SLASH_SLASH,
|
|
6210
|
-
BRACE_START
|
|
6211
|
-
BANG
|
|
6210
|
+
BRACE_START,
|
|
6211
|
+
BANG,
|
|
6212
6212
|
ONE_DOT,
|
|
6213
6213
|
TWO_DOTS,
|
|
6214
6214
|
GLOBSTAR,
|
|
6215
6215
|
SLASH_GLOBSTAR,
|
|
6216
6216
|
ANYMATCH_OPTS,
|
|
6217
6217
|
STRING_TYPE,
|
|
6218
|
-
FUNCTION_TYPE
|
|
6219
|
-
EMPTY_STR
|
|
6220
|
-
EMPTY_FN
|
|
6218
|
+
FUNCTION_TYPE,
|
|
6219
|
+
EMPTY_STR,
|
|
6220
|
+
EMPTY_FN,
|
|
6221
6221
|
|
|
6222
|
-
isWindows
|
|
6222
|
+
isWindows,
|
|
6223
6223
|
isMacos
|
|
6224
|
-
} = constants
|
|
6224
|
+
} = constants;
|
|
6225
6225
|
|
|
6226
|
-
const stat
|
|
6227
|
-
const readdir
|
|
6226
|
+
const stat = promisify(fs.stat);
|
|
6227
|
+
const readdir = promisify(fs.readdir);
|
|
6228
6228
|
|
|
6229
6229
|
/**
|
|
6230
6230
|
* @typedef {String} Path
|
|
@@ -6246,7 +6246,7 @@ const readdir$1 = promisify$3(fs$3.readdir);
|
|
|
6246
6246
|
* @property {Function} filterDir
|
|
6247
6247
|
*/
|
|
6248
6248
|
|
|
6249
|
-
const arrify
|
|
6249
|
+
const arrify = (value = []) => Array.isArray(value) ? value : [value];
|
|
6250
6250
|
const flatten = (list, result = []) => {
|
|
6251
6251
|
list.forEach(item => {
|
|
6252
6252
|
if (Array.isArray(item)) {
|
|
@@ -6262,7 +6262,7 @@ const unifyPaths = (paths_) => {
|
|
|
6262
6262
|
/**
|
|
6263
6263
|
* @type {Array<String>}
|
|
6264
6264
|
*/
|
|
6265
|
-
const paths = flatten(arrify
|
|
6265
|
+
const paths = flatten(arrify(paths_));
|
|
6266
6266
|
if (!paths.every(p => typeof p === STRING_TYPE)) {
|
|
6267
6267
|
throw new TypeError(`Non-string provided as watch path: ${paths}`);
|
|
6268
6268
|
}
|
|
@@ -6288,21 +6288,21 @@ const toUnix = (string) => {
|
|
|
6288
6288
|
|
|
6289
6289
|
// Our version of upath.normalize
|
|
6290
6290
|
// TODO: this is not equal to path-normalize module - investigate why
|
|
6291
|
-
const normalizePathToUnix = (path) => toUnix(sysPath
|
|
6291
|
+
const normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path)));
|
|
6292
6292
|
|
|
6293
|
-
const normalizeIgnored = (cwd = EMPTY_STR
|
|
6293
|
+
const normalizeIgnored = (cwd = EMPTY_STR) => (path) => {
|
|
6294
6294
|
if (typeof path !== STRING_TYPE) return path;
|
|
6295
|
-
return normalizePathToUnix(sysPath
|
|
6295
|
+
return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path));
|
|
6296
6296
|
};
|
|
6297
6297
|
|
|
6298
6298
|
const getAbsolutePath = (path, cwd) => {
|
|
6299
|
-
if (sysPath
|
|
6299
|
+
if (sysPath.isAbsolute(path)) {
|
|
6300
6300
|
return path;
|
|
6301
6301
|
}
|
|
6302
|
-
if (path.startsWith(BANG
|
|
6303
|
-
return BANG
|
|
6302
|
+
if (path.startsWith(BANG)) {
|
|
6303
|
+
return BANG + sysPath.join(cwd, path.slice(1));
|
|
6304
6304
|
}
|
|
6305
|
-
return sysPath
|
|
6305
|
+
return sysPath.join(cwd, path);
|
|
6306
6306
|
};
|
|
6307
6307
|
|
|
6308
6308
|
const undef = (opts, key) => opts[key] === undefined;
|
|
@@ -6338,10 +6338,10 @@ class DirEntry {
|
|
|
6338
6338
|
|
|
6339
6339
|
const dir = this.path;
|
|
6340
6340
|
try {
|
|
6341
|
-
await readdir
|
|
6341
|
+
await readdir(dir);
|
|
6342
6342
|
} catch (err) {
|
|
6343
6343
|
if (this._removeWatcher) {
|
|
6344
|
-
this._removeWatcher(sysPath
|
|
6344
|
+
this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir));
|
|
6345
6345
|
}
|
|
6346
6346
|
}
|
|
6347
6347
|
}
|
|
@@ -6375,14 +6375,14 @@ const STAT_METHOD_L = 'lstat';
|
|
|
6375
6375
|
class WatchHelper {
|
|
6376
6376
|
constructor(path, watchPath, follow, fsw) {
|
|
6377
6377
|
this.fsw = fsw;
|
|
6378
|
-
this.path = path = path.replace(REPLACER_RE, EMPTY_STR
|
|
6378
|
+
this.path = path = path.replace(REPLACER_RE, EMPTY_STR);
|
|
6379
6379
|
this.watchPath = watchPath;
|
|
6380
|
-
this.fullWatchPath = sysPath
|
|
6380
|
+
this.fullWatchPath = sysPath.resolve(watchPath);
|
|
6381
6381
|
this.hasGlob = watchPath !== path;
|
|
6382
6382
|
/** @type {object|boolean} */
|
|
6383
|
-
if (path === EMPTY_STR
|
|
6383
|
+
if (path === EMPTY_STR) this.hasGlob = false;
|
|
6384
6384
|
this.globSymlink = this.hasGlob && follow ? undefined : false;
|
|
6385
|
-
this.globFilter = this.hasGlob ? anymatch
|
|
6385
|
+
this.globFilter = this.hasGlob ? anymatch(path, undefined, ANYMATCH_OPTS) : false;
|
|
6386
6386
|
this.dirParts = this.getDirParts(path);
|
|
6387
6387
|
this.dirParts.forEach((parts) => {
|
|
6388
6388
|
if (parts.length > 1) parts.pop();
|
|
@@ -6407,8 +6407,8 @@ class WatchHelper {
|
|
|
6407
6407
|
}
|
|
6408
6408
|
|
|
6409
6409
|
entryPath(entry) {
|
|
6410
|
-
return sysPath
|
|
6411
|
-
sysPath
|
|
6410
|
+
return sysPath.join(this.watchPath,
|
|
6411
|
+
sysPath.relative(this.watchPath, this.checkGlobSymlink(entry))
|
|
6412
6412
|
);
|
|
6413
6413
|
}
|
|
6414
6414
|
|
|
@@ -6416,7 +6416,7 @@ class WatchHelper {
|
|
|
6416
6416
|
const {stats} = entry;
|
|
6417
6417
|
if (stats && stats.isSymbolicLink()) return this.filterDir(entry);
|
|
6418
6418
|
const resolvedPath = this.entryPath(entry);
|
|
6419
|
-
const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE
|
|
6419
|
+
const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ?
|
|
6420
6420
|
this.globFilter(resolvedPath) : true;
|
|
6421
6421
|
return matchesGlob &&
|
|
6422
6422
|
this.fsw._isntIgnored(resolvedPath, stats) &&
|
|
@@ -6426,9 +6426,9 @@ class WatchHelper {
|
|
|
6426
6426
|
getDirParts(path) {
|
|
6427
6427
|
if (!this.hasGlob) return [];
|
|
6428
6428
|
const parts = [];
|
|
6429
|
-
const expandedPath = path.includes(BRACE_START
|
|
6429
|
+
const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path];
|
|
6430
6430
|
expandedPath.forEach((path) => {
|
|
6431
|
-
parts.push(sysPath
|
|
6431
|
+
parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE));
|
|
6432
6432
|
});
|
|
6433
6433
|
return parts;
|
|
6434
6434
|
}
|
|
@@ -6440,7 +6440,7 @@ class WatchHelper {
|
|
|
6440
6440
|
this.unmatchedGlob = !this.dirParts.some((parts) => {
|
|
6441
6441
|
return parts.every((part, i) => {
|
|
6442
6442
|
if (part === GLOBSTAR) globstar = true;
|
|
6443
|
-
return globstar || !entryParts[0][i] || anymatch
|
|
6443
|
+
return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS);
|
|
6444
6444
|
});
|
|
6445
6445
|
});
|
|
6446
6446
|
}
|
|
@@ -6493,7 +6493,7 @@ constructor(_opts) {
|
|
|
6493
6493
|
if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling;
|
|
6494
6494
|
|
|
6495
6495
|
// If we can't use fsevents, ensure the options reflect it's disabled.
|
|
6496
|
-
const canUseFsEvents = FsEventsHandler
|
|
6496
|
+
const canUseFsEvents = FsEventsHandler.canUse();
|
|
6497
6497
|
if (!canUseFsEvents) opts.useFsEvents = false;
|
|
6498
6498
|
|
|
6499
6499
|
// Use polling on Mac if not using fsevents.
|
|
@@ -6535,13 +6535,13 @@ constructor(_opts) {
|
|
|
6535
6535
|
if (!awf.pollInterval) awf.pollInterval = 100;
|
|
6536
6536
|
this._pendingWrites = new Map();
|
|
6537
6537
|
}
|
|
6538
|
-
if (opts.ignored) opts.ignored = arrify
|
|
6538
|
+
if (opts.ignored) opts.ignored = arrify(opts.ignored);
|
|
6539
6539
|
|
|
6540
6540
|
let readyCalls = 0;
|
|
6541
6541
|
this._emitReady = () => {
|
|
6542
6542
|
readyCalls++;
|
|
6543
6543
|
if (readyCalls >= this._readyCount) {
|
|
6544
|
-
this._emitReady = EMPTY_FN
|
|
6544
|
+
this._emitReady = EMPTY_FN;
|
|
6545
6545
|
this._readyEmitted = true;
|
|
6546
6546
|
// use process.nextTick to allow time for listener to be bound
|
|
6547
6547
|
process.nextTick(() => this.emit(EV_READY));
|
|
@@ -6553,9 +6553,9 @@ constructor(_opts) {
|
|
|
6553
6553
|
|
|
6554
6554
|
// Initialize with proper watcher.
|
|
6555
6555
|
if (opts.useFsEvents) {
|
|
6556
|
-
this._fsEventsHandler = new FsEventsHandler
|
|
6556
|
+
this._fsEventsHandler = new FsEventsHandler(this);
|
|
6557
6557
|
} else {
|
|
6558
|
-
this._nodeFsHandler = new NodeFsHandler
|
|
6558
|
+
this._nodeFsHandler = new NodeFsHandler(this);
|
|
6559
6559
|
}
|
|
6560
6560
|
|
|
6561
6561
|
// You’re frozen when your heart’s not open.
|
|
@@ -6580,16 +6580,16 @@ add(paths_, _origAdd, _internal) {
|
|
|
6580
6580
|
const absPath = getAbsolutePath(path, cwd);
|
|
6581
6581
|
|
|
6582
6582
|
// Check `path` instead of `absPath` because the cwd portion can't be a glob
|
|
6583
|
-
if (disableGlobbing || !isGlob
|
|
6583
|
+
if (disableGlobbing || !isGlob(path)) {
|
|
6584
6584
|
return absPath;
|
|
6585
6585
|
}
|
|
6586
|
-
return normalizePath
|
|
6586
|
+
return normalizePath(absPath);
|
|
6587
6587
|
});
|
|
6588
6588
|
}
|
|
6589
6589
|
|
|
6590
6590
|
// set aside negated glob strings
|
|
6591
6591
|
paths = paths.filter((path) => {
|
|
6592
|
-
if (path.startsWith(BANG
|
|
6592
|
+
if (path.startsWith(BANG)) {
|
|
6593
6593
|
this._ignoredPaths.add(path.slice(1));
|
|
6594
6594
|
return false;
|
|
6595
6595
|
}
|
|
@@ -6621,7 +6621,7 @@ add(paths_, _origAdd, _internal) {
|
|
|
6621
6621
|
).then(results => {
|
|
6622
6622
|
if (this.closed) return;
|
|
6623
6623
|
results.filter(item => item).forEach(item => {
|
|
6624
|
-
this.add(sysPath
|
|
6624
|
+
this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item));
|
|
6625
6625
|
});
|
|
6626
6626
|
});
|
|
6627
6627
|
}
|
|
@@ -6641,9 +6641,9 @@ unwatch(paths_) {
|
|
|
6641
6641
|
|
|
6642
6642
|
paths.forEach((path) => {
|
|
6643
6643
|
// convert to absolute path unless relative path already matches
|
|
6644
|
-
if (!sysPath
|
|
6645
|
-
if (cwd) path = sysPath
|
|
6646
|
-
path = sysPath
|
|
6644
|
+
if (!sysPath.isAbsolute(path) && !this._closers.has(path)) {
|
|
6645
|
+
if (cwd) path = sysPath.join(cwd, path);
|
|
6646
|
+
path = sysPath.resolve(path);
|
|
6647
6647
|
}
|
|
6648
6648
|
|
|
6649
6649
|
this._closePath(path);
|
|
@@ -6696,7 +6696,7 @@ close() {
|
|
|
6696
6696
|
getWatched() {
|
|
6697
6697
|
const watchList = {};
|
|
6698
6698
|
this._watched.forEach((entry, dir) => {
|
|
6699
|
-
const key = this.options.cwd ? sysPath
|
|
6699
|
+
const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir;
|
|
6700
6700
|
watchList[key || ONE_DOT] = entry.getChildren().sort();
|
|
6701
6701
|
});
|
|
6702
6702
|
return watchList;
|
|
@@ -6704,7 +6704,7 @@ getWatched() {
|
|
|
6704
6704
|
|
|
6705
6705
|
emitWithAll(event, args) {
|
|
6706
6706
|
this.emit(...args);
|
|
6707
|
-
if (event !== EV_ERROR
|
|
6707
|
+
if (event !== EV_ERROR) this.emit(EV_ALL, ...args);
|
|
6708
6708
|
}
|
|
6709
6709
|
|
|
6710
6710
|
// Common helpers
|
|
@@ -6724,8 +6724,8 @@ async _emit(event, path, val1, val2, val3) {
|
|
|
6724
6724
|
if (this.closed) return;
|
|
6725
6725
|
|
|
6726
6726
|
const opts = this.options;
|
|
6727
|
-
if (isWindows
|
|
6728
|
-
if (opts.cwd) path = sysPath
|
|
6727
|
+
if (isWindows) path = sysPath.normalize(path);
|
|
6728
|
+
if (opts.cwd) path = sysPath.relative(opts.cwd, path);
|
|
6729
6729
|
/** @type Array<any> */
|
|
6730
6730
|
const args = [event, path];
|
|
6731
6731
|
if (val3 !== undefined) args.push(val1, val2, val3);
|
|
@@ -6740,7 +6740,7 @@ async _emit(event, path, val1, val2, val3) {
|
|
|
6740
6740
|
}
|
|
6741
6741
|
|
|
6742
6742
|
if (opts.atomic) {
|
|
6743
|
-
if (event === EV_UNLINK
|
|
6743
|
+
if (event === EV_UNLINK) {
|
|
6744
6744
|
this._pendingUnlinks.set(path, args);
|
|
6745
6745
|
setTimeout(() => {
|
|
6746
6746
|
this._pendingUnlinks.forEach((entry, path) => {
|
|
@@ -6751,16 +6751,16 @@ async _emit(event, path, val1, val2, val3) {
|
|
|
6751
6751
|
}, typeof opts.atomic === 'number' ? opts.atomic : 100);
|
|
6752
6752
|
return this;
|
|
6753
6753
|
}
|
|
6754
|
-
if (event === EV_ADD
|
|
6755
|
-
event = args[0] = EV_CHANGE
|
|
6754
|
+
if (event === EV_ADD && this._pendingUnlinks.has(path)) {
|
|
6755
|
+
event = args[0] = EV_CHANGE;
|
|
6756
6756
|
this._pendingUnlinks.delete(path);
|
|
6757
6757
|
}
|
|
6758
6758
|
}
|
|
6759
6759
|
|
|
6760
|
-
if (awf && (event === EV_ADD
|
|
6760
|
+
if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) {
|
|
6761
6761
|
const awfEmit = (err, stats) => {
|
|
6762
6762
|
if (err) {
|
|
6763
|
-
event = args[0] = EV_ERROR
|
|
6763
|
+
event = args[0] = EV_ERROR;
|
|
6764
6764
|
args[1] = err;
|
|
6765
6765
|
this.emitWithAll(event, args);
|
|
6766
6766
|
} else if (stats) {
|
|
@@ -6778,18 +6778,18 @@ async _emit(event, path, val1, val2, val3) {
|
|
|
6778
6778
|
return this;
|
|
6779
6779
|
}
|
|
6780
6780
|
|
|
6781
|
-
if (event === EV_CHANGE
|
|
6782
|
-
const isThrottled = !this._throttle(EV_CHANGE
|
|
6781
|
+
if (event === EV_CHANGE) {
|
|
6782
|
+
const isThrottled = !this._throttle(EV_CHANGE, path, 50);
|
|
6783
6783
|
if (isThrottled) return this;
|
|
6784
6784
|
}
|
|
6785
6785
|
|
|
6786
6786
|
if (opts.alwaysStat && val1 === undefined &&
|
|
6787
|
-
(event === EV_ADD
|
|
6787
|
+
(event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE)
|
|
6788
6788
|
) {
|
|
6789
|
-
const fullPath = opts.cwd ? sysPath
|
|
6789
|
+
const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path;
|
|
6790
6790
|
let stats;
|
|
6791
6791
|
try {
|
|
6792
|
-
stats = await stat
|
|
6792
|
+
stats = await stat(fullPath);
|
|
6793
6793
|
} catch (err) {}
|
|
6794
6794
|
// Suppress event when fs_stat fails, to avoid sending undefined 'stat'
|
|
6795
6795
|
if (!stats || this.closed) return;
|
|
@@ -6810,7 +6810,7 @@ _handleError(error) {
|
|
|
6810
6810
|
if (error && code !== 'ENOENT' && code !== 'ENOTDIR' &&
|
|
6811
6811
|
(!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES'))
|
|
6812
6812
|
) {
|
|
6813
|
-
this.emit(EV_ERROR
|
|
6813
|
+
this.emit(EV_ERROR, error);
|
|
6814
6814
|
}
|
|
6815
6815
|
return error || this.closed;
|
|
6816
6816
|
}
|
|
@@ -6868,14 +6868,14 @@ _awaitWriteFinish(path, threshold, event, awfEmit) {
|
|
|
6868
6868
|
let timeoutHandler;
|
|
6869
6869
|
|
|
6870
6870
|
let fullPath = path;
|
|
6871
|
-
if (this.options.cwd && !sysPath
|
|
6872
|
-
fullPath = sysPath
|
|
6871
|
+
if (this.options.cwd && !sysPath.isAbsolute(path)) {
|
|
6872
|
+
fullPath = sysPath.join(this.options.cwd, path);
|
|
6873
6873
|
}
|
|
6874
6874
|
|
|
6875
6875
|
const now = new Date();
|
|
6876
6876
|
|
|
6877
6877
|
const awaitWriteFinish = (prevStat) => {
|
|
6878
|
-
fs
|
|
6878
|
+
fs.stat(fullPath, (err, curStat) => {
|
|
6879
6879
|
if (err || !this._pendingWrites.has(path)) {
|
|
6880
6880
|
if (err && err.code !== 'ENOENT') awfEmit(err);
|
|
6881
6881
|
return;
|
|
@@ -6935,11 +6935,11 @@ _isIgnored(path, stats) {
|
|
|
6935
6935
|
const ign = this.options.ignored;
|
|
6936
6936
|
|
|
6937
6937
|
const ignored = ign && ign.map(normalizeIgnored(cwd));
|
|
6938
|
-
const paths = arrify
|
|
6939
|
-
.filter((path) => typeof path === STRING_TYPE && !isGlob
|
|
6938
|
+
const paths = arrify(ignored)
|
|
6939
|
+
.filter((path) => typeof path === STRING_TYPE && !isGlob(path))
|
|
6940
6940
|
.map((path) => path + SLASH_GLOBSTAR);
|
|
6941
6941
|
const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths);
|
|
6942
|
-
this._userIgnored = anymatch
|
|
6942
|
+
this._userIgnored = anymatch(list, undefined, ANYMATCH_OPTS);
|
|
6943
6943
|
}
|
|
6944
6944
|
|
|
6945
6945
|
return this._userIgnored([path, stats]);
|
|
@@ -6956,7 +6956,7 @@ _isntIgnored(path, stat) {
|
|
|
6956
6956
|
* @returns {WatchHelper} object containing helpers for this path
|
|
6957
6957
|
*/
|
|
6958
6958
|
_getWatchHelpers(path, depth) {
|
|
6959
|
-
const watchPath = depth || this.options.disableGlobbing || !isGlob
|
|
6959
|
+
const watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path);
|
|
6960
6960
|
const follow = this.options.followSymlinks;
|
|
6961
6961
|
|
|
6962
6962
|
return new WatchHelper(path, watchPath, follow, this);
|
|
@@ -6972,7 +6972,7 @@ _getWatchHelpers(path, depth) {
|
|
|
6972
6972
|
*/
|
|
6973
6973
|
_getWatchedDir(directory) {
|
|
6974
6974
|
if (!this._boundRemove) this._boundRemove = this._remove.bind(this);
|
|
6975
|
-
const dir = sysPath
|
|
6975
|
+
const dir = sysPath.resolve(directory);
|
|
6976
6976
|
if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove));
|
|
6977
6977
|
return this._watched.get(dir);
|
|
6978
6978
|
}
|
|
@@ -7008,8 +7008,8 @@ _remove(directory, item, isDirectory) {
|
|
|
7008
7008
|
// if what is being deleted is a directory, get that directory's paths
|
|
7009
7009
|
// for recursive deleting and cleaning of watched object
|
|
7010
7010
|
// if it is not a directory, nestedDirectoryChildren will be empty array
|
|
7011
|
-
const path = sysPath
|
|
7012
|
-
const fullPath = sysPath
|
|
7011
|
+
const path = sysPath.join(directory, item);
|
|
7012
|
+
const fullPath = sysPath.resolve(path);
|
|
7013
7013
|
isDirectory = isDirectory != null
|
|
7014
7014
|
? isDirectory
|
|
7015
7015
|
: this._watched.has(path) || this._watched.has(fullPath);
|
|
@@ -7047,17 +7047,17 @@ _remove(directory, item, isDirectory) {
|
|
|
7047
7047
|
|
|
7048
7048
|
// If we wait for this file to be fully written, cancel the wait.
|
|
7049
7049
|
let relPath = path;
|
|
7050
|
-
if (this.options.cwd) relPath = sysPath
|
|
7050
|
+
if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path);
|
|
7051
7051
|
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
|
7052
7052
|
const event = this._pendingWrites.get(relPath).cancelWait();
|
|
7053
|
-
if (event === EV_ADD
|
|
7053
|
+
if (event === EV_ADD) return;
|
|
7054
7054
|
}
|
|
7055
7055
|
|
|
7056
7056
|
// The Entry will either be a directory that just got removed
|
|
7057
7057
|
// or a bogus entry to a file, in either case we have to remove it
|
|
7058
7058
|
this._watched.delete(path);
|
|
7059
7059
|
this._watched.delete(fullPath);
|
|
7060
|
-
const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK
|
|
7060
|
+
const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK;
|
|
7061
7061
|
if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path);
|
|
7062
7062
|
|
|
7063
7063
|
// Avoid conflicts if we later create another file with the same name
|
|
@@ -7072,8 +7072,8 @@ _remove(directory, item, isDirectory) {
|
|
|
7072
7072
|
*/
|
|
7073
7073
|
_closePath(path) {
|
|
7074
7074
|
this._closeFile(path);
|
|
7075
|
-
const dir = sysPath
|
|
7076
|
-
this._getWatchedDir(dir).remove(sysPath
|
|
7075
|
+
const dir = sysPath.dirname(path);
|
|
7076
|
+
this._getWatchedDir(dir).remove(sysPath.basename(path));
|
|
7077
7077
|
}
|
|
7078
7078
|
|
|
7079
7079
|
/**
|
|
@@ -7105,12 +7105,12 @@ _addPathCloser(path, closer) {
|
|
|
7105
7105
|
_readdirp(root, opts) {
|
|
7106
7106
|
if (this.closed) return;
|
|
7107
7107
|
const options = {type: EV_ALL, alwaysStat: true, lstat: true, ...opts};
|
|
7108
|
-
let stream = readdirp
|
|
7108
|
+
let stream = readdirp(root, options);
|
|
7109
7109
|
this._streams.add(stream);
|
|
7110
7110
|
stream.once(STR_CLOSE, () => {
|
|
7111
7111
|
stream = undefined;
|
|
7112
7112
|
});
|
|
7113
|
-
stream.once(STR_END
|
|
7113
|
+
stream.once(STR_END, () => {
|
|
7114
7114
|
if (stream) {
|
|
7115
7115
|
this._streams.delete(stream);
|
|
7116
7116
|
stream = undefined;
|