rollup 2.38.4 → 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 +54 -0
- package/LICENSE.md +1 -1
- package/dist/bin/rollup +18 -16
- package/dist/es/rollup.browser.js +3 -3
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/rollup.js +437 -373
- package/dist/es/shared/watch.js +480 -426
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.d.ts +2 -0
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +446 -397
- package/dist/shared/loadConfigFile.js +8 -8
- package/dist/shared/mergeOptions.js +4 -3
- package/dist/shared/rollup.js +497 -434
- package/dist/shared/watch-cli.js +34 -26
- package/dist/shared/watch.js +29 -25
- package/package.json +22 -18
package/dist/shared/index.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
|
|
@@ -11,14 +11,16 @@
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
13
|
var require$$0$2 = require('events');
|
|
14
|
-
var fs = require('fs');
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var require$$
|
|
14
|
+
var fs$4 = require('fs');
|
|
15
|
+
var path$3 = require('path');
|
|
16
|
+
var require$$0$1 = require('util');
|
|
17
|
+
var require$$1 = require('stream');
|
|
18
|
+
var require$$2 = require('os');
|
|
18
19
|
var rollup = require('./rollup.js');
|
|
19
|
-
var require$$1$1 = require('os');
|
|
20
20
|
|
|
21
|
-
var utils =
|
|
21
|
+
var utils$7 = {};
|
|
22
|
+
|
|
23
|
+
(function (exports) {
|
|
22
24
|
|
|
23
25
|
exports.isInteger = num => {
|
|
24
26
|
if (typeof num === 'number') {
|
|
@@ -130,16 +132,18 @@ exports.flatten = (...args) => {
|
|
|
130
132
|
flat(args);
|
|
131
133
|
return result;
|
|
132
134
|
};
|
|
133
|
-
});
|
|
135
|
+
}(utils$7));
|
|
136
|
+
|
|
137
|
+
const utils$6 = utils$7;
|
|
134
138
|
|
|
135
|
-
var stringify = (ast, options = {}) => {
|
|
139
|
+
var stringify$4 = (ast, options = {}) => {
|
|
136
140
|
let stringify = (node, parent = {}) => {
|
|
137
|
-
let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
|
|
141
|
+
let invalidBlock = options.escapeInvalid && utils$6.isInvalidBrace(parent);
|
|
138
142
|
let invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
139
143
|
let output = '';
|
|
140
144
|
|
|
141
145
|
if (node.value) {
|
|
142
|
-
if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
|
|
146
|
+
if ((invalidBlock || invalidNode) && utils$6.isOpenOrClose(node)) {
|
|
143
147
|
return '\\' + node.value;
|
|
144
148
|
}
|
|
145
149
|
return node.value;
|
|
@@ -167,7 +171,7 @@ var stringify = (ast, options = {}) => {
|
|
|
167
171
|
* Released under the MIT License.
|
|
168
172
|
*/
|
|
169
173
|
|
|
170
|
-
var isNumber = function(num) {
|
|
174
|
+
var isNumber$2 = function(num) {
|
|
171
175
|
if (typeof num === 'number') {
|
|
172
176
|
return num - num === 0;
|
|
173
177
|
}
|
|
@@ -184,10 +188,10 @@ var isNumber = function(num) {
|
|
|
184
188
|
* Released under the MIT License.
|
|
185
189
|
*/
|
|
186
190
|
|
|
191
|
+
const isNumber$1 = isNumber$2;
|
|
187
192
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
if (isNumber(min) === false) {
|
|
193
|
+
const toRegexRange$1 = (min, max, options) => {
|
|
194
|
+
if (isNumber$1(min) === false) {
|
|
191
195
|
throw new TypeError('toRegexRange: expected the first argument to be a number');
|
|
192
196
|
}
|
|
193
197
|
|
|
@@ -195,7 +199,7 @@ const toRegexRange = (min, max, options) => {
|
|
|
195
199
|
return String(min);
|
|
196
200
|
}
|
|
197
201
|
|
|
198
|
-
if (isNumber(max) === false) {
|
|
202
|
+
if (isNumber$1(max) === false) {
|
|
199
203
|
throw new TypeError('toRegexRange: expected the second argument to be a number.');
|
|
200
204
|
}
|
|
201
205
|
|
|
@@ -210,8 +214,8 @@ const toRegexRange = (min, max, options) => {
|
|
|
210
214
|
let wrap = String(opts.wrap);
|
|
211
215
|
let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap;
|
|
212
216
|
|
|
213
|
-
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
214
|
-
return toRegexRange.cache[cacheKey].result;
|
|
217
|
+
if (toRegexRange$1.cache.hasOwnProperty(cacheKey)) {
|
|
218
|
+
return toRegexRange$1.cache[cacheKey].result;
|
|
215
219
|
}
|
|
216
220
|
|
|
217
221
|
let a = Math.min(min, max);
|
|
@@ -258,7 +262,7 @@ const toRegexRange = (min, max, options) => {
|
|
|
258
262
|
state.result = `(?:${state.result})`;
|
|
259
263
|
}
|
|
260
264
|
|
|
261
|
-
toRegexRange.cache[cacheKey] = state;
|
|
265
|
+
toRegexRange$1.cache[cacheKey] = state;
|
|
262
266
|
return state.result;
|
|
263
267
|
};
|
|
264
268
|
|
|
@@ -455,14 +459,14 @@ function padZeros(value, tok, options) {
|
|
|
455
459
|
* Cache
|
|
456
460
|
*/
|
|
457
461
|
|
|
458
|
-
toRegexRange.cache = {};
|
|
459
|
-
toRegexRange.clearCache = () => (toRegexRange.cache = {});
|
|
462
|
+
toRegexRange$1.cache = {};
|
|
463
|
+
toRegexRange$1.clearCache = () => (toRegexRange$1.cache = {});
|
|
460
464
|
|
|
461
465
|
/**
|
|
462
466
|
* Expose `toRegexRange`
|
|
463
467
|
*/
|
|
464
468
|
|
|
465
|
-
var toRegexRange_1 = toRegexRange;
|
|
469
|
+
var toRegexRange_1 = toRegexRange$1;
|
|
466
470
|
|
|
467
471
|
/*!
|
|
468
472
|
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|
@@ -471,10 +475,10 @@ var toRegexRange_1 = toRegexRange;
|
|
|
471
475
|
* Licensed under the MIT License.
|
|
472
476
|
*/
|
|
473
477
|
|
|
478
|
+
const util = require$$0$1;
|
|
479
|
+
const toRegexRange = toRegexRange_1;
|
|
474
480
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
|
481
|
+
const isObject$1 = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
|
478
482
|
|
|
479
483
|
const transform = toNumber => {
|
|
480
484
|
return value => toNumber === true ? Number(value) : String(value);
|
|
@@ -484,7 +488,7 @@ const isValidValue = value => {
|
|
|
484
488
|
return typeof value === 'number' || (typeof value === 'string' && value !== '');
|
|
485
489
|
};
|
|
486
490
|
|
|
487
|
-
const isNumber
|
|
491
|
+
const isNumber = num => Number.isInteger(+num);
|
|
488
492
|
|
|
489
493
|
const zeros = input => {
|
|
490
494
|
let value = `${input}`;
|
|
@@ -495,7 +499,7 @@ const zeros = input => {
|
|
|
495
499
|
return index > 0;
|
|
496
500
|
};
|
|
497
501
|
|
|
498
|
-
const stringify$
|
|
502
|
+
const stringify$3 = (start, end, options) => {
|
|
499
503
|
if (typeof start === 'string' || typeof end === 'string') {
|
|
500
504
|
return true;
|
|
501
505
|
}
|
|
@@ -556,7 +560,7 @@ const toSequence = (parts, options) => {
|
|
|
556
560
|
|
|
557
561
|
const toRange = (a, b, isNumbers, options) => {
|
|
558
562
|
if (isNumbers) {
|
|
559
|
-
return
|
|
563
|
+
return toRegexRange(a, b, { wrap: false, ...options });
|
|
560
564
|
}
|
|
561
565
|
|
|
562
566
|
let start = String.fromCharCode(a);
|
|
@@ -572,7 +576,7 @@ const toRegex = (start, end, options) => {
|
|
|
572
576
|
let prefix = options.capture ? '' : '?:';
|
|
573
577
|
return wrap ? `(${prefix}${start.join('|')})` : start.join('|');
|
|
574
578
|
}
|
|
575
|
-
return
|
|
579
|
+
return toRegexRange(start, end, options);
|
|
576
580
|
};
|
|
577
581
|
|
|
578
582
|
const rangeError = (...args) => {
|
|
@@ -612,7 +616,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
|
|
|
612
616
|
|
|
613
617
|
let padded = zeros(startString) || zeros(endString) || zeros(stepString);
|
|
614
618
|
let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
|
615
|
-
let toNumber = padded === false && stringify$
|
|
619
|
+
let toNumber = padded === false && stringify$3(start, end, options) === false;
|
|
616
620
|
let format = options.transform || transform(toNumber);
|
|
617
621
|
|
|
618
622
|
if (options.toRegex && step === 1) {
|
|
@@ -644,7 +648,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
|
|
|
644
648
|
};
|
|
645
649
|
|
|
646
650
|
const fillLetters = (start, end, step = 1, options = {}) => {
|
|
647
|
-
if ((!isNumber
|
|
651
|
+
if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) {
|
|
648
652
|
return invalidRange(start, end, options);
|
|
649
653
|
}
|
|
650
654
|
|
|
@@ -677,7 +681,7 @@ const fillLetters = (start, end, step = 1, options = {}) => {
|
|
|
677
681
|
return range;
|
|
678
682
|
};
|
|
679
683
|
|
|
680
|
-
const fill = (start, end, step, options = {}) => {
|
|
684
|
+
const fill$2 = (start, end, step, options = {}) => {
|
|
681
685
|
if (end == null && isValidValue(start)) {
|
|
682
686
|
return [start];
|
|
683
687
|
}
|
|
@@ -687,34 +691,37 @@ const fill = (start, end, step, options = {}) => {
|
|
|
687
691
|
}
|
|
688
692
|
|
|
689
693
|
if (typeof step === 'function') {
|
|
690
|
-
return fill(start, end, 1, { transform: step });
|
|
694
|
+
return fill$2(start, end, 1, { transform: step });
|
|
691
695
|
}
|
|
692
696
|
|
|
693
|
-
if (isObject(step)) {
|
|
694
|
-
return fill(start, end, 0, step);
|
|
697
|
+
if (isObject$1(step)) {
|
|
698
|
+
return fill$2(start, end, 0, step);
|
|
695
699
|
}
|
|
696
700
|
|
|
697
701
|
let opts = { ...options };
|
|
698
702
|
if (opts.capture === true) opts.wrap = true;
|
|
699
703
|
step = step || opts.step || 1;
|
|
700
704
|
|
|
701
|
-
if (!isNumber
|
|
702
|
-
if (step != null && !isObject(step)) return invalidStep(step, opts);
|
|
703
|
-
return fill(start, end, 1, step);
|
|
705
|
+
if (!isNumber(step)) {
|
|
706
|
+
if (step != null && !isObject$1(step)) return invalidStep(step, opts);
|
|
707
|
+
return fill$2(start, end, 1, step);
|
|
704
708
|
}
|
|
705
709
|
|
|
706
|
-
if (isNumber
|
|
710
|
+
if (isNumber(start) && isNumber(end)) {
|
|
707
711
|
return fillNumbers(start, end, step, opts);
|
|
708
712
|
}
|
|
709
713
|
|
|
710
714
|
return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
|
|
711
715
|
};
|
|
712
716
|
|
|
713
|
-
var fillRange = fill;
|
|
717
|
+
var fillRange = fill$2;
|
|
718
|
+
|
|
719
|
+
const fill$1 = fillRange;
|
|
720
|
+
const utils$5 = utils$7;
|
|
714
721
|
|
|
715
|
-
const compile = (ast, options = {}) => {
|
|
722
|
+
const compile$1 = (ast, options = {}) => {
|
|
716
723
|
let walk = (node, parent = {}) => {
|
|
717
|
-
let invalidBlock = utils.isInvalidBrace(parent);
|
|
724
|
+
let invalidBlock = utils$5.isInvalidBrace(parent);
|
|
718
725
|
let invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
719
726
|
let invalid = invalidBlock === true || invalidNode === true;
|
|
720
727
|
let prefix = options.escapeInvalid === true ? '\\' : '';
|
|
@@ -744,8 +751,8 @@ const compile = (ast, options = {}) => {
|
|
|
744
751
|
}
|
|
745
752
|
|
|
746
753
|
if (node.nodes && node.ranges > 0) {
|
|
747
|
-
let args = utils.reduce(node.nodes);
|
|
748
|
-
let range =
|
|
754
|
+
let args = utils$5.reduce(node.nodes);
|
|
755
|
+
let range = fill$1(...args, { ...options, wrap: false, toRegex: true });
|
|
749
756
|
|
|
750
757
|
if (range.length !== 0) {
|
|
751
758
|
return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
|
@@ -763,7 +770,11 @@ const compile = (ast, options = {}) => {
|
|
|
763
770
|
return walk(ast);
|
|
764
771
|
};
|
|
765
772
|
|
|
766
|
-
var compile_1 = compile;
|
|
773
|
+
var compile_1 = compile$1;
|
|
774
|
+
|
|
775
|
+
const fill = fillRange;
|
|
776
|
+
const stringify$2 = stringify$4;
|
|
777
|
+
const utils$4 = utils$7;
|
|
767
778
|
|
|
768
779
|
const append = (queue = '', stash = '', enclose = false) => {
|
|
769
780
|
let result = [];
|
|
@@ -773,7 +784,7 @@ const append = (queue = '', stash = '', enclose = false) => {
|
|
|
773
784
|
|
|
774
785
|
if (!stash.length) return queue;
|
|
775
786
|
if (!queue.length) {
|
|
776
|
-
return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash;
|
|
787
|
+
return enclose ? utils$4.flatten(stash).map(ele => `{${ele}}`) : stash;
|
|
777
788
|
}
|
|
778
789
|
|
|
779
790
|
for (let item of queue) {
|
|
@@ -788,10 +799,10 @@ const append = (queue = '', stash = '', enclose = false) => {
|
|
|
788
799
|
}
|
|
789
800
|
}
|
|
790
801
|
}
|
|
791
|
-
return utils.flatten(result);
|
|
802
|
+
return utils$4.flatten(result);
|
|
792
803
|
};
|
|
793
804
|
|
|
794
|
-
const expand = (ast, options = {}) => {
|
|
805
|
+
const expand$1 = (ast, options = {}) => {
|
|
795
806
|
let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit;
|
|
796
807
|
|
|
797
808
|
let walk = (node, parent = {}) => {
|
|
@@ -806,7 +817,7 @@ const expand = (ast, options = {}) => {
|
|
|
806
817
|
}
|
|
807
818
|
|
|
808
819
|
if (node.invalid || node.dollar) {
|
|
809
|
-
q.push(append(q.pop(), stringify(node, options)));
|
|
820
|
+
q.push(append(q.pop(), stringify$2(node, options)));
|
|
810
821
|
return;
|
|
811
822
|
}
|
|
812
823
|
|
|
@@ -816,15 +827,15 @@ const expand = (ast, options = {}) => {
|
|
|
816
827
|
}
|
|
817
828
|
|
|
818
829
|
if (node.nodes && node.ranges > 0) {
|
|
819
|
-
let args = utils.reduce(node.nodes);
|
|
830
|
+
let args = utils$4.reduce(node.nodes);
|
|
820
831
|
|
|
821
|
-
if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
|
|
832
|
+
if (utils$4.exceedsLimit(...args, options.step, rangeLimit)) {
|
|
822
833
|
throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
|
|
823
834
|
}
|
|
824
835
|
|
|
825
|
-
let range =
|
|
836
|
+
let range = fill(...args, options);
|
|
826
837
|
if (range.length === 0) {
|
|
827
|
-
range = stringify(node, options);
|
|
838
|
+
range = stringify$2(node, options);
|
|
828
839
|
}
|
|
829
840
|
|
|
830
841
|
q.push(append(q.pop(), range));
|
|
@@ -832,7 +843,7 @@ const expand = (ast, options = {}) => {
|
|
|
832
843
|
return;
|
|
833
844
|
}
|
|
834
845
|
|
|
835
|
-
let enclose = utils.encloseBrace(node);
|
|
846
|
+
let enclose = utils$4.encloseBrace(node);
|
|
836
847
|
let queue = node.queue;
|
|
837
848
|
let block = node;
|
|
838
849
|
|
|
@@ -868,12 +879,12 @@ const expand = (ast, options = {}) => {
|
|
|
868
879
|
return queue;
|
|
869
880
|
};
|
|
870
881
|
|
|
871
|
-
return utils.flatten(walk(ast));
|
|
882
|
+
return utils$4.flatten(walk(ast));
|
|
872
883
|
};
|
|
873
884
|
|
|
874
|
-
var expand_1 = expand;
|
|
885
|
+
var expand_1 = expand$1;
|
|
875
886
|
|
|
876
|
-
var constants = {
|
|
887
|
+
var constants$4 = {
|
|
877
888
|
MAX_LENGTH: 1024 * 64,
|
|
878
889
|
|
|
879
890
|
// Digits
|
|
@@ -929,39 +940,41 @@ var constants = {
|
|
|
929
940
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */
|
|
930
941
|
};
|
|
931
942
|
|
|
943
|
+
const stringify$1 = stringify$4;
|
|
944
|
+
|
|
932
945
|
/**
|
|
933
946
|
* Constants
|
|
934
947
|
*/
|
|
935
948
|
|
|
936
949
|
const {
|
|
937
|
-
MAX_LENGTH,
|
|
950
|
+
MAX_LENGTH: MAX_LENGTH$1,
|
|
938
951
|
CHAR_BACKSLASH, /* \ */
|
|
939
952
|
CHAR_BACKTICK, /* ` */
|
|
940
|
-
CHAR_COMMA, /* , */
|
|
941
|
-
CHAR_DOT, /* . */
|
|
942
|
-
CHAR_LEFT_PARENTHESES, /* ( */
|
|
943
|
-
CHAR_RIGHT_PARENTHESES, /* ) */
|
|
944
|
-
CHAR_LEFT_CURLY_BRACE, /* { */
|
|
945
|
-
CHAR_RIGHT_CURLY_BRACE, /* } */
|
|
946
|
-
CHAR_LEFT_SQUARE_BRACKET, /* [ */
|
|
947
|
-
CHAR_RIGHT_SQUARE_BRACKET, /* ] */
|
|
953
|
+
CHAR_COMMA: CHAR_COMMA$1, /* , */
|
|
954
|
+
CHAR_DOT: CHAR_DOT$1, /* . */
|
|
955
|
+
CHAR_LEFT_PARENTHESES: CHAR_LEFT_PARENTHESES$1, /* ( */
|
|
956
|
+
CHAR_RIGHT_PARENTHESES: CHAR_RIGHT_PARENTHESES$1, /* ) */
|
|
957
|
+
CHAR_LEFT_CURLY_BRACE: CHAR_LEFT_CURLY_BRACE$1, /* { */
|
|
958
|
+
CHAR_RIGHT_CURLY_BRACE: CHAR_RIGHT_CURLY_BRACE$1, /* } */
|
|
959
|
+
CHAR_LEFT_SQUARE_BRACKET: CHAR_LEFT_SQUARE_BRACKET$1, /* [ */
|
|
960
|
+
CHAR_RIGHT_SQUARE_BRACKET: CHAR_RIGHT_SQUARE_BRACKET$1, /* ] */
|
|
948
961
|
CHAR_DOUBLE_QUOTE, /* " */
|
|
949
962
|
CHAR_SINGLE_QUOTE, /* ' */
|
|
950
963
|
CHAR_NO_BREAK_SPACE,
|
|
951
964
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE
|
|
952
|
-
} = constants;
|
|
965
|
+
} = constants$4;
|
|
953
966
|
|
|
954
967
|
/**
|
|
955
968
|
* parse
|
|
956
969
|
*/
|
|
957
970
|
|
|
958
|
-
const parse = (input, options = {}) => {
|
|
971
|
+
const parse$3 = (input, options = {}) => {
|
|
959
972
|
if (typeof input !== 'string') {
|
|
960
973
|
throw new TypeError('Expected a string');
|
|
961
974
|
}
|
|
962
975
|
|
|
963
976
|
let opts = options || {};
|
|
964
|
-
let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
977
|
+
let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
|
|
965
978
|
if (input.length > max) {
|
|
966
979
|
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
|
967
980
|
}
|
|
@@ -1025,7 +1038,7 @@ const parse = (input, options = {}) => {
|
|
|
1025
1038
|
* Right square bracket (literal): ']'
|
|
1026
1039
|
*/
|
|
1027
1040
|
|
|
1028
|
-
if (value === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
1041
|
+
if (value === CHAR_RIGHT_SQUARE_BRACKET$1) {
|
|
1029
1042
|
push({ type: 'text', value: '\\' + value });
|
|
1030
1043
|
continue;
|
|
1031
1044
|
}
|
|
@@ -1034,14 +1047,14 @@ const parse = (input, options = {}) => {
|
|
|
1034
1047
|
* Left square bracket: '['
|
|
1035
1048
|
*/
|
|
1036
1049
|
|
|
1037
|
-
if (value === CHAR_LEFT_SQUARE_BRACKET) {
|
|
1050
|
+
if (value === CHAR_LEFT_SQUARE_BRACKET$1) {
|
|
1038
1051
|
brackets++;
|
|
1039
1052
|
let next;
|
|
1040
1053
|
|
|
1041
1054
|
while (index < length && (next = advance())) {
|
|
1042
1055
|
value += next;
|
|
1043
1056
|
|
|
1044
|
-
if (next === CHAR_LEFT_SQUARE_BRACKET) {
|
|
1057
|
+
if (next === CHAR_LEFT_SQUARE_BRACKET$1) {
|
|
1045
1058
|
brackets++;
|
|
1046
1059
|
continue;
|
|
1047
1060
|
}
|
|
@@ -1051,7 +1064,7 @@ const parse = (input, options = {}) => {
|
|
|
1051
1064
|
continue;
|
|
1052
1065
|
}
|
|
1053
1066
|
|
|
1054
|
-
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
1067
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET$1) {
|
|
1055
1068
|
brackets--;
|
|
1056
1069
|
|
|
1057
1070
|
if (brackets === 0) {
|
|
@@ -1068,14 +1081,14 @@ const parse = (input, options = {}) => {
|
|
|
1068
1081
|
* Parentheses
|
|
1069
1082
|
*/
|
|
1070
1083
|
|
|
1071
|
-
if (value === CHAR_LEFT_PARENTHESES) {
|
|
1084
|
+
if (value === CHAR_LEFT_PARENTHESES$1) {
|
|
1072
1085
|
block = push({ type: 'paren', nodes: [] });
|
|
1073
1086
|
stack.push(block);
|
|
1074
1087
|
push({ type: 'text', value });
|
|
1075
1088
|
continue;
|
|
1076
1089
|
}
|
|
1077
1090
|
|
|
1078
|
-
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
1091
|
+
if (value === CHAR_RIGHT_PARENTHESES$1) {
|
|
1079
1092
|
if (block.type !== 'paren') {
|
|
1080
1093
|
push({ type: 'text', value });
|
|
1081
1094
|
continue;
|
|
@@ -1120,7 +1133,7 @@ const parse = (input, options = {}) => {
|
|
|
1120
1133
|
* Left curly brace: '{'
|
|
1121
1134
|
*/
|
|
1122
1135
|
|
|
1123
|
-
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
1136
|
+
if (value === CHAR_LEFT_CURLY_BRACE$1) {
|
|
1124
1137
|
depth++;
|
|
1125
1138
|
|
|
1126
1139
|
let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
|
|
@@ -1145,7 +1158,7 @@ const parse = (input, options = {}) => {
|
|
|
1145
1158
|
* Right curly brace: '}'
|
|
1146
1159
|
*/
|
|
1147
1160
|
|
|
1148
|
-
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
1161
|
+
if (value === CHAR_RIGHT_CURLY_BRACE$1) {
|
|
1149
1162
|
if (block.type !== 'brace') {
|
|
1150
1163
|
push({ type: 'text', value });
|
|
1151
1164
|
continue;
|
|
@@ -1166,11 +1179,11 @@ const parse = (input, options = {}) => {
|
|
|
1166
1179
|
* Comma: ','
|
|
1167
1180
|
*/
|
|
1168
1181
|
|
|
1169
|
-
if (value === CHAR_COMMA && depth > 0) {
|
|
1182
|
+
if (value === CHAR_COMMA$1 && depth > 0) {
|
|
1170
1183
|
if (block.ranges > 0) {
|
|
1171
1184
|
block.ranges = 0;
|
|
1172
1185
|
let open = block.nodes.shift();
|
|
1173
|
-
block.nodes = [open, { type: 'text', value: stringify(block) }];
|
|
1186
|
+
block.nodes = [open, { type: 'text', value: stringify$1(block) }];
|
|
1174
1187
|
}
|
|
1175
1188
|
|
|
1176
1189
|
push({ type: 'comma', value });
|
|
@@ -1182,7 +1195,7 @@ const parse = (input, options = {}) => {
|
|
|
1182
1195
|
* Dot: '.'
|
|
1183
1196
|
*/
|
|
1184
1197
|
|
|
1185
|
-
if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
|
|
1198
|
+
if (value === CHAR_DOT$1 && depth > 0 && block.commas === 0) {
|
|
1186
1199
|
let siblings = block.nodes;
|
|
1187
1200
|
|
|
1188
1201
|
if (depth === 0 || siblings.length === 0) {
|
|
@@ -1254,7 +1267,12 @@ const parse = (input, options = {}) => {
|
|
|
1254
1267
|
return ast;
|
|
1255
1268
|
};
|
|
1256
1269
|
|
|
1257
|
-
var parse_1 = parse;
|
|
1270
|
+
var parse_1$1 = parse$3;
|
|
1271
|
+
|
|
1272
|
+
const stringify = stringify$4;
|
|
1273
|
+
const compile = compile_1;
|
|
1274
|
+
const expand = expand_1;
|
|
1275
|
+
const parse$2 = parse_1$1;
|
|
1258
1276
|
|
|
1259
1277
|
/**
|
|
1260
1278
|
* Expand the given pattern or create a regex-compatible string.
|
|
@@ -1270,12 +1288,12 @@ var parse_1 = parse;
|
|
|
1270
1288
|
* @api public
|
|
1271
1289
|
*/
|
|
1272
1290
|
|
|
1273
|
-
const braces = (input, options = {}) => {
|
|
1291
|
+
const braces$1 = (input, options = {}) => {
|
|
1274
1292
|
let output = [];
|
|
1275
1293
|
|
|
1276
1294
|
if (Array.isArray(input)) {
|
|
1277
1295
|
for (let pattern of input) {
|
|
1278
|
-
let result = braces.create(pattern, options);
|
|
1296
|
+
let result = braces$1.create(pattern, options);
|
|
1279
1297
|
if (Array.isArray(result)) {
|
|
1280
1298
|
output.push(...result);
|
|
1281
1299
|
} else {
|
|
@@ -1283,7 +1301,7 @@ const braces = (input, options = {}) => {
|
|
|
1283
1301
|
}
|
|
1284
1302
|
}
|
|
1285
1303
|
} else {
|
|
1286
|
-
output = [].concat(braces.create(input, options));
|
|
1304
|
+
output = [].concat(braces$1.create(input, options));
|
|
1287
1305
|
}
|
|
1288
1306
|
|
|
1289
1307
|
if (options && options.expand === true && options.nodupes === true) {
|
|
@@ -1306,7 +1324,7 @@ const braces = (input, options = {}) => {
|
|
|
1306
1324
|
* @api public
|
|
1307
1325
|
*/
|
|
1308
1326
|
|
|
1309
|
-
braces.parse = (input, options = {}) =>
|
|
1327
|
+
braces$1.parse = (input, options = {}) => parse$2(input, options);
|
|
1310
1328
|
|
|
1311
1329
|
/**
|
|
1312
1330
|
* Creates a braces string from an AST, or an AST node.
|
|
@@ -1322,9 +1340,9 @@ braces.parse = (input, options = {}) => parse_1(input, options);
|
|
|
1322
1340
|
* @api public
|
|
1323
1341
|
*/
|
|
1324
1342
|
|
|
1325
|
-
braces.stringify = (input, options = {}) => {
|
|
1343
|
+
braces$1.stringify = (input, options = {}) => {
|
|
1326
1344
|
if (typeof input === 'string') {
|
|
1327
|
-
return stringify(braces.parse(input, options), options);
|
|
1345
|
+
return stringify(braces$1.parse(input, options), options);
|
|
1328
1346
|
}
|
|
1329
1347
|
return stringify(input, options);
|
|
1330
1348
|
};
|
|
@@ -1344,11 +1362,11 @@ braces.stringify = (input, options = {}) => {
|
|
|
1344
1362
|
* @api public
|
|
1345
1363
|
*/
|
|
1346
1364
|
|
|
1347
|
-
braces.compile = (input, options = {}) => {
|
|
1365
|
+
braces$1.compile = (input, options = {}) => {
|
|
1348
1366
|
if (typeof input === 'string') {
|
|
1349
|
-
input = braces.parse(input, options);
|
|
1367
|
+
input = braces$1.parse(input, options);
|
|
1350
1368
|
}
|
|
1351
|
-
return
|
|
1369
|
+
return compile(input, options);
|
|
1352
1370
|
};
|
|
1353
1371
|
|
|
1354
1372
|
/**
|
|
@@ -1368,12 +1386,12 @@ braces.compile = (input, options = {}) => {
|
|
|
1368
1386
|
* @api public
|
|
1369
1387
|
*/
|
|
1370
1388
|
|
|
1371
|
-
braces.expand = (input, options = {}) => {
|
|
1389
|
+
braces$1.expand = (input, options = {}) => {
|
|
1372
1390
|
if (typeof input === 'string') {
|
|
1373
|
-
input = braces.parse(input, options);
|
|
1391
|
+
input = braces$1.parse(input, options);
|
|
1374
1392
|
}
|
|
1375
1393
|
|
|
1376
|
-
let result =
|
|
1394
|
+
let result = expand(input, options);
|
|
1377
1395
|
|
|
1378
1396
|
// filter out empty strings if specified
|
|
1379
1397
|
if (options.noempty === true) {
|
|
@@ -1404,22 +1422,25 @@ braces.expand = (input, options = {}) => {
|
|
|
1404
1422
|
* @api public
|
|
1405
1423
|
*/
|
|
1406
1424
|
|
|
1407
|
-
braces.create = (input, options = {}) => {
|
|
1425
|
+
braces$1.create = (input, options = {}) => {
|
|
1408
1426
|
if (input === '' || input.length < 3) {
|
|
1409
1427
|
return [input];
|
|
1410
1428
|
}
|
|
1411
1429
|
|
|
1412
1430
|
return options.expand !== true
|
|
1413
|
-
? braces.compile(input, options)
|
|
1414
|
-
: braces.expand(input, options);
|
|
1431
|
+
? braces$1.compile(input, options)
|
|
1432
|
+
: braces$1.expand(input, options);
|
|
1415
1433
|
};
|
|
1416
1434
|
|
|
1417
1435
|
/**
|
|
1418
1436
|
* Expose "braces"
|
|
1419
1437
|
*/
|
|
1420
1438
|
|
|
1421
|
-
var braces_1 = braces;
|
|
1439
|
+
var braces_1 = braces$1;
|
|
1422
1440
|
|
|
1441
|
+
var utils$3 = {};
|
|
1442
|
+
|
|
1443
|
+
const path$2 = path$3;
|
|
1423
1444
|
const WIN_SLASH = '\\\\/';
|
|
1424
1445
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
1425
1446
|
|
|
@@ -1441,7 +1462,7 @@ const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
|
|
1441
1462
|
const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
|
1442
1463
|
const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
|
1443
1464
|
const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
|
1444
|
-
const STAR = `${QMARK}*?`;
|
|
1465
|
+
const STAR$1 = `${QMARK}*?`;
|
|
1445
1466
|
|
|
1446
1467
|
const POSIX_CHARS = {
|
|
1447
1468
|
DOT_LITERAL,
|
|
@@ -1457,7 +1478,7 @@ const POSIX_CHARS = {
|
|
|
1457
1478
|
NO_DOT_SLASH,
|
|
1458
1479
|
NO_DOTS_SLASH,
|
|
1459
1480
|
QMARK_NO_DOT,
|
|
1460
|
-
STAR,
|
|
1481
|
+
STAR: STAR$1,
|
|
1461
1482
|
START_ANCHOR
|
|
1462
1483
|
};
|
|
1463
1484
|
|
|
@@ -1485,7 +1506,7 @@ const WINDOWS_CHARS = {
|
|
|
1485
1506
|
* POSIX Bracket Regex
|
|
1486
1507
|
*/
|
|
1487
1508
|
|
|
1488
|
-
const POSIX_REGEX_SOURCE = {
|
|
1509
|
+
const POSIX_REGEX_SOURCE$1 = {
|
|
1489
1510
|
alnum: 'a-zA-Z0-9',
|
|
1490
1511
|
alpha: 'a-zA-Z',
|
|
1491
1512
|
ascii: '\\x00-\\x7F',
|
|
@@ -1502,9 +1523,9 @@ const POSIX_REGEX_SOURCE = {
|
|
|
1502
1523
|
xdigit: 'A-Fa-f0-9'
|
|
1503
1524
|
};
|
|
1504
1525
|
|
|
1505
|
-
var constants$
|
|
1526
|
+
var constants$3 = {
|
|
1506
1527
|
MAX_LENGTH: 1024 * 64,
|
|
1507
|
-
POSIX_REGEX_SOURCE,
|
|
1528
|
+
POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1,
|
|
1508
1529
|
|
|
1509
1530
|
// regular expressions
|
|
1510
1531
|
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
@@ -1572,7 +1593,7 @@ var constants$1 = {
|
|
|
1572
1593
|
CHAR_VERTICAL_LINE: 124, /* | */
|
|
1573
1594
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
|
|
1574
1595
|
|
|
1575
|
-
SEP:
|
|
1596
|
+
SEP: path$2.sep,
|
|
1576
1597
|
|
|
1577
1598
|
/**
|
|
1578
1599
|
* Create EXTGLOB_CHARS
|
|
@@ -1597,16 +1618,16 @@ var constants$1 = {
|
|
|
1597
1618
|
}
|
|
1598
1619
|
};
|
|
1599
1620
|
|
|
1600
|
-
|
|
1601
|
-
|
|
1621
|
+
(function (exports) {
|
|
1602
1622
|
|
|
1623
|
+
const path = path$3;
|
|
1603
1624
|
const win32 = process.platform === 'win32';
|
|
1604
1625
|
const {
|
|
1605
1626
|
REGEX_BACKSLASH,
|
|
1606
1627
|
REGEX_REMOVE_BACKSLASH,
|
|
1607
1628
|
REGEX_SPECIAL_CHARS,
|
|
1608
1629
|
REGEX_SPECIAL_CHARS_GLOBAL
|
|
1609
|
-
} = constants$
|
|
1630
|
+
} = constants$3;
|
|
1610
1631
|
|
|
1611
1632
|
exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
|
1612
1633
|
exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
|
|
@@ -1632,7 +1653,7 @@ exports.isWindows = options => {
|
|
|
1632
1653
|
if (options && typeof options.windows === 'boolean') {
|
|
1633
1654
|
return options.windows;
|
|
1634
1655
|
}
|
|
1635
|
-
return win32 === true ||
|
|
1656
|
+
return win32 === true || path.sep === '\\';
|
|
1636
1657
|
};
|
|
1637
1658
|
|
|
1638
1659
|
exports.escapeLast = (input, char, lastIdx) => {
|
|
@@ -1661,25 +1682,26 @@ exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
|
1661
1682
|
}
|
|
1662
1683
|
return output;
|
|
1663
1684
|
};
|
|
1664
|
-
});
|
|
1685
|
+
}(utils$3));
|
|
1665
1686
|
|
|
1687
|
+
const utils$2 = utils$3;
|
|
1666
1688
|
const {
|
|
1667
1689
|
CHAR_ASTERISK, /* * */
|
|
1668
1690
|
CHAR_AT, /* @ */
|
|
1669
1691
|
CHAR_BACKWARD_SLASH, /* \ */
|
|
1670
|
-
CHAR_COMMA
|
|
1671
|
-
CHAR_DOT
|
|
1692
|
+
CHAR_COMMA, /* , */
|
|
1693
|
+
CHAR_DOT, /* . */
|
|
1672
1694
|
CHAR_EXCLAMATION_MARK, /* ! */
|
|
1673
1695
|
CHAR_FORWARD_SLASH, /* / */
|
|
1674
|
-
CHAR_LEFT_CURLY_BRACE
|
|
1675
|
-
CHAR_LEFT_PARENTHESES
|
|
1676
|
-
CHAR_LEFT_SQUARE_BRACKET
|
|
1696
|
+
CHAR_LEFT_CURLY_BRACE, /* { */
|
|
1697
|
+
CHAR_LEFT_PARENTHESES, /* ( */
|
|
1698
|
+
CHAR_LEFT_SQUARE_BRACKET, /* [ */
|
|
1677
1699
|
CHAR_PLUS, /* + */
|
|
1678
1700
|
CHAR_QUESTION_MARK, /* ? */
|
|
1679
|
-
CHAR_RIGHT_CURLY_BRACE
|
|
1680
|
-
CHAR_RIGHT_PARENTHESES
|
|
1681
|
-
CHAR_RIGHT_SQUARE_BRACKET
|
|
1682
|
-
} = constants$
|
|
1701
|
+
CHAR_RIGHT_CURLY_BRACE, /* } */
|
|
1702
|
+
CHAR_RIGHT_PARENTHESES, /* ) */
|
|
1703
|
+
CHAR_RIGHT_SQUARE_BRACKET /* ] */
|
|
1704
|
+
} = constants$3;
|
|
1683
1705
|
|
|
1684
1706
|
const isPathSeparator = code => {
|
|
1685
1707
|
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
@@ -1707,7 +1729,7 @@ const depth = token => {
|
|
|
1707
1729
|
* @api public
|
|
1708
1730
|
*/
|
|
1709
1731
|
|
|
1710
|
-
const scan = (input, options) => {
|
|
1732
|
+
const scan$1 = (input, options) => {
|
|
1711
1733
|
const opts = options || {};
|
|
1712
1734
|
|
|
1713
1735
|
const length = input.length - 1;
|
|
@@ -1749,13 +1771,13 @@ const scan = (input, options) => {
|
|
|
1749
1771
|
backslashes = token.backslashes = true;
|
|
1750
1772
|
code = advance();
|
|
1751
1773
|
|
|
1752
|
-
if (code === CHAR_LEFT_CURLY_BRACE
|
|
1774
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
1753
1775
|
braceEscaped = true;
|
|
1754
1776
|
}
|
|
1755
1777
|
continue;
|
|
1756
1778
|
}
|
|
1757
1779
|
|
|
1758
|
-
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE
|
|
1780
|
+
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
|
1759
1781
|
braces++;
|
|
1760
1782
|
|
|
1761
1783
|
while (eos() !== true && (code = advance())) {
|
|
@@ -1765,12 +1787,12 @@ const scan = (input, options) => {
|
|
|
1765
1787
|
continue;
|
|
1766
1788
|
}
|
|
1767
1789
|
|
|
1768
|
-
if (code === CHAR_LEFT_CURLY_BRACE
|
|
1790
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
1769
1791
|
braces++;
|
|
1770
1792
|
continue;
|
|
1771
1793
|
}
|
|
1772
1794
|
|
|
1773
|
-
if (braceEscaped !== true && code === CHAR_DOT
|
|
1795
|
+
if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
1774
1796
|
isBrace = token.isBrace = true;
|
|
1775
1797
|
isGlob = token.isGlob = true;
|
|
1776
1798
|
finished = true;
|
|
@@ -1782,7 +1804,7 @@ const scan = (input, options) => {
|
|
|
1782
1804
|
break;
|
|
1783
1805
|
}
|
|
1784
1806
|
|
|
1785
|
-
if (braceEscaped !== true && code === CHAR_COMMA
|
|
1807
|
+
if (braceEscaped !== true && code === CHAR_COMMA) {
|
|
1786
1808
|
isBrace = token.isBrace = true;
|
|
1787
1809
|
isGlob = token.isGlob = true;
|
|
1788
1810
|
finished = true;
|
|
@@ -1794,7 +1816,7 @@ const scan = (input, options) => {
|
|
|
1794
1816
|
break;
|
|
1795
1817
|
}
|
|
1796
1818
|
|
|
1797
|
-
if (code === CHAR_RIGHT_CURLY_BRACE
|
|
1819
|
+
if (code === CHAR_RIGHT_CURLY_BRACE) {
|
|
1798
1820
|
braces--;
|
|
1799
1821
|
|
|
1800
1822
|
if (braces === 0) {
|
|
@@ -1819,7 +1841,7 @@ const scan = (input, options) => {
|
|
|
1819
1841
|
token = { value: '', depth: 0, isGlob: false };
|
|
1820
1842
|
|
|
1821
1843
|
if (finished === true) continue;
|
|
1822
|
-
if (prev === CHAR_DOT
|
|
1844
|
+
if (prev === CHAR_DOT && index === (start + 1)) {
|
|
1823
1845
|
start += 2;
|
|
1824
1846
|
continue;
|
|
1825
1847
|
}
|
|
@@ -1835,7 +1857,7 @@ const scan = (input, options) => {
|
|
|
1835
1857
|
|| code === CHAR_QUESTION_MARK
|
|
1836
1858
|
|| code === CHAR_EXCLAMATION_MARK;
|
|
1837
1859
|
|
|
1838
|
-
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES
|
|
1860
|
+
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
1839
1861
|
isGlob = token.isGlob = true;
|
|
1840
1862
|
isExtglob = token.isExtglob = true;
|
|
1841
1863
|
finished = true;
|
|
@@ -1848,7 +1870,7 @@ const scan = (input, options) => {
|
|
|
1848
1870
|
continue;
|
|
1849
1871
|
}
|
|
1850
1872
|
|
|
1851
|
-
if (code === CHAR_RIGHT_PARENTHESES
|
|
1873
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
1852
1874
|
isGlob = token.isGlob = true;
|
|
1853
1875
|
finished = true;
|
|
1854
1876
|
break;
|
|
@@ -1881,7 +1903,7 @@ const scan = (input, options) => {
|
|
|
1881
1903
|
break;
|
|
1882
1904
|
}
|
|
1883
1905
|
|
|
1884
|
-
if (code === CHAR_LEFT_SQUARE_BRACKET
|
|
1906
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
1885
1907
|
while (eos() !== true && (next = advance())) {
|
|
1886
1908
|
if (next === CHAR_BACKWARD_SLASH) {
|
|
1887
1909
|
backslashes = token.backslashes = true;
|
|
@@ -1889,7 +1911,7 @@ const scan = (input, options) => {
|
|
|
1889
1911
|
continue;
|
|
1890
1912
|
}
|
|
1891
1913
|
|
|
1892
|
-
if (next === CHAR_RIGHT_SQUARE_BRACKET
|
|
1914
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
1893
1915
|
isBracket = token.isBracket = true;
|
|
1894
1916
|
isGlob = token.isGlob = true;
|
|
1895
1917
|
finished = true;
|
|
@@ -1908,18 +1930,18 @@ const scan = (input, options) => {
|
|
|
1908
1930
|
continue;
|
|
1909
1931
|
}
|
|
1910
1932
|
|
|
1911
|
-
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES
|
|
1933
|
+
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
1912
1934
|
isGlob = token.isGlob = true;
|
|
1913
1935
|
|
|
1914
1936
|
if (scanToEnd === true) {
|
|
1915
1937
|
while (eos() !== true && (code = advance())) {
|
|
1916
|
-
if (code === CHAR_LEFT_PARENTHESES
|
|
1938
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
1917
1939
|
backslashes = token.backslashes = true;
|
|
1918
1940
|
code = advance();
|
|
1919
1941
|
continue;
|
|
1920
1942
|
}
|
|
1921
1943
|
|
|
1922
|
-
if (code === CHAR_RIGHT_PARENTHESES
|
|
1944
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
1923
1945
|
finished = true;
|
|
1924
1946
|
break;
|
|
1925
1947
|
}
|
|
@@ -1972,10 +1994,10 @@ const scan = (input, options) => {
|
|
|
1972
1994
|
}
|
|
1973
1995
|
|
|
1974
1996
|
if (opts.unescape === true) {
|
|
1975
|
-
if (glob) glob = utils$
|
|
1997
|
+
if (glob) glob = utils$2.removeBackslashes(glob);
|
|
1976
1998
|
|
|
1977
1999
|
if (base && backslashes === true) {
|
|
1978
|
-
base = utils$
|
|
2000
|
+
base = utils$2.removeBackslashes(base);
|
|
1979
2001
|
}
|
|
1980
2002
|
}
|
|
1981
2003
|
|
|
@@ -2042,19 +2064,22 @@ const scan = (input, options) => {
|
|
|
2042
2064
|
return state;
|
|
2043
2065
|
};
|
|
2044
2066
|
|
|
2045
|
-
var scan_1 = scan;
|
|
2067
|
+
var scan_1 = scan$1;
|
|
2068
|
+
|
|
2069
|
+
const constants$2 = constants$3;
|
|
2070
|
+
const utils$1 = utils$3;
|
|
2046
2071
|
|
|
2047
2072
|
/**
|
|
2048
2073
|
* Constants
|
|
2049
2074
|
*/
|
|
2050
2075
|
|
|
2051
2076
|
const {
|
|
2052
|
-
MAX_LENGTH
|
|
2053
|
-
POSIX_REGEX_SOURCE
|
|
2077
|
+
MAX_LENGTH,
|
|
2078
|
+
POSIX_REGEX_SOURCE,
|
|
2054
2079
|
REGEX_NON_SPECIAL_CHARS,
|
|
2055
2080
|
REGEX_SPECIAL_CHARS_BACKREF,
|
|
2056
2081
|
REPLACEMENTS
|
|
2057
|
-
} = constants$
|
|
2082
|
+
} = constants$2;
|
|
2058
2083
|
|
|
2059
2084
|
/**
|
|
2060
2085
|
* Helpers
|
|
@@ -2094,7 +2119,7 @@ const parse$1 = (input, options) => {
|
|
|
2094
2119
|
input = REPLACEMENTS[input] || input;
|
|
2095
2120
|
|
|
2096
2121
|
const opts = { ...options };
|
|
2097
|
-
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH
|
|
2122
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
2098
2123
|
|
|
2099
2124
|
let len = input.length;
|
|
2100
2125
|
if (len > max) {
|
|
@@ -2108,8 +2133,8 @@ const parse$1 = (input, options) => {
|
|
|
2108
2133
|
const win32 = utils$1.isWindows(options);
|
|
2109
2134
|
|
|
2110
2135
|
// create constants based on platform, for windows or posix
|
|
2111
|
-
const PLATFORM_CHARS = constants$
|
|
2112
|
-
const EXTGLOB_CHARS = constants$
|
|
2136
|
+
const PLATFORM_CHARS = constants$2.globChars(win32);
|
|
2137
|
+
const EXTGLOB_CHARS = constants$2.extglobChars(PLATFORM_CHARS);
|
|
2113
2138
|
|
|
2114
2139
|
const {
|
|
2115
2140
|
DOT_LITERAL,
|
|
@@ -2416,7 +2441,7 @@ const parse$1 = (input, options) => {
|
|
|
2416
2441
|
const idx = prev.value.lastIndexOf('[');
|
|
2417
2442
|
const pre = prev.value.slice(0, idx);
|
|
2418
2443
|
const rest = prev.value.slice(idx + 2);
|
|
2419
|
-
const posix = POSIX_REGEX_SOURCE
|
|
2444
|
+
const posix = POSIX_REGEX_SOURCE[rest];
|
|
2420
2445
|
if (posix) {
|
|
2421
2446
|
prev.value = pre + posix;
|
|
2422
2447
|
state.backtrack = true;
|
|
@@ -3024,7 +3049,7 @@ const parse$1 = (input, options) => {
|
|
|
3024
3049
|
|
|
3025
3050
|
parse$1.fastpaths = (input, options) => {
|
|
3026
3051
|
const opts = { ...options };
|
|
3027
|
-
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH
|
|
3052
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
3028
3053
|
const len = input.length;
|
|
3029
3054
|
if (len > max) {
|
|
3030
3055
|
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
@@ -3044,7 +3069,7 @@ parse$1.fastpaths = (input, options) => {
|
|
|
3044
3069
|
NO_DOTS_SLASH,
|
|
3045
3070
|
STAR,
|
|
3046
3071
|
START_ANCHOR
|
|
3047
|
-
} = constants$
|
|
3072
|
+
} = constants$2.globChars(win32);
|
|
3048
3073
|
|
|
3049
3074
|
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
3050
3075
|
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
@@ -3109,9 +3134,14 @@ parse$1.fastpaths = (input, options) => {
|
|
|
3109
3134
|
return source;
|
|
3110
3135
|
};
|
|
3111
3136
|
|
|
3112
|
-
var parse_1
|
|
3137
|
+
var parse_1 = parse$1;
|
|
3113
3138
|
|
|
3114
|
-
const
|
|
3139
|
+
const path$1 = path$3;
|
|
3140
|
+
const scan = scan_1;
|
|
3141
|
+
const parse = parse_1;
|
|
3142
|
+
const utils = utils$3;
|
|
3143
|
+
const constants$1 = constants$3;
|
|
3144
|
+
const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
|
|
3115
3145
|
|
|
3116
3146
|
/**
|
|
3117
3147
|
* Creates a matcher function from one or more glob patterns. The
|
|
@@ -3135,9 +3165,9 @@ const isObject$1 = val => val && typeof val === 'object' && !Array.isArray(val);
|
|
|
3135
3165
|
* @api public
|
|
3136
3166
|
*/
|
|
3137
3167
|
|
|
3138
|
-
const picomatch = (glob, options, returnState = false) => {
|
|
3168
|
+
const picomatch$3 = (glob, options, returnState = false) => {
|
|
3139
3169
|
if (Array.isArray(glob)) {
|
|
3140
|
-
const fns = glob.map(input => picomatch(input, options, returnState));
|
|
3170
|
+
const fns = glob.map(input => picomatch$3(input, options, returnState));
|
|
3141
3171
|
const arrayMatcher = str => {
|
|
3142
3172
|
for (const isMatch of fns) {
|
|
3143
3173
|
const state = isMatch(str);
|
|
@@ -3148,17 +3178,17 @@ const picomatch = (glob, options, returnState = false) => {
|
|
|
3148
3178
|
return arrayMatcher;
|
|
3149
3179
|
}
|
|
3150
3180
|
|
|
3151
|
-
const isState = isObject
|
|
3181
|
+
const isState = isObject(glob) && glob.tokens && glob.input;
|
|
3152
3182
|
|
|
3153
3183
|
if (glob === '' || (typeof glob !== 'string' && !isState)) {
|
|
3154
3184
|
throw new TypeError('Expected pattern to be a non-empty string');
|
|
3155
3185
|
}
|
|
3156
3186
|
|
|
3157
3187
|
const opts = options || {};
|
|
3158
|
-
const posix = utils
|
|
3188
|
+
const posix = utils.isWindows(options);
|
|
3159
3189
|
const regex = isState
|
|
3160
|
-
? picomatch.compileRe(glob, options)
|
|
3161
|
-
: picomatch.makeRe(glob, options, false, true);
|
|
3190
|
+
? picomatch$3.compileRe(glob, options)
|
|
3191
|
+
: picomatch$3.makeRe(glob, options, false, true);
|
|
3162
3192
|
|
|
3163
3193
|
const state = regex.state;
|
|
3164
3194
|
delete regex.state;
|
|
@@ -3166,11 +3196,11 @@ const picomatch = (glob, options, returnState = false) => {
|
|
|
3166
3196
|
let isIgnored = () => false;
|
|
3167
3197
|
if (opts.ignore) {
|
|
3168
3198
|
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
3169
|
-
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
3199
|
+
isIgnored = picomatch$3(opts.ignore, ignoreOpts, returnState);
|
|
3170
3200
|
}
|
|
3171
3201
|
|
|
3172
3202
|
const matcher = (input, returnObject = false) => {
|
|
3173
|
-
const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
|
|
3203
|
+
const { isMatch, match, output } = picomatch$3.test(input, regex, options, { glob, posix });
|
|
3174
3204
|
const result = { glob, state, regex, posix, input, output, match, isMatch };
|
|
3175
3205
|
|
|
3176
3206
|
if (typeof opts.onResult === 'function') {
|
|
@@ -3220,7 +3250,7 @@ const picomatch = (glob, options, returnState = false) => {
|
|
|
3220
3250
|
* @api public
|
|
3221
3251
|
*/
|
|
3222
3252
|
|
|
3223
|
-
picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
3253
|
+
picomatch$3.test = (input, regex, options, { glob, posix } = {}) => {
|
|
3224
3254
|
if (typeof input !== 'string') {
|
|
3225
3255
|
throw new TypeError('Expected input to be a string');
|
|
3226
3256
|
}
|
|
@@ -3230,7 +3260,7 @@ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
|
3230
3260
|
}
|
|
3231
3261
|
|
|
3232
3262
|
const opts = options || {};
|
|
3233
|
-
const format = opts.format || (posix ? utils
|
|
3263
|
+
const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
3234
3264
|
let match = input === glob;
|
|
3235
3265
|
let output = (match && format) ? format(input) : input;
|
|
3236
3266
|
|
|
@@ -3241,7 +3271,7 @@ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
|
3241
3271
|
|
|
3242
3272
|
if (match === false || opts.capture === true) {
|
|
3243
3273
|
if (opts.matchBase === true || opts.basename === true) {
|
|
3244
|
-
match = picomatch.matchBase(input, regex, options, posix);
|
|
3274
|
+
match = picomatch$3.matchBase(input, regex, options, posix);
|
|
3245
3275
|
} else {
|
|
3246
3276
|
match = regex.exec(output);
|
|
3247
3277
|
}
|
|
@@ -3264,9 +3294,9 @@ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
|
3264
3294
|
* @api public
|
|
3265
3295
|
*/
|
|
3266
3296
|
|
|
3267
|
-
picomatch.matchBase = (input, glob, options, posix = utils
|
|
3268
|
-
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
3269
|
-
return regex.test(
|
|
3297
|
+
picomatch$3.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
|
3298
|
+
const regex = glob instanceof RegExp ? glob : picomatch$3.makeRe(glob, options);
|
|
3299
|
+
return regex.test(path$1.basename(input));
|
|
3270
3300
|
};
|
|
3271
3301
|
|
|
3272
3302
|
/**
|
|
@@ -3286,7 +3316,7 @@ picomatch.matchBase = (input, glob, options, posix = utils$1.isWindows(options))
|
|
|
3286
3316
|
* @api public
|
|
3287
3317
|
*/
|
|
3288
3318
|
|
|
3289
|
-
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
3319
|
+
picomatch$3.isMatch = (str, patterns, options) => picomatch$3(patterns, options)(str);
|
|
3290
3320
|
|
|
3291
3321
|
/**
|
|
3292
3322
|
* Parse a glob pattern to create the source string for a regular
|
|
@@ -3302,9 +3332,9 @@ picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str
|
|
|
3302
3332
|
* @api public
|
|
3303
3333
|
*/
|
|
3304
3334
|
|
|
3305
|
-
picomatch.parse = (pattern, options) => {
|
|
3306
|
-
if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));
|
|
3307
|
-
return
|
|
3335
|
+
picomatch$3.parse = (pattern, options) => {
|
|
3336
|
+
if (Array.isArray(pattern)) return pattern.map(p => picomatch$3.parse(p, options));
|
|
3337
|
+
return parse(pattern, { ...options, fastpaths: false });
|
|
3308
3338
|
};
|
|
3309
3339
|
|
|
3310
3340
|
/**
|
|
@@ -3334,7 +3364,7 @@ picomatch.parse = (pattern, options) => {
|
|
|
3334
3364
|
* @api public
|
|
3335
3365
|
*/
|
|
3336
3366
|
|
|
3337
|
-
picomatch.scan = (input, options) =>
|
|
3367
|
+
picomatch$3.scan = (input, options) => scan(input, options);
|
|
3338
3368
|
|
|
3339
3369
|
/**
|
|
3340
3370
|
* Create a regular expression from a parsed glob pattern.
|
|
@@ -3353,7 +3383,7 @@ picomatch.scan = (input, options) => scan_1(input, options);
|
|
|
3353
3383
|
* @api public
|
|
3354
3384
|
*/
|
|
3355
3385
|
|
|
3356
|
-
picomatch.compileRe = (parsed, options, returnOutput = false, returnState = false) => {
|
|
3386
|
+
picomatch$3.compileRe = (parsed, options, returnOutput = false, returnState = false) => {
|
|
3357
3387
|
if (returnOutput === true) {
|
|
3358
3388
|
return parsed.output;
|
|
3359
3389
|
}
|
|
@@ -3367,7 +3397,7 @@ picomatch.compileRe = (parsed, options, returnOutput = false, returnState = fals
|
|
|
3367
3397
|
source = `^(?!${source}).*$`;
|
|
3368
3398
|
}
|
|
3369
3399
|
|
|
3370
|
-
const regex = picomatch.toRegex(source, options);
|
|
3400
|
+
const regex = picomatch$3.toRegex(source, options);
|
|
3371
3401
|
if (returnState === true) {
|
|
3372
3402
|
regex.state = parsed;
|
|
3373
3403
|
}
|
|
@@ -3375,7 +3405,7 @@ picomatch.compileRe = (parsed, options, returnOutput = false, returnState = fals
|
|
|
3375
3405
|
return regex;
|
|
3376
3406
|
};
|
|
3377
3407
|
|
|
3378
|
-
picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => {
|
|
3408
|
+
picomatch$3.makeRe = (input, options, returnOutput = false, returnState = false) => {
|
|
3379
3409
|
if (!input || typeof input !== 'string') {
|
|
3380
3410
|
throw new TypeError('Expected a non-empty string');
|
|
3381
3411
|
}
|
|
@@ -3391,17 +3421,17 @@ picomatch.makeRe = (input, options, returnOutput = false, returnState = false) =
|
|
|
3391
3421
|
}
|
|
3392
3422
|
|
|
3393
3423
|
if (opts.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
|
|
3394
|
-
output =
|
|
3424
|
+
output = parse.fastpaths(input, options);
|
|
3395
3425
|
}
|
|
3396
3426
|
|
|
3397
3427
|
if (output === undefined) {
|
|
3398
|
-
parsed =
|
|
3428
|
+
parsed = parse(input, options);
|
|
3399
3429
|
parsed.prefix = prefix + (parsed.prefix || '');
|
|
3400
3430
|
} else {
|
|
3401
3431
|
parsed.output = output;
|
|
3402
3432
|
}
|
|
3403
3433
|
|
|
3404
|
-
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
3434
|
+
return picomatch$3.compileRe(parsed, options, returnOutput, returnState);
|
|
3405
3435
|
};
|
|
3406
3436
|
|
|
3407
3437
|
/**
|
|
@@ -3421,7 +3451,7 @@ picomatch.makeRe = (input, options, returnOutput = false, returnState = false) =
|
|
|
3421
3451
|
* @api public
|
|
3422
3452
|
*/
|
|
3423
3453
|
|
|
3424
|
-
picomatch.toRegex = (source, options) => {
|
|
3454
|
+
picomatch$3.toRegex = (source, options) => {
|
|
3425
3455
|
try {
|
|
3426
3456
|
const opts = options || {};
|
|
3427
3457
|
return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
|
|
@@ -3436,25 +3466,28 @@ picomatch.toRegex = (source, options) => {
|
|
|
3436
3466
|
* @return {Object}
|
|
3437
3467
|
*/
|
|
3438
3468
|
|
|
3439
|
-
picomatch.constants = constants$1;
|
|
3469
|
+
picomatch$3.constants = constants$1;
|
|
3440
3470
|
|
|
3441
3471
|
/**
|
|
3442
3472
|
* Expose "picomatch"
|
|
3443
3473
|
*/
|
|
3444
3474
|
|
|
3445
|
-
var picomatch_1 = picomatch;
|
|
3475
|
+
var picomatch_1 = picomatch$3;
|
|
3446
3476
|
|
|
3447
|
-
var picomatch$
|
|
3477
|
+
var picomatch$2 = picomatch_1;
|
|
3448
3478
|
|
|
3449
|
-
|
|
3479
|
+
var chokidar = {};
|
|
3450
3480
|
|
|
3451
|
-
const
|
|
3481
|
+
const fs$3 = fs$4;
|
|
3482
|
+
const { Readable } = require$$1;
|
|
3483
|
+
const sysPath$3 = path$3;
|
|
3484
|
+
const { promisify: promisify$3 } = require$$0$1;
|
|
3485
|
+
const picomatch$1 = picomatch$2;
|
|
3452
3486
|
|
|
3453
|
-
|
|
3454
|
-
const
|
|
3455
|
-
const
|
|
3456
|
-
const
|
|
3457
|
-
const realpath = promisify(fs.realpath);
|
|
3487
|
+
const readdir$1 = promisify$3(fs$3.readdir);
|
|
3488
|
+
const stat$3 = promisify$3(fs$3.stat);
|
|
3489
|
+
const lstat$2 = promisify$3(fs$3.lstat);
|
|
3490
|
+
const realpath$1 = promisify$3(fs$3.realpath);
|
|
3458
3491
|
|
|
3459
3492
|
/**
|
|
3460
3493
|
* @typedef {Object} EntryInfo
|
|
@@ -3465,7 +3498,7 @@ const realpath = promisify(fs.realpath);
|
|
|
3465
3498
|
* @property {String} basename
|
|
3466
3499
|
*/
|
|
3467
3500
|
|
|
3468
|
-
const BANG = '!';
|
|
3501
|
+
const BANG$2 = '!';
|
|
3469
3502
|
const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP']);
|
|
3470
3503
|
const FILE_TYPE = 'files';
|
|
3471
3504
|
const DIR_TYPE = 'directories';
|
|
@@ -3489,7 +3522,7 @@ const normalizeFilter = filter => {
|
|
|
3489
3522
|
const negative = [];
|
|
3490
3523
|
for (const item of filter) {
|
|
3491
3524
|
const trimmed = item.trim();
|
|
3492
|
-
if (trimmed.charAt(0) === BANG) {
|
|
3525
|
+
if (trimmed.charAt(0) === BANG$2) {
|
|
3493
3526
|
negative.push(picomatch$1(trimmed.slice(1)));
|
|
3494
3527
|
} else {
|
|
3495
3528
|
positive.push(picomatch$1(trimmed));
|
|
@@ -3534,9 +3567,9 @@ class ReaddirpStream extends Readable {
|
|
|
3534
3567
|
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
3535
3568
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
3536
3569
|
|
|
3537
|
-
const statMethod = opts.lstat ? lstat : stat;
|
|
3570
|
+
const statMethod = opts.lstat ? lstat$2 : stat$3;
|
|
3538
3571
|
// Use bigint stats if it's windows and stat() supports options (node 10+).
|
|
3539
|
-
if (process.platform === 'win32' && stat.length === 3) {
|
|
3572
|
+
if (process.platform === 'win32' && stat$3.length === 3) {
|
|
3540
3573
|
this._stat = path => statMethod(path, { bigint: true });
|
|
3541
3574
|
} else {
|
|
3542
3575
|
this._stat = statMethod;
|
|
@@ -3546,8 +3579,8 @@ class ReaddirpStream extends Readable {
|
|
|
3546
3579
|
this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
|
|
3547
3580
|
this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
|
|
3548
3581
|
this._wantsEverything = type === EVERYTHING_TYPE;
|
|
3549
|
-
this._root = sysPath.resolve(root);
|
|
3550
|
-
this._isDirent = ('Dirent' in fs) && !opts.alwaysStat;
|
|
3582
|
+
this._root = sysPath$3.resolve(root);
|
|
3583
|
+
this._isDirent = ('Dirent' in fs$3) && !opts.alwaysStat;
|
|
3551
3584
|
this._statsProp = this._isDirent ? 'dirent' : 'stats';
|
|
3552
3585
|
this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent };
|
|
3553
3586
|
|
|
@@ -3607,7 +3640,7 @@ class ReaddirpStream extends Readable {
|
|
|
3607
3640
|
async _exploreDir(path, depth) {
|
|
3608
3641
|
let files;
|
|
3609
3642
|
try {
|
|
3610
|
-
files = await readdir(path, this._rdOptions);
|
|
3643
|
+
files = await readdir$1(path, this._rdOptions);
|
|
3611
3644
|
} catch (error) {
|
|
3612
3645
|
this._onError(error);
|
|
3613
3646
|
}
|
|
@@ -3618,8 +3651,8 @@ class ReaddirpStream extends Readable {
|
|
|
3618
3651
|
let entry;
|
|
3619
3652
|
try {
|
|
3620
3653
|
const basename = this._isDirent ? dirent.name : dirent;
|
|
3621
|
-
const fullPath = sysPath.resolve(sysPath.join(path, basename));
|
|
3622
|
-
entry = {path: sysPath.relative(this._root, fullPath), fullPath, basename};
|
|
3654
|
+
const fullPath = sysPath$3.resolve(sysPath$3.join(path, basename));
|
|
3655
|
+
entry = {path: sysPath$3.relative(this._root, fullPath), fullPath, basename};
|
|
3623
3656
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
3624
3657
|
} catch (err) {
|
|
3625
3658
|
this._onError(err);
|
|
@@ -3651,14 +3684,14 @@ class ReaddirpStream extends Readable {
|
|
|
3651
3684
|
if (stats && stats.isSymbolicLink()) {
|
|
3652
3685
|
const full = entry.fullPath;
|
|
3653
3686
|
try {
|
|
3654
|
-
const entryRealPath = await realpath(full);
|
|
3655
|
-
const entryRealPathStats = await lstat(entryRealPath);
|
|
3687
|
+
const entryRealPath = await realpath$1(full);
|
|
3688
|
+
const entryRealPathStats = await lstat$2(entryRealPath);
|
|
3656
3689
|
if (entryRealPathStats.isFile()) {
|
|
3657
3690
|
return 'file';
|
|
3658
3691
|
}
|
|
3659
3692
|
if (entryRealPathStats.isDirectory()) {
|
|
3660
3693
|
const len = entryRealPath.length;
|
|
3661
|
-
if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) {
|
|
3694
|
+
if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath$3.sep) {
|
|
3662
3695
|
return this._onError(new Error(
|
|
3663
3696
|
`Circular symlink detected: "${full}" points to "${entryRealPath}"`
|
|
3664
3697
|
));
|
|
@@ -3694,7 +3727,7 @@ class ReaddirpStream extends Readable {
|
|
|
3694
3727
|
* @param {String} root Root directory
|
|
3695
3728
|
* @param {ReaddirpArguments=} options Options to specify root (start directory), filters and recursion depth
|
|
3696
3729
|
*/
|
|
3697
|
-
const readdirp = (root, options = {}) => {
|
|
3730
|
+
const readdirp$1 = (root, options = {}) => {
|
|
3698
3731
|
let type = options.entryType || options.type;
|
|
3699
3732
|
if (type === 'both') type = FILE_DIR_TYPE; // backwards-compatibility
|
|
3700
3733
|
if (type) options.type = type;
|
|
@@ -3713,18 +3746,20 @@ const readdirp = (root, options = {}) => {
|
|
|
3713
3746
|
const readdirpPromise = (root, options = {}) => {
|
|
3714
3747
|
return new Promise((resolve, reject) => {
|
|
3715
3748
|
const files = [];
|
|
3716
|
-
readdirp(root, options)
|
|
3749
|
+
readdirp$1(root, options)
|
|
3717
3750
|
.on('data', entry => files.push(entry))
|
|
3718
3751
|
.on('end', () => resolve(files))
|
|
3719
3752
|
.on('error', error => reject(error));
|
|
3720
3753
|
});
|
|
3721
3754
|
};
|
|
3722
3755
|
|
|
3723
|
-
readdirp.promise = readdirpPromise;
|
|
3724
|
-
readdirp.ReaddirpStream = ReaddirpStream;
|
|
3725
|
-
readdirp.default = readdirp;
|
|
3756
|
+
readdirp$1.promise = readdirpPromise;
|
|
3757
|
+
readdirp$1.ReaddirpStream = ReaddirpStream;
|
|
3758
|
+
readdirp$1.default = readdirp$1;
|
|
3759
|
+
|
|
3760
|
+
var readdirp_1 = readdirp$1;
|
|
3726
3761
|
|
|
3727
|
-
var
|
|
3762
|
+
var anymatch$2 = {exports: {}};
|
|
3728
3763
|
|
|
3729
3764
|
/*!
|
|
3730
3765
|
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
|
@@ -3732,7 +3767,8 @@ var readdirp_1 = readdirp;
|
|
|
3732
3767
|
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
3733
3768
|
* Released under the MIT License.
|
|
3734
3769
|
*/
|
|
3735
|
-
|
|
3770
|
+
|
|
3771
|
+
var normalizePath$2 = function(path, stripTrailing) {
|
|
3736
3772
|
if (typeof path !== 'string') {
|
|
3737
3773
|
throw new TypeError('expected path to be a string');
|
|
3738
3774
|
}
|
|
@@ -3761,6 +3797,11 @@ var normalizePath = function(path, stripTrailing) {
|
|
|
3761
3797
|
return prefix + segs.join('/');
|
|
3762
3798
|
};
|
|
3763
3799
|
|
|
3800
|
+
Object.defineProperty(anymatch$2.exports, "__esModule", { value: true });
|
|
3801
|
+
|
|
3802
|
+
const picomatch = picomatch$2;
|
|
3803
|
+
const normalizePath$1 = normalizePath$2;
|
|
3804
|
+
|
|
3764
3805
|
/**
|
|
3765
3806
|
* @typedef {(testString: string) => boolean} AnymatchFn
|
|
3766
3807
|
* @typedef {string|RegExp|AnymatchFn} AnymatchPattern
|
|
@@ -3768,7 +3809,7 @@ var normalizePath = function(path, stripTrailing) {
|
|
|
3768
3809
|
*/
|
|
3769
3810
|
const BANG$1 = '!';
|
|
3770
3811
|
const DEFAULT_OPTIONS = {returnIndex: false};
|
|
3771
|
-
const arrify = (item) => Array.isArray(item) ? item : [item];
|
|
3812
|
+
const arrify$1 = (item) => Array.isArray(item) ? item : [item];
|
|
3772
3813
|
|
|
3773
3814
|
/**
|
|
3774
3815
|
* @param {AnymatchPattern} matcher
|
|
@@ -3780,7 +3821,7 @@ const createPattern = (matcher, options) => {
|
|
|
3780
3821
|
return matcher;
|
|
3781
3822
|
}
|
|
3782
3823
|
if (typeof matcher === 'string') {
|
|
3783
|
-
const glob = picomatch
|
|
3824
|
+
const glob = picomatch(matcher, options);
|
|
3784
3825
|
return (string) => matcher === string || glob(string);
|
|
3785
3826
|
}
|
|
3786
3827
|
if (matcher instanceof RegExp) {
|
|
@@ -3803,7 +3844,7 @@ const matchPatterns = (patterns, negPatterns, args, returnIndex) => {
|
|
|
3803
3844
|
throw new TypeError('anymatch: second argument must be a string: got ' +
|
|
3804
3845
|
Object.prototype.toString.call(_path))
|
|
3805
3846
|
}
|
|
3806
|
-
const path = normalizePath(_path);
|
|
3847
|
+
const path = normalizePath$1(_path);
|
|
3807
3848
|
|
|
3808
3849
|
for (let index = 0; index < negPatterns.length; index++) {
|
|
3809
3850
|
const nglob = negPatterns[index];
|
|
@@ -3829,7 +3870,7 @@ const matchPatterns = (patterns, negPatterns, args, returnIndex) => {
|
|
|
3829
3870
|
* @param {object} options
|
|
3830
3871
|
* @returns {boolean|number|Function}
|
|
3831
3872
|
*/
|
|
3832
|
-
const anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => {
|
|
3873
|
+
const anymatch$1 = (matchers, testString, options = DEFAULT_OPTIONS) => {
|
|
3833
3874
|
if (matchers == null) {
|
|
3834
3875
|
throw new TypeError('anymatch: specify first argument');
|
|
3835
3876
|
}
|
|
@@ -3837,11 +3878,11 @@ const anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => {
|
|
|
3837
3878
|
const returnIndex = opts.returnIndex || false;
|
|
3838
3879
|
|
|
3839
3880
|
// Early cache for matchers.
|
|
3840
|
-
const mtchers = arrify(matchers);
|
|
3881
|
+
const mtchers = arrify$1(matchers);
|
|
3841
3882
|
const negatedGlobs = mtchers
|
|
3842
3883
|
.filter(item => typeof item === 'string' && item.charAt(0) === BANG$1)
|
|
3843
3884
|
.map(item => item.slice(1))
|
|
3844
|
-
.map(item => picomatch
|
|
3885
|
+
.map(item => picomatch(item, opts));
|
|
3845
3886
|
const patterns = mtchers.map(matcher => createPattern(matcher, opts));
|
|
3846
3887
|
|
|
3847
3888
|
if (testString == null) {
|
|
@@ -3854,8 +3895,8 @@ const anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => {
|
|
|
3854
3895
|
return matchPatterns(patterns, negatedGlobs, testString, returnIndex);
|
|
3855
3896
|
};
|
|
3856
3897
|
|
|
3857
|
-
anymatch.default = anymatch;
|
|
3858
|
-
|
|
3898
|
+
anymatch$1.default = anymatch$1;
|
|
3899
|
+
anymatch$2.exports = anymatch$1;
|
|
3859
3900
|
|
|
3860
3901
|
/*!
|
|
3861
3902
|
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
@@ -3863,7 +3904,8 @@ var anymatch_1 = anymatch;
|
|
|
3863
3904
|
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
3864
3905
|
* Licensed under the MIT License.
|
|
3865
3906
|
*/
|
|
3866
|
-
|
|
3907
|
+
|
|
3908
|
+
var isExtglob$1 = function isExtglob(str) {
|
|
3867
3909
|
if (typeof str !== 'string' || str === '') {
|
|
3868
3910
|
return false;
|
|
3869
3911
|
}
|
|
@@ -3884,11 +3926,12 @@ var isExtglob = function isExtglob(str) {
|
|
|
3884
3926
|
* Released under the MIT License.
|
|
3885
3927
|
*/
|
|
3886
3928
|
|
|
3929
|
+
var isExtglob = isExtglob$1;
|
|
3887
3930
|
var chars = { '{': '}', '(': ')', '[': ']'};
|
|
3888
3931
|
var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
|
|
3889
3932
|
var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/;
|
|
3890
3933
|
|
|
3891
|
-
var isGlob = function isGlob(str, options) {
|
|
3934
|
+
var isGlob$2 = function isGlob(str, options) {
|
|
3892
3935
|
if (typeof str !== 'string' || str === '') {
|
|
3893
3936
|
return false;
|
|
3894
3937
|
}
|
|
@@ -3925,8 +3968,9 @@ var isGlob = function isGlob(str, options) {
|
|
|
3925
3968
|
return false;
|
|
3926
3969
|
};
|
|
3927
3970
|
|
|
3928
|
-
var
|
|
3929
|
-
var
|
|
3971
|
+
var isGlob$1 = isGlob$2;
|
|
3972
|
+
var pathPosixDirname = path$3.posix.dirname;
|
|
3973
|
+
var isWin32 = require$$2.platform() === 'win32';
|
|
3930
3974
|
|
|
3931
3975
|
var slash = '/';
|
|
3932
3976
|
var backslash = /\\/g;
|
|
@@ -3939,7 +3983,7 @@ var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
|
|
|
3939
3983
|
* @param {Object} opts
|
|
3940
3984
|
* @param {boolean} [opts.flipBackslashes=true]
|
|
3941
3985
|
*/
|
|
3942
|
-
var globParent = function globParent(str, opts) {
|
|
3986
|
+
var globParent$1 = function globParent(str, opts) {
|
|
3943
3987
|
var options = Object.assign({ flipBackslashes: true }, opts);
|
|
3944
3988
|
|
|
3945
3989
|
// flip windows path separators
|
|
@@ -3958,7 +4002,7 @@ var globParent = function globParent(str, opts) {
|
|
|
3958
4002
|
// remove path parts that are globby
|
|
3959
4003
|
do {
|
|
3960
4004
|
str = pathPosixDirname(str);
|
|
3961
|
-
} while (isGlob(str) || globby.test(str));
|
|
4005
|
+
} while (isGlob$1(str) || globby.test(str));
|
|
3962
4006
|
|
|
3963
4007
|
// remove escape chars and return result
|
|
3964
4008
|
return str.replace(escaped, '$1');
|
|
@@ -4225,15 +4269,20 @@ var require$$0 = [
|
|
|
4225
4269
|
"zipx"
|
|
4226
4270
|
];
|
|
4227
4271
|
|
|
4228
|
-
var binaryExtensions = require$$0;
|
|
4272
|
+
var binaryExtensions$1 = require$$0;
|
|
4273
|
+
|
|
4274
|
+
const path = path$3;
|
|
4275
|
+
const binaryExtensions = binaryExtensions$1;
|
|
4229
4276
|
|
|
4230
4277
|
const extensions = new Set(binaryExtensions);
|
|
4231
4278
|
|
|
4232
|
-
var isBinaryPath = filePath => extensions.has(
|
|
4279
|
+
var isBinaryPath$1 = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase());
|
|
4233
4280
|
|
|
4234
|
-
var constants
|
|
4281
|
+
var constants = {};
|
|
4235
4282
|
|
|
4236
|
-
|
|
4283
|
+
(function (exports) {
|
|
4284
|
+
|
|
4285
|
+
const {sep} = path$3;
|
|
4237
4286
|
const {platform} = process;
|
|
4238
4287
|
|
|
4239
4288
|
exports.EV_ALL = 'all';
|
|
@@ -4294,38 +4343,40 @@ exports.IDENTITY_FN = val => val;
|
|
|
4294
4343
|
exports.isWindows = platform === 'win32';
|
|
4295
4344
|
exports.isMacos = platform === 'darwin';
|
|
4296
4345
|
exports.isLinux = platform === 'linux';
|
|
4297
|
-
});
|
|
4298
|
-
|
|
4299
|
-
const { promisify: promisify$1 } = util;
|
|
4346
|
+
}(constants));
|
|
4300
4347
|
|
|
4348
|
+
const fs$2 = fs$4;
|
|
4349
|
+
const sysPath$2 = path$3;
|
|
4350
|
+
const { promisify: promisify$2 } = require$$0$1;
|
|
4351
|
+
const isBinaryPath = isBinaryPath$1;
|
|
4301
4352
|
const {
|
|
4302
|
-
isWindows,
|
|
4353
|
+
isWindows: isWindows$1,
|
|
4303
4354
|
isLinux,
|
|
4304
|
-
EMPTY_FN,
|
|
4305
|
-
EMPTY_STR,
|
|
4355
|
+
EMPTY_FN: EMPTY_FN$2,
|
|
4356
|
+
EMPTY_STR: EMPTY_STR$1,
|
|
4306
4357
|
KEY_LISTENERS,
|
|
4307
4358
|
KEY_ERR,
|
|
4308
4359
|
KEY_RAW,
|
|
4309
4360
|
HANDLER_KEYS,
|
|
4310
|
-
EV_CHANGE,
|
|
4311
|
-
EV_ADD,
|
|
4312
|
-
EV_ADD_DIR,
|
|
4313
|
-
EV_ERROR,
|
|
4314
|
-
STR_DATA,
|
|
4315
|
-
STR_END,
|
|
4316
|
-
BRACE_START,
|
|
4317
|
-
STAR
|
|
4318
|
-
} = constants
|
|
4361
|
+
EV_CHANGE: EV_CHANGE$2,
|
|
4362
|
+
EV_ADD: EV_ADD$2,
|
|
4363
|
+
EV_ADD_DIR: EV_ADD_DIR$2,
|
|
4364
|
+
EV_ERROR: EV_ERROR$2,
|
|
4365
|
+
STR_DATA: STR_DATA$1,
|
|
4366
|
+
STR_END: STR_END$2,
|
|
4367
|
+
BRACE_START: BRACE_START$1,
|
|
4368
|
+
STAR
|
|
4369
|
+
} = constants;
|
|
4319
4370
|
|
|
4320
4371
|
const THROTTLE_MODE_WATCH = 'watch';
|
|
4321
4372
|
|
|
4322
|
-
const open = promisify$
|
|
4323
|
-
const stat$
|
|
4324
|
-
const lstat$1 = promisify$
|
|
4325
|
-
const close = promisify$
|
|
4326
|
-
const fsrealpath = promisify$
|
|
4373
|
+
const open = promisify$2(fs$2.open);
|
|
4374
|
+
const stat$2 = promisify$2(fs$2.stat);
|
|
4375
|
+
const lstat$1 = promisify$2(fs$2.lstat);
|
|
4376
|
+
const close = promisify$2(fs$2.close);
|
|
4377
|
+
const fsrealpath = promisify$2(fs$2.realpath);
|
|
4327
4378
|
|
|
4328
|
-
const statMethods = { lstat: lstat$1, stat: stat$
|
|
4379
|
+
const statMethods$1 = { lstat: lstat$1, stat: stat$2 };
|
|
4329
4380
|
|
|
4330
4381
|
// TODO: emit errors properly. Example: EMFILE on Macos.
|
|
4331
4382
|
const foreach = (val, fn) => {
|
|
@@ -4405,12 +4456,12 @@ function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
|
|
|
4405
4456
|
// case the file's watcher misses it (and rely on throttling to de-dupe)
|
|
4406
4457
|
if (evPath && path !== evPath) {
|
|
4407
4458
|
fsWatchBroadcast(
|
|
4408
|
-
sysPath.resolve(path, evPath), KEY_LISTENERS, sysPath.join(path, evPath)
|
|
4459
|
+
sysPath$2.resolve(path, evPath), KEY_LISTENERS, sysPath$2.join(path, evPath)
|
|
4409
4460
|
);
|
|
4410
4461
|
}
|
|
4411
4462
|
};
|
|
4412
4463
|
try {
|
|
4413
|
-
return fs.watch(path, options, handleEvent);
|
|
4464
|
+
return fs$2.watch(path, options, handleEvent);
|
|
4414
4465
|
} catch (error) {
|
|
4415
4466
|
errHandler(error);
|
|
4416
4467
|
}
|
|
@@ -4465,11 +4516,11 @@ const setFsWatchListener = (path, fullPath, options, handlers) => {
|
|
|
4465
4516
|
fsWatchBroadcast.bind(null, fullPath, KEY_RAW)
|
|
4466
4517
|
);
|
|
4467
4518
|
if (!watcher) return;
|
|
4468
|
-
watcher.on(EV_ERROR, async (error) => {
|
|
4519
|
+
watcher.on(EV_ERROR$2, async (error) => {
|
|
4469
4520
|
const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
|
|
4470
4521
|
cont.watcherUnusable = true; // documented since Node 10.4.1
|
|
4471
4522
|
// Workaround for https://github.com/joyent/node/issues/4337
|
|
4472
|
-
if (isWindows && error.code === 'EPERM') {
|
|
4523
|
+
if (isWindows$1 && error.code === 'EPERM') {
|
|
4473
4524
|
try {
|
|
4474
4525
|
const fd = await open(path, 'r');
|
|
4475
4526
|
await close(fd);
|
|
@@ -4529,7 +4580,7 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
|
|
|
4529
4580
|
|
|
4530
4581
|
const copts = cont && cont.options;
|
|
4531
4582
|
if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
|
|
4532
|
-
fs.unwatchFile(fullPath);
|
|
4583
|
+
fs$2.unwatchFile(fullPath);
|
|
4533
4584
|
cont = undefined;
|
|
4534
4585
|
}
|
|
4535
4586
|
|
|
@@ -4546,9 +4597,9 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
|
|
|
4546
4597
|
listeners: listener,
|
|
4547
4598
|
rawEmitters: rawEmitter,
|
|
4548
4599
|
options,
|
|
4549
|
-
watcher: fs.watchFile(fullPath, options, (curr, prev) => {
|
|
4600
|
+
watcher: fs$2.watchFile(fullPath, options, (curr, prev) => {
|
|
4550
4601
|
foreach(cont.rawEmitters, (rawEmitter) => {
|
|
4551
|
-
rawEmitter(EV_CHANGE, fullPath, {curr, prev});
|
|
4602
|
+
rawEmitter(EV_CHANGE$2, fullPath, {curr, prev});
|
|
4552
4603
|
});
|
|
4553
4604
|
const currmtime = curr.mtimeMs;
|
|
4554
4605
|
if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
|
|
@@ -4567,7 +4618,7 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
|
|
|
4567
4618
|
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
4568
4619
|
if (isEmptySet(cont.listeners)) {
|
|
4569
4620
|
FsWatchFileInstances.delete(fullPath);
|
|
4570
|
-
fs.unwatchFile(fullPath);
|
|
4621
|
+
fs$2.unwatchFile(fullPath);
|
|
4571
4622
|
cont.options = cont.watcher = undefined;
|
|
4572
4623
|
Object.freeze(cont);
|
|
4573
4624
|
}
|
|
@@ -4577,7 +4628,7 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
|
|
|
4577
4628
|
/**
|
|
4578
4629
|
* @mixin
|
|
4579
4630
|
*/
|
|
4580
|
-
class NodeFsHandler {
|
|
4631
|
+
class NodeFsHandler$1 {
|
|
4581
4632
|
|
|
4582
4633
|
/**
|
|
4583
4634
|
* @param {import("../index").FSWatcher} fsW
|
|
@@ -4595,13 +4646,13 @@ constructor(fsW) {
|
|
|
4595
4646
|
*/
|
|
4596
4647
|
_watchWithNodeFs(path, listener) {
|
|
4597
4648
|
const opts = this.fsw.options;
|
|
4598
|
-
const directory = sysPath.dirname(path);
|
|
4599
|
-
const basename = sysPath.basename(path);
|
|
4649
|
+
const directory = sysPath$2.dirname(path);
|
|
4650
|
+
const basename = sysPath$2.basename(path);
|
|
4600
4651
|
const parent = this.fsw._getWatchedDir(directory);
|
|
4601
4652
|
parent.add(basename);
|
|
4602
|
-
const absolutePath = sysPath.resolve(path);
|
|
4653
|
+
const absolutePath = sysPath$2.resolve(path);
|
|
4603
4654
|
const options = {persistent: opts.persistent};
|
|
4604
|
-
if (!listener) listener = EMPTY_FN;
|
|
4655
|
+
if (!listener) listener = EMPTY_FN$2;
|
|
4605
4656
|
|
|
4606
4657
|
let closer;
|
|
4607
4658
|
if (opts.usePolling) {
|
|
@@ -4632,8 +4683,8 @@ _handleFile(file, stats, initialAdd) {
|
|
|
4632
4683
|
if (this.fsw.closed) {
|
|
4633
4684
|
return;
|
|
4634
4685
|
}
|
|
4635
|
-
const dirname = sysPath.dirname(file);
|
|
4636
|
-
const basename = sysPath.basename(file);
|
|
4686
|
+
const dirname = sysPath$2.dirname(file);
|
|
4687
|
+
const basename = sysPath$2.basename(file);
|
|
4637
4688
|
const parent = this.fsw._getWatchedDir(dirname);
|
|
4638
4689
|
// stats is always present
|
|
4639
4690
|
let prevStats = stats;
|
|
@@ -4645,13 +4696,13 @@ _handleFile(file, stats, initialAdd) {
|
|
|
4645
4696
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return;
|
|
4646
4697
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
4647
4698
|
try {
|
|
4648
|
-
const newStats = await stat$
|
|
4699
|
+
const newStats = await stat$2(file);
|
|
4649
4700
|
if (this.fsw.closed) return;
|
|
4650
4701
|
// Check that change event was not fired because of changed only accessTime.
|
|
4651
4702
|
const at = newStats.atimeMs;
|
|
4652
4703
|
const mt = newStats.mtimeMs;
|
|
4653
4704
|
if (!at || at <= mt || mt !== prevStats.mtimeMs) {
|
|
4654
|
-
this.fsw._emit(EV_CHANGE, file, newStats);
|
|
4705
|
+
this.fsw._emit(EV_CHANGE$2, file, newStats);
|
|
4655
4706
|
}
|
|
4656
4707
|
if (isLinux && prevStats.ino !== newStats.ino) {
|
|
4657
4708
|
this.fsw._closeFile(path);
|
|
@@ -4670,7 +4721,7 @@ _handleFile(file, stats, initialAdd) {
|
|
|
4670
4721
|
const at = newStats.atimeMs;
|
|
4671
4722
|
const mt = newStats.mtimeMs;
|
|
4672
4723
|
if (!at || at <= mt || mt !== prevStats.mtimeMs) {
|
|
4673
|
-
this.fsw._emit(EV_CHANGE, file, newStats);
|
|
4724
|
+
this.fsw._emit(EV_CHANGE$2, file, newStats);
|
|
4674
4725
|
}
|
|
4675
4726
|
prevStats = newStats;
|
|
4676
4727
|
}
|
|
@@ -4680,8 +4731,8 @@ _handleFile(file, stats, initialAdd) {
|
|
|
4680
4731
|
|
|
4681
4732
|
// emit an add event if we're supposed to
|
|
4682
4733
|
if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) {
|
|
4683
|
-
if (!this.fsw._throttle(EV_ADD, file, 0)) return;
|
|
4684
|
-
this.fsw._emit(EV_ADD, file, stats);
|
|
4734
|
+
if (!this.fsw._throttle(EV_ADD$2, file, 0)) return;
|
|
4735
|
+
this.fsw._emit(EV_ADD$2, file, stats);
|
|
4685
4736
|
}
|
|
4686
4737
|
|
|
4687
4738
|
return closer;
|
|
@@ -4710,12 +4761,12 @@ async _handleSymlink(entry, directory, path, item) {
|
|
|
4710
4761
|
if (dir.has(item)) {
|
|
4711
4762
|
if (this.fsw._symlinkPaths.get(full) !== linkPath) {
|
|
4712
4763
|
this.fsw._symlinkPaths.set(full, linkPath);
|
|
4713
|
-
this.fsw._emit(EV_CHANGE, path, entry.stats);
|
|
4764
|
+
this.fsw._emit(EV_CHANGE$2, path, entry.stats);
|
|
4714
4765
|
}
|
|
4715
4766
|
} else {
|
|
4716
4767
|
dir.add(item);
|
|
4717
4768
|
this.fsw._symlinkPaths.set(full, linkPath);
|
|
4718
|
-
this.fsw._emit(EV_ADD, path, entry.stats);
|
|
4769
|
+
this.fsw._emit(EV_ADD$2, path, entry.stats);
|
|
4719
4770
|
}
|
|
4720
4771
|
this.fsw._emitReady();
|
|
4721
4772
|
return true;
|
|
@@ -4731,7 +4782,7 @@ async _handleSymlink(entry, directory, path, item) {
|
|
|
4731
4782
|
|
|
4732
4783
|
_handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
4733
4784
|
// Normalize the directory name on Windows
|
|
4734
|
-
directory = sysPath.join(directory, EMPTY_STR);
|
|
4785
|
+
directory = sysPath$2.join(directory, EMPTY_STR$1);
|
|
4735
4786
|
|
|
4736
4787
|
if (!wh.hasGlob) {
|
|
4737
4788
|
throttler = this.fsw._throttle('readdir', directory, 1000);
|
|
@@ -4745,13 +4796,13 @@ _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
|
4745
4796
|
fileFilter: entry => wh.filterPath(entry),
|
|
4746
4797
|
directoryFilter: entry => wh.filterDir(entry),
|
|
4747
4798
|
depth: 0
|
|
4748
|
-
}).on(STR_DATA, async (entry) => {
|
|
4799
|
+
}).on(STR_DATA$1, async (entry) => {
|
|
4749
4800
|
if (this.fsw.closed) {
|
|
4750
4801
|
stream = undefined;
|
|
4751
4802
|
return;
|
|
4752
4803
|
}
|
|
4753
4804
|
const item = entry.path;
|
|
4754
|
-
let path = sysPath.join(directory, item);
|
|
4805
|
+
let path = sysPath$2.join(directory, item);
|
|
4755
4806
|
current.add(item);
|
|
4756
4807
|
|
|
4757
4808
|
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) {
|
|
@@ -4769,14 +4820,14 @@ _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
|
4769
4820
|
this.fsw._incrReadyCount();
|
|
4770
4821
|
|
|
4771
4822
|
// ensure relativeness of path is preserved in case of watcher reuse
|
|
4772
|
-
path = sysPath.join(dir, sysPath.relative(dir, path));
|
|
4823
|
+
path = sysPath$2.join(dir, sysPath$2.relative(dir, path));
|
|
4773
4824
|
|
|
4774
4825
|
this._addToNodeFs(path, initialAdd, wh, depth + 1);
|
|
4775
4826
|
}
|
|
4776
|
-
}).on(EV_ERROR, this._boundHandleError);
|
|
4827
|
+
}).on(EV_ERROR$2, this._boundHandleError);
|
|
4777
4828
|
|
|
4778
4829
|
return new Promise(resolve =>
|
|
4779
|
-
stream.once(STR_END, () => {
|
|
4830
|
+
stream.once(STR_END$2, () => {
|
|
4780
4831
|
if (this.fsw.closed) {
|
|
4781
4832
|
stream = undefined;
|
|
4782
4833
|
return;
|
|
@@ -4795,7 +4846,7 @@ _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
|
4795
4846
|
// a path may have been filtered out of this readdir, but
|
|
4796
4847
|
// shouldn't be removed because it matches a different glob
|
|
4797
4848
|
(!wh.hasGlob || wh.filterPath({
|
|
4798
|
-
fullPath: sysPath.resolve(directory, item)
|
|
4849
|
+
fullPath: sysPath$2.resolve(directory, item)
|
|
4799
4850
|
}));
|
|
4800
4851
|
}).forEach((item) => {
|
|
4801
4852
|
this.fsw._remove(directory, item);
|
|
@@ -4821,14 +4872,14 @@ _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
|
4821
4872
|
* @returns {Promise<Function>} closer for the watcher instance.
|
|
4822
4873
|
*/
|
|
4823
4874
|
async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {
|
|
4824
|
-
const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir));
|
|
4825
|
-
const tracked = parentDir.has(sysPath.basename(dir));
|
|
4875
|
+
const parentDir = this.fsw._getWatchedDir(sysPath$2.dirname(dir));
|
|
4876
|
+
const tracked = parentDir.has(sysPath$2.basename(dir));
|
|
4826
4877
|
if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
|
|
4827
|
-
if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR, dir, stats);
|
|
4878
|
+
if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR$2, dir, stats);
|
|
4828
4879
|
}
|
|
4829
4880
|
|
|
4830
4881
|
// ensure dir is tracked (harmless if redundant)
|
|
4831
|
-
parentDir.add(sysPath.basename(dir));
|
|
4882
|
+
parentDir.add(sysPath$2.basename(dir));
|
|
4832
4883
|
this.fsw._getWatchedDir(dir);
|
|
4833
4884
|
let throttler;
|
|
4834
4885
|
let closer;
|
|
@@ -4877,17 +4928,17 @@ async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
|
|
|
4877
4928
|
|
|
4878
4929
|
// evaluate what is at the path we're being asked to watch
|
|
4879
4930
|
try {
|
|
4880
|
-
const stats = await statMethods[wh.statMethod](wh.watchPath);
|
|
4931
|
+
const stats = await statMethods$1[wh.statMethod](wh.watchPath);
|
|
4881
4932
|
if (this.fsw.closed) return;
|
|
4882
4933
|
if (this.fsw._isIgnored(wh.watchPath, stats)) {
|
|
4883
4934
|
ready();
|
|
4884
4935
|
return false;
|
|
4885
4936
|
}
|
|
4886
4937
|
|
|
4887
|
-
const follow = this.fsw.options.followSymlinks && !path.includes(STAR
|
|
4938
|
+
const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START$1);
|
|
4888
4939
|
let closer;
|
|
4889
4940
|
if (stats.isDirectory()) {
|
|
4890
|
-
const absPath = sysPath.resolve(path);
|
|
4941
|
+
const absPath = sysPath$2.resolve(path);
|
|
4891
4942
|
const targetPath = follow ? await fsrealpath(path) : path;
|
|
4892
4943
|
if (this.fsw.closed) return;
|
|
4893
4944
|
closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
|
|
@@ -4899,15 +4950,15 @@ async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
|
|
|
4899
4950
|
} else if (stats.isSymbolicLink()) {
|
|
4900
4951
|
const targetPath = follow ? await fsrealpath(path) : path;
|
|
4901
4952
|
if (this.fsw.closed) return;
|
|
4902
|
-
const parent = sysPath.dirname(wh.watchPath);
|
|
4953
|
+
const parent = sysPath$2.dirname(wh.watchPath);
|
|
4903
4954
|
this.fsw._getWatchedDir(parent).add(wh.watchPath);
|
|
4904
|
-
this.fsw._emit(EV_ADD, wh.watchPath, stats);
|
|
4955
|
+
this.fsw._emit(EV_ADD$2, wh.watchPath, stats);
|
|
4905
4956
|
closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath);
|
|
4906
4957
|
if (this.fsw.closed) return;
|
|
4907
4958
|
|
|
4908
4959
|
// preserve this symlink's target path
|
|
4909
4960
|
if (targetPath !== undefined) {
|
|
4910
|
-
this.fsw._symlinkPaths.set(sysPath.resolve(path), targetPath);
|
|
4961
|
+
this.fsw._symlinkPaths.set(sysPath$2.resolve(path), targetPath);
|
|
4911
4962
|
}
|
|
4912
4963
|
} else {
|
|
4913
4964
|
closer = this._handleFile(wh.watchPath, stats, initialAdd);
|
|
@@ -4927,15 +4978,19 @@ async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
|
|
|
4927
4978
|
|
|
4928
4979
|
}
|
|
4929
4980
|
|
|
4930
|
-
var nodefsHandler = NodeFsHandler;
|
|
4981
|
+
var nodefsHandler = NodeFsHandler$1;
|
|
4982
|
+
|
|
4983
|
+
var fseventsHandler = {exports: {}};
|
|
4931
4984
|
|
|
4932
|
-
var require$$
|
|
4985
|
+
var require$$3 = /*@__PURE__*/rollup.getAugmentedNamespace(rollup.fseventsImporter);
|
|
4933
4986
|
|
|
4934
|
-
const
|
|
4987
|
+
const fs$1 = fs$4;
|
|
4988
|
+
const sysPath$1 = path$3;
|
|
4989
|
+
const { promisify: promisify$1 } = require$$0$1;
|
|
4935
4990
|
|
|
4936
4991
|
let fsevents;
|
|
4937
4992
|
try {
|
|
4938
|
-
fsevents = require$$
|
|
4993
|
+
fsevents = require$$3.getFsEvents();
|
|
4939
4994
|
} catch (error) {
|
|
4940
4995
|
if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error);
|
|
4941
4996
|
}
|
|
@@ -4956,9 +5011,9 @@ const {
|
|
|
4956
5011
|
EV_ADD: EV_ADD$1,
|
|
4957
5012
|
EV_CHANGE: EV_CHANGE$1,
|
|
4958
5013
|
EV_ADD_DIR: EV_ADD_DIR$1,
|
|
4959
|
-
EV_UNLINK,
|
|
5014
|
+
EV_UNLINK: EV_UNLINK$1,
|
|
4960
5015
|
EV_ERROR: EV_ERROR$1,
|
|
4961
|
-
STR_DATA
|
|
5016
|
+
STR_DATA,
|
|
4962
5017
|
STR_END: STR_END$1,
|
|
4963
5018
|
FSEVENT_CREATED,
|
|
4964
5019
|
FSEVENT_MODIFIED,
|
|
@@ -4973,18 +5028,18 @@ const {
|
|
|
4973
5028
|
ROOT_GLOBSTAR,
|
|
4974
5029
|
DIR_SUFFIX,
|
|
4975
5030
|
DOT_SLASH,
|
|
4976
|
-
FUNCTION_TYPE,
|
|
5031
|
+
FUNCTION_TYPE: FUNCTION_TYPE$1,
|
|
4977
5032
|
EMPTY_FN: EMPTY_FN$1,
|
|
4978
5033
|
IDENTITY_FN
|
|
4979
|
-
} = constants
|
|
5034
|
+
} = constants;
|
|
4980
5035
|
|
|
4981
5036
|
const Depth = (value) => isNaN(value) ? {} : {depth: value};
|
|
4982
5037
|
|
|
4983
|
-
const stat$
|
|
4984
|
-
const lstat
|
|
4985
|
-
const realpath
|
|
5038
|
+
const stat$1 = promisify$1(fs$1.stat);
|
|
5039
|
+
const lstat = promisify$1(fs$1.lstat);
|
|
5040
|
+
const realpath = promisify$1(fs$1.realpath);
|
|
4986
5041
|
|
|
4987
|
-
const statMethods
|
|
5042
|
+
const statMethods = { stat: stat$1, lstat };
|
|
4988
5043
|
|
|
4989
5044
|
/**
|
|
4990
5045
|
* @typedef {String} Path
|
|
@@ -5033,8 +5088,8 @@ const createFSEventsInstance = (path, callback) => {
|
|
|
5033
5088
|
* @returns {Function} closer
|
|
5034
5089
|
*/
|
|
5035
5090
|
function setFSEventsListener(path, realPath, listener, rawEmitter) {
|
|
5036
|
-
let watchPath = sysPath.extname(path) ? sysPath.dirname(path) : path;
|
|
5037
|
-
const parentPath = sysPath.dirname(watchPath);
|
|
5091
|
+
let watchPath = sysPath$1.extname(path) ? sysPath$1.dirname(path) : path;
|
|
5092
|
+
const parentPath = sysPath$1.dirname(watchPath);
|
|
5038
5093
|
let cont = FSEventsWatchers.get(watchPath);
|
|
5039
5094
|
|
|
5040
5095
|
// If we've accumulated a substantial number of paths that
|
|
@@ -5045,14 +5100,14 @@ function setFSEventsListener(path, realPath, listener, rawEmitter) {
|
|
|
5045
5100
|
watchPath = parentPath;
|
|
5046
5101
|
}
|
|
5047
5102
|
|
|
5048
|
-
const resolvedPath = sysPath.resolve(path);
|
|
5103
|
+
const resolvedPath = sysPath$1.resolve(path);
|
|
5049
5104
|
const hasSymlink = resolvedPath !== realPath;
|
|
5050
5105
|
|
|
5051
5106
|
const filteredListener = (fullPath, flags, info) => {
|
|
5052
5107
|
if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath);
|
|
5053
5108
|
if (
|
|
5054
5109
|
fullPath === resolvedPath ||
|
|
5055
|
-
!fullPath.indexOf(resolvedPath + sysPath.sep)
|
|
5110
|
+
!fullPath.indexOf(resolvedPath + sysPath$1.sep)
|
|
5056
5111
|
) listener(fullPath, flags, info);
|
|
5057
5112
|
};
|
|
5058
5113
|
|
|
@@ -5060,7 +5115,7 @@ function setFSEventsListener(path, realPath, listener, rawEmitter) {
|
|
|
5060
5115
|
// modifies `watchPath` to the parent path when it finds a match
|
|
5061
5116
|
let watchedParent = false;
|
|
5062
5117
|
for (const watchedPath of FSEventsWatchers.keys()) {
|
|
5063
|
-
if (realPath.indexOf(sysPath.resolve(watchedPath) + sysPath.sep) === 0) {
|
|
5118
|
+
if (realPath.indexOf(sysPath$1.resolve(watchedPath) + sysPath$1.sep) === 0) {
|
|
5064
5119
|
watchPath = watchedPath;
|
|
5065
5120
|
cont = FSEventsWatchers.get(watchPath);
|
|
5066
5121
|
watchedParent = true;
|
|
@@ -5125,7 +5180,7 @@ const canUse = () => fsevents && FSEventsWatchers.size < 128;
|
|
|
5125
5180
|
// determines subdirectory traversal levels from root to path
|
|
5126
5181
|
const calcDepth = (path, root) => {
|
|
5127
5182
|
let i = 0;
|
|
5128
|
-
while (!path.indexOf(root) && (path = sysPath.dirname(path)) !== root) i++;
|
|
5183
|
+
while (!path.indexOf(root) && (path = sysPath$1.dirname(path)) !== root) i++;
|
|
5129
5184
|
return i;
|
|
5130
5185
|
};
|
|
5131
5186
|
|
|
@@ -5140,7 +5195,7 @@ const sameTypes = (info, stats) => (
|
|
|
5140
5195
|
/**
|
|
5141
5196
|
* @mixin
|
|
5142
5197
|
*/
|
|
5143
|
-
class FsEventsHandler {
|
|
5198
|
+
class FsEventsHandler$1 {
|
|
5144
5199
|
|
|
5145
5200
|
/**
|
|
5146
5201
|
* @param {import('../index').FSWatcher} fsw
|
|
@@ -5169,18 +5224,18 @@ addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
|
|
5169
5224
|
|
|
5170
5225
|
async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
|
5171
5226
|
try {
|
|
5172
|
-
const stats = await stat$
|
|
5227
|
+
const stats = await stat$1(path);
|
|
5173
5228
|
if (this.fsw.closed) return;
|
|
5174
5229
|
if (sameTypes(info, stats)) {
|
|
5175
5230
|
this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5176
5231
|
} else {
|
|
5177
|
-
this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5232
|
+
this.handleEvent(EV_UNLINK$1, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5178
5233
|
}
|
|
5179
5234
|
} catch (error) {
|
|
5180
5235
|
if (error.code === 'EACCES') {
|
|
5181
5236
|
this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5182
5237
|
} else {
|
|
5183
|
-
this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5238
|
+
this.handleEvent(EV_UNLINK$1, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5184
5239
|
}
|
|
5185
5240
|
}
|
|
5186
5241
|
}
|
|
@@ -5188,7 +5243,7 @@ async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts
|
|
|
5188
5243
|
handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
|
5189
5244
|
if (this.fsw.closed || this.checkIgnored(path)) return;
|
|
5190
5245
|
|
|
5191
|
-
if (event === EV_UNLINK) {
|
|
5246
|
+
if (event === EV_UNLINK$1) {
|
|
5192
5247
|
const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY;
|
|
5193
5248
|
// suppress unlink events on never before seen files
|
|
5194
5249
|
if (isDirectory || watchedDir.has(item)) {
|
|
@@ -5236,30 +5291,30 @@ _watchWithFsEvents(watchPath, realPath, transform, globFilter) {
|
|
|
5236
5291
|
opts.depth !== undefined &&
|
|
5237
5292
|
calcDepth(fullPath, realPath) > opts.depth
|
|
5238
5293
|
) return;
|
|
5239
|
-
const path = transform(sysPath.join(
|
|
5240
|
-
watchPath, sysPath.relative(watchPath, fullPath)
|
|
5294
|
+
const path = transform(sysPath$1.join(
|
|
5295
|
+
watchPath, sysPath$1.relative(watchPath, fullPath)
|
|
5241
5296
|
));
|
|
5242
5297
|
if (globFilter && !globFilter(path)) return;
|
|
5243
5298
|
// ensure directories are tracked
|
|
5244
|
-
const parent = sysPath.dirname(path);
|
|
5245
|
-
const item = sysPath.basename(path);
|
|
5299
|
+
const parent = sysPath$1.dirname(path);
|
|
5300
|
+
const item = sysPath$1.basename(path);
|
|
5246
5301
|
const watchedDir = this.fsw._getWatchedDir(
|
|
5247
5302
|
info.type === FSEVENT_TYPE_DIRECTORY ? path : parent
|
|
5248
5303
|
);
|
|
5249
5304
|
|
|
5250
5305
|
// correct for wrong events emitted
|
|
5251
5306
|
if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) {
|
|
5252
|
-
if (typeof opts.ignored === FUNCTION_TYPE) {
|
|
5307
|
+
if (typeof opts.ignored === FUNCTION_TYPE$1) {
|
|
5253
5308
|
let stats;
|
|
5254
5309
|
try {
|
|
5255
|
-
stats = await stat$
|
|
5310
|
+
stats = await stat$1(path);
|
|
5256
5311
|
} catch (error) {}
|
|
5257
5312
|
if (this.fsw.closed) return;
|
|
5258
5313
|
if (this.checkIgnored(path, stats)) return;
|
|
5259
5314
|
if (sameTypes(info, stats)) {
|
|
5260
5315
|
this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5261
5316
|
} else {
|
|
5262
|
-
this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5317
|
+
this.handleEvent(EV_UNLINK$1, path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
5263
5318
|
}
|
|
5264
5319
|
} else {
|
|
5265
5320
|
this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
@@ -5303,7 +5358,7 @@ async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) {
|
|
|
5303
5358
|
this.fsw._incrReadyCount();
|
|
5304
5359
|
|
|
5305
5360
|
try {
|
|
5306
|
-
const linkTarget = await realpath
|
|
5361
|
+
const linkTarget = await realpath(linkPath);
|
|
5307
5362
|
if (this.fsw.closed) return;
|
|
5308
5363
|
if (this.fsw._isIgnored(linkTarget)) {
|
|
5309
5364
|
return this.fsw._emitReady();
|
|
@@ -5318,7 +5373,7 @@ async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) {
|
|
|
5318
5373
|
if (linkTarget && linkTarget !== DOT_SLASH) {
|
|
5319
5374
|
aliasedPath = path.replace(linkTarget, linkPath);
|
|
5320
5375
|
} else if (path !== DOT_SLASH) {
|
|
5321
|
-
aliasedPath = sysPath.join(linkPath, path);
|
|
5376
|
+
aliasedPath = sysPath$1.join(linkPath, path);
|
|
5322
5377
|
}
|
|
5323
5378
|
return transform(aliasedPath);
|
|
5324
5379
|
}, false, curDepth);
|
|
@@ -5337,8 +5392,8 @@ async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) {
|
|
|
5337
5392
|
emitAdd(newPath, stats, processPath, opts, forceAdd) {
|
|
5338
5393
|
const pp = processPath(newPath);
|
|
5339
5394
|
const isDir = stats.isDirectory();
|
|
5340
|
-
const dirObj = this.fsw._getWatchedDir(sysPath.dirname(pp));
|
|
5341
|
-
const base = sysPath.basename(pp);
|
|
5395
|
+
const dirObj = this.fsw._getWatchedDir(sysPath$1.dirname(pp));
|
|
5396
|
+
const base = sysPath$1.basename(pp);
|
|
5342
5397
|
|
|
5343
5398
|
// ensure empty dirs get tracked
|
|
5344
5399
|
if (isDir) this.fsw._getWatchedDir(pp);
|
|
@@ -5354,7 +5409,7 @@ initWatch(realPath, path, wh, processPath) {
|
|
|
5354
5409
|
if (this.fsw.closed) return;
|
|
5355
5410
|
const closer = this._watchWithFsEvents(
|
|
5356
5411
|
wh.watchPath,
|
|
5357
|
-
sysPath.resolve(realPath || wh.watchPath),
|
|
5412
|
+
sysPath$1.resolve(realPath || wh.watchPath),
|
|
5358
5413
|
processPath,
|
|
5359
5414
|
wh.globFilter
|
|
5360
5415
|
);
|
|
@@ -5374,13 +5429,13 @@ async _addToFsEvents(path, transform, forceAdd, priorDepth) {
|
|
|
5374
5429
|
return;
|
|
5375
5430
|
}
|
|
5376
5431
|
const opts = this.fsw.options;
|
|
5377
|
-
const processPath = typeof transform === FUNCTION_TYPE ? transform : IDENTITY_FN;
|
|
5432
|
+
const processPath = typeof transform === FUNCTION_TYPE$1 ? transform : IDENTITY_FN;
|
|
5378
5433
|
|
|
5379
5434
|
const wh = this.fsw._getWatchHelpers(path);
|
|
5380
5435
|
|
|
5381
5436
|
// evaluate what is at the path we're being asked to watch
|
|
5382
5437
|
try {
|
|
5383
|
-
const stats = await statMethods
|
|
5438
|
+
const stats = await statMethods[wh.statMethod](wh.watchPath);
|
|
5384
5439
|
if (this.fsw.closed) return;
|
|
5385
5440
|
if (this.fsw._isIgnored(wh.watchPath, stats)) {
|
|
5386
5441
|
throw null;
|
|
@@ -5397,21 +5452,21 @@ async _addToFsEvents(path, transform, forceAdd, priorDepth) {
|
|
|
5397
5452
|
fileFilter: entry => wh.filterPath(entry),
|
|
5398
5453
|
directoryFilter: entry => wh.filterDir(entry),
|
|
5399
5454
|
...Depth(opts.depth - (priorDepth || 0))
|
|
5400
|
-
}).on(STR_DATA
|
|
5455
|
+
}).on(STR_DATA, (entry) => {
|
|
5401
5456
|
// need to check filterPath on dirs b/c filterDir is less restrictive
|
|
5402
5457
|
if (this.fsw.closed) {
|
|
5403
5458
|
return;
|
|
5404
5459
|
}
|
|
5405
5460
|
if (entry.stats.isDirectory() && !wh.filterPath(entry)) return;
|
|
5406
5461
|
|
|
5407
|
-
const joinedPath = sysPath.join(wh.watchPath, entry.path);
|
|
5462
|
+
const joinedPath = sysPath$1.join(wh.watchPath, entry.path);
|
|
5408
5463
|
const {fullPath} = entry;
|
|
5409
5464
|
|
|
5410
5465
|
if (wh.followSymlinks && entry.stats.isSymbolicLink()) {
|
|
5411
5466
|
// preserve the current depth here since it can't be derived from
|
|
5412
5467
|
// real paths past the symlink
|
|
5413
5468
|
const curDepth = opts.depth === undefined ?
|
|
5414
|
-
undefined : calcDepth(joinedPath, sysPath.resolve(wh.watchPath)) + 1;
|
|
5469
|
+
undefined : calcDepth(joinedPath, sysPath$1.resolve(wh.watchPath)) + 1;
|
|
5415
5470
|
|
|
5416
5471
|
this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth);
|
|
5417
5472
|
} else {
|
|
@@ -5433,13 +5488,13 @@ async _addToFsEvents(path, transform, forceAdd, priorDepth) {
|
|
|
5433
5488
|
}
|
|
5434
5489
|
|
|
5435
5490
|
if (opts.persistent && forceAdd !== true) {
|
|
5436
|
-
if (typeof transform === FUNCTION_TYPE) {
|
|
5491
|
+
if (typeof transform === FUNCTION_TYPE$1) {
|
|
5437
5492
|
// realpath has already been resolved
|
|
5438
5493
|
this.initWatch(undefined, path, wh, processPath);
|
|
5439
5494
|
} else {
|
|
5440
5495
|
let realPath;
|
|
5441
5496
|
try {
|
|
5442
|
-
realPath = await realpath
|
|
5497
|
+
realPath = await realpath(wh.watchPath);
|
|
5443
5498
|
} catch (e) {}
|
|
5444
5499
|
this.initWatch(realPath, path, wh, processPath);
|
|
5445
5500
|
}
|
|
@@ -5448,36 +5503,35 @@ async _addToFsEvents(path, transform, forceAdd, priorDepth) {
|
|
|
5448
5503
|
|
|
5449
5504
|
}
|
|
5450
5505
|
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
fseventsHandler.canUse = canUse_1;
|
|
5506
|
+
fseventsHandler.exports = FsEventsHandler$1;
|
|
5507
|
+
fseventsHandler.exports.canUse = canUse;
|
|
5454
5508
|
|
|
5455
5509
|
const { EventEmitter } = require$$0$2;
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
const { promisify
|
|
5459
|
-
|
|
5460
|
-
const anymatch
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5510
|
+
const fs = fs$4;
|
|
5511
|
+
const sysPath = path$3;
|
|
5512
|
+
const { promisify } = require$$0$1;
|
|
5513
|
+
const readdirp = readdirp_1;
|
|
5514
|
+
const anymatch = anymatch$2.exports.default;
|
|
5515
|
+
const globParent = globParent$1;
|
|
5516
|
+
const isGlob = isGlob$2;
|
|
5517
|
+
const braces = braces_1;
|
|
5518
|
+
const normalizePath = normalizePath$2;
|
|
5519
|
+
|
|
5520
|
+
const NodeFsHandler = nodefsHandler;
|
|
5521
|
+
const FsEventsHandler = fseventsHandler.exports;
|
|
5468
5522
|
const {
|
|
5469
5523
|
EV_ALL,
|
|
5470
5524
|
EV_READY,
|
|
5471
|
-
EV_ADD
|
|
5472
|
-
EV_CHANGE
|
|
5473
|
-
EV_UNLINK
|
|
5474
|
-
EV_ADD_DIR
|
|
5525
|
+
EV_ADD,
|
|
5526
|
+
EV_CHANGE,
|
|
5527
|
+
EV_UNLINK,
|
|
5528
|
+
EV_ADD_DIR,
|
|
5475
5529
|
EV_UNLINK_DIR,
|
|
5476
5530
|
EV_RAW,
|
|
5477
|
-
EV_ERROR
|
|
5531
|
+
EV_ERROR,
|
|
5478
5532
|
|
|
5479
5533
|
STR_CLOSE,
|
|
5480
|
-
STR_END
|
|
5534
|
+
STR_END,
|
|
5481
5535
|
|
|
5482
5536
|
BACK_SLASH_RE,
|
|
5483
5537
|
DOUBLE_SLASH_RE,
|
|
@@ -5487,24 +5541,24 @@ const {
|
|
|
5487
5541
|
|
|
5488
5542
|
SLASH,
|
|
5489
5543
|
SLASH_SLASH,
|
|
5490
|
-
BRACE_START
|
|
5491
|
-
BANG
|
|
5544
|
+
BRACE_START,
|
|
5545
|
+
BANG,
|
|
5492
5546
|
ONE_DOT,
|
|
5493
5547
|
TWO_DOTS,
|
|
5494
5548
|
GLOBSTAR,
|
|
5495
5549
|
SLASH_GLOBSTAR,
|
|
5496
5550
|
ANYMATCH_OPTS,
|
|
5497
5551
|
STRING_TYPE,
|
|
5498
|
-
FUNCTION_TYPE
|
|
5499
|
-
EMPTY_STR
|
|
5500
|
-
EMPTY_FN
|
|
5552
|
+
FUNCTION_TYPE,
|
|
5553
|
+
EMPTY_STR,
|
|
5554
|
+
EMPTY_FN,
|
|
5501
5555
|
|
|
5502
|
-
isWindows
|
|
5556
|
+
isWindows,
|
|
5503
5557
|
isMacos
|
|
5504
|
-
} = constants
|
|
5558
|
+
} = constants;
|
|
5505
5559
|
|
|
5506
|
-
const stat
|
|
5507
|
-
const readdir
|
|
5560
|
+
const stat = promisify(fs.stat);
|
|
5561
|
+
const readdir = promisify(fs.readdir);
|
|
5508
5562
|
|
|
5509
5563
|
/**
|
|
5510
5564
|
* @typedef {String} Path
|
|
@@ -5526,7 +5580,7 @@ const readdir$1 = promisify$3(fs.readdir);
|
|
|
5526
5580
|
* @property {Function} filterDir
|
|
5527
5581
|
*/
|
|
5528
5582
|
|
|
5529
|
-
const arrify
|
|
5583
|
+
const arrify = (value = []) => Array.isArray(value) ? value : [value];
|
|
5530
5584
|
const flatten = (list, result = []) => {
|
|
5531
5585
|
list.forEach(item => {
|
|
5532
5586
|
if (Array.isArray(item)) {
|
|
@@ -5542,7 +5596,7 @@ const unifyPaths = (paths_) => {
|
|
|
5542
5596
|
/**
|
|
5543
5597
|
* @type {Array<String>}
|
|
5544
5598
|
*/
|
|
5545
|
-
const paths = flatten(arrify
|
|
5599
|
+
const paths = flatten(arrify(paths_));
|
|
5546
5600
|
if (!paths.every(p => typeof p === STRING_TYPE)) {
|
|
5547
5601
|
throw new TypeError(`Non-string provided as watch path: ${paths}`);
|
|
5548
5602
|
}
|
|
@@ -5570,7 +5624,7 @@ const toUnix = (string) => {
|
|
|
5570
5624
|
// TODO: this is not equal to path-normalize module - investigate why
|
|
5571
5625
|
const normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path)));
|
|
5572
5626
|
|
|
5573
|
-
const normalizeIgnored = (cwd = EMPTY_STR
|
|
5627
|
+
const normalizeIgnored = (cwd = EMPTY_STR) => (path) => {
|
|
5574
5628
|
if (typeof path !== STRING_TYPE) return path;
|
|
5575
5629
|
return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path));
|
|
5576
5630
|
};
|
|
@@ -5579,8 +5633,8 @@ const getAbsolutePath = (path, cwd) => {
|
|
|
5579
5633
|
if (sysPath.isAbsolute(path)) {
|
|
5580
5634
|
return path;
|
|
5581
5635
|
}
|
|
5582
|
-
if (path.startsWith(BANG
|
|
5583
|
-
return BANG
|
|
5636
|
+
if (path.startsWith(BANG)) {
|
|
5637
|
+
return BANG + sysPath.join(cwd, path.slice(1));
|
|
5584
5638
|
}
|
|
5585
5639
|
return sysPath.join(cwd, path);
|
|
5586
5640
|
};
|
|
@@ -5618,7 +5672,7 @@ class DirEntry {
|
|
|
5618
5672
|
|
|
5619
5673
|
const dir = this.path;
|
|
5620
5674
|
try {
|
|
5621
|
-
await readdir
|
|
5675
|
+
await readdir(dir);
|
|
5622
5676
|
} catch (err) {
|
|
5623
5677
|
if (this._removeWatcher) {
|
|
5624
5678
|
this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir));
|
|
@@ -5655,14 +5709,14 @@ const STAT_METHOD_L = 'lstat';
|
|
|
5655
5709
|
class WatchHelper {
|
|
5656
5710
|
constructor(path, watchPath, follow, fsw) {
|
|
5657
5711
|
this.fsw = fsw;
|
|
5658
|
-
this.path = path = path.replace(REPLACER_RE, EMPTY_STR
|
|
5712
|
+
this.path = path = path.replace(REPLACER_RE, EMPTY_STR);
|
|
5659
5713
|
this.watchPath = watchPath;
|
|
5660
5714
|
this.fullWatchPath = sysPath.resolve(watchPath);
|
|
5661
5715
|
this.hasGlob = watchPath !== path;
|
|
5662
5716
|
/** @type {object|boolean} */
|
|
5663
|
-
if (path === EMPTY_STR
|
|
5717
|
+
if (path === EMPTY_STR) this.hasGlob = false;
|
|
5664
5718
|
this.globSymlink = this.hasGlob && follow ? undefined : false;
|
|
5665
|
-
this.globFilter = this.hasGlob ? anymatch
|
|
5719
|
+
this.globFilter = this.hasGlob ? anymatch(path, undefined, ANYMATCH_OPTS) : false;
|
|
5666
5720
|
this.dirParts = this.getDirParts(path);
|
|
5667
5721
|
this.dirParts.forEach((parts) => {
|
|
5668
5722
|
if (parts.length > 1) parts.pop();
|
|
@@ -5696,7 +5750,7 @@ class WatchHelper {
|
|
|
5696
5750
|
const {stats} = entry;
|
|
5697
5751
|
if (stats && stats.isSymbolicLink()) return this.filterDir(entry);
|
|
5698
5752
|
const resolvedPath = this.entryPath(entry);
|
|
5699
|
-
const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE
|
|
5753
|
+
const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ?
|
|
5700
5754
|
this.globFilter(resolvedPath) : true;
|
|
5701
5755
|
return matchesGlob &&
|
|
5702
5756
|
this.fsw._isntIgnored(resolvedPath, stats) &&
|
|
@@ -5706,7 +5760,7 @@ class WatchHelper {
|
|
|
5706
5760
|
getDirParts(path) {
|
|
5707
5761
|
if (!this.hasGlob) return [];
|
|
5708
5762
|
const parts = [];
|
|
5709
|
-
const expandedPath = path.includes(BRACE_START
|
|
5763
|
+
const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path];
|
|
5710
5764
|
expandedPath.forEach((path) => {
|
|
5711
5765
|
parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE));
|
|
5712
5766
|
});
|
|
@@ -5720,7 +5774,7 @@ class WatchHelper {
|
|
|
5720
5774
|
this.unmatchedGlob = !this.dirParts.some((parts) => {
|
|
5721
5775
|
return parts.every((part, i) => {
|
|
5722
5776
|
if (part === GLOBSTAR) globstar = true;
|
|
5723
|
-
return globstar || !entryParts[0][i] || anymatch
|
|
5777
|
+
return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS);
|
|
5724
5778
|
});
|
|
5725
5779
|
});
|
|
5726
5780
|
}
|
|
@@ -5773,7 +5827,7 @@ constructor(_opts) {
|
|
|
5773
5827
|
if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling;
|
|
5774
5828
|
|
|
5775
5829
|
// If we can't use fsevents, ensure the options reflect it's disabled.
|
|
5776
|
-
const canUseFsEvents =
|
|
5830
|
+
const canUseFsEvents = FsEventsHandler.canUse();
|
|
5777
5831
|
if (!canUseFsEvents) opts.useFsEvents = false;
|
|
5778
5832
|
|
|
5779
5833
|
// Use polling on Mac if not using fsevents.
|
|
@@ -5815,13 +5869,13 @@ constructor(_opts) {
|
|
|
5815
5869
|
if (!awf.pollInterval) awf.pollInterval = 100;
|
|
5816
5870
|
this._pendingWrites = new Map();
|
|
5817
5871
|
}
|
|
5818
|
-
if (opts.ignored) opts.ignored = arrify
|
|
5872
|
+
if (opts.ignored) opts.ignored = arrify(opts.ignored);
|
|
5819
5873
|
|
|
5820
5874
|
let readyCalls = 0;
|
|
5821
5875
|
this._emitReady = () => {
|
|
5822
5876
|
readyCalls++;
|
|
5823
5877
|
if (readyCalls >= this._readyCount) {
|
|
5824
|
-
this._emitReady = EMPTY_FN
|
|
5878
|
+
this._emitReady = EMPTY_FN;
|
|
5825
5879
|
this._readyEmitted = true;
|
|
5826
5880
|
// use process.nextTick to allow time for listener to be bound
|
|
5827
5881
|
process.nextTick(() => this.emit(EV_READY));
|
|
@@ -5833,9 +5887,9 @@ constructor(_opts) {
|
|
|
5833
5887
|
|
|
5834
5888
|
// Initialize with proper watcher.
|
|
5835
5889
|
if (opts.useFsEvents) {
|
|
5836
|
-
this._fsEventsHandler = new
|
|
5890
|
+
this._fsEventsHandler = new FsEventsHandler(this);
|
|
5837
5891
|
} else {
|
|
5838
|
-
this._nodeFsHandler = new
|
|
5892
|
+
this._nodeFsHandler = new NodeFsHandler(this);
|
|
5839
5893
|
}
|
|
5840
5894
|
|
|
5841
5895
|
// You’re frozen when your heart’s not open.
|
|
@@ -5869,7 +5923,7 @@ add(paths_, _origAdd, _internal) {
|
|
|
5869
5923
|
|
|
5870
5924
|
// set aside negated glob strings
|
|
5871
5925
|
paths = paths.filter((path) => {
|
|
5872
|
-
if (path.startsWith(BANG
|
|
5926
|
+
if (path.startsWith(BANG)) {
|
|
5873
5927
|
this._ignoredPaths.add(path.slice(1));
|
|
5874
5928
|
return false;
|
|
5875
5929
|
}
|
|
@@ -5984,7 +6038,7 @@ getWatched() {
|
|
|
5984
6038
|
|
|
5985
6039
|
emitWithAll(event, args) {
|
|
5986
6040
|
this.emit(...args);
|
|
5987
|
-
if (event !== EV_ERROR
|
|
6041
|
+
if (event !== EV_ERROR) this.emit(EV_ALL, ...args);
|
|
5988
6042
|
}
|
|
5989
6043
|
|
|
5990
6044
|
// Common helpers
|
|
@@ -6004,7 +6058,7 @@ async _emit(event, path, val1, val2, val3) {
|
|
|
6004
6058
|
if (this.closed) return;
|
|
6005
6059
|
|
|
6006
6060
|
const opts = this.options;
|
|
6007
|
-
if (isWindows
|
|
6061
|
+
if (isWindows) path = sysPath.normalize(path);
|
|
6008
6062
|
if (opts.cwd) path = sysPath.relative(opts.cwd, path);
|
|
6009
6063
|
/** @type Array<any> */
|
|
6010
6064
|
const args = [event, path];
|
|
@@ -6020,7 +6074,7 @@ async _emit(event, path, val1, val2, val3) {
|
|
|
6020
6074
|
}
|
|
6021
6075
|
|
|
6022
6076
|
if (opts.atomic) {
|
|
6023
|
-
if (event === EV_UNLINK
|
|
6077
|
+
if (event === EV_UNLINK) {
|
|
6024
6078
|
this._pendingUnlinks.set(path, args);
|
|
6025
6079
|
setTimeout(() => {
|
|
6026
6080
|
this._pendingUnlinks.forEach((entry, path) => {
|
|
@@ -6031,16 +6085,16 @@ async _emit(event, path, val1, val2, val3) {
|
|
|
6031
6085
|
}, typeof opts.atomic === 'number' ? opts.atomic : 100);
|
|
6032
6086
|
return this;
|
|
6033
6087
|
}
|
|
6034
|
-
if (event === EV_ADD
|
|
6035
|
-
event = args[0] = EV_CHANGE
|
|
6088
|
+
if (event === EV_ADD && this._pendingUnlinks.has(path)) {
|
|
6089
|
+
event = args[0] = EV_CHANGE;
|
|
6036
6090
|
this._pendingUnlinks.delete(path);
|
|
6037
6091
|
}
|
|
6038
6092
|
}
|
|
6039
6093
|
|
|
6040
|
-
if (awf && (event === EV_ADD
|
|
6094
|
+
if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) {
|
|
6041
6095
|
const awfEmit = (err, stats) => {
|
|
6042
6096
|
if (err) {
|
|
6043
|
-
event = args[0] = EV_ERROR
|
|
6097
|
+
event = args[0] = EV_ERROR;
|
|
6044
6098
|
args[1] = err;
|
|
6045
6099
|
this.emitWithAll(event, args);
|
|
6046
6100
|
} else if (stats) {
|
|
@@ -6058,18 +6112,18 @@ async _emit(event, path, val1, val2, val3) {
|
|
|
6058
6112
|
return this;
|
|
6059
6113
|
}
|
|
6060
6114
|
|
|
6061
|
-
if (event === EV_CHANGE
|
|
6062
|
-
const isThrottled = !this._throttle(EV_CHANGE
|
|
6115
|
+
if (event === EV_CHANGE) {
|
|
6116
|
+
const isThrottled = !this._throttle(EV_CHANGE, path, 50);
|
|
6063
6117
|
if (isThrottled) return this;
|
|
6064
6118
|
}
|
|
6065
6119
|
|
|
6066
6120
|
if (opts.alwaysStat && val1 === undefined &&
|
|
6067
|
-
(event === EV_ADD
|
|
6121
|
+
(event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE)
|
|
6068
6122
|
) {
|
|
6069
6123
|
const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path;
|
|
6070
6124
|
let stats;
|
|
6071
6125
|
try {
|
|
6072
|
-
stats = await stat
|
|
6126
|
+
stats = await stat(fullPath);
|
|
6073
6127
|
} catch (err) {}
|
|
6074
6128
|
// Suppress event when fs_stat fails, to avoid sending undefined 'stat'
|
|
6075
6129
|
if (!stats || this.closed) return;
|
|
@@ -6090,7 +6144,7 @@ _handleError(error) {
|
|
|
6090
6144
|
if (error && code !== 'ENOENT' && code !== 'ENOTDIR' &&
|
|
6091
6145
|
(!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES'))
|
|
6092
6146
|
) {
|
|
6093
|
-
this.emit(EV_ERROR
|
|
6147
|
+
this.emit(EV_ERROR, error);
|
|
6094
6148
|
}
|
|
6095
6149
|
return error || this.closed;
|
|
6096
6150
|
}
|
|
@@ -6215,11 +6269,11 @@ _isIgnored(path, stats) {
|
|
|
6215
6269
|
const ign = this.options.ignored;
|
|
6216
6270
|
|
|
6217
6271
|
const ignored = ign && ign.map(normalizeIgnored(cwd));
|
|
6218
|
-
const paths = arrify
|
|
6272
|
+
const paths = arrify(ignored)
|
|
6219
6273
|
.filter((path) => typeof path === STRING_TYPE && !isGlob(path))
|
|
6220
6274
|
.map((path) => path + SLASH_GLOBSTAR);
|
|
6221
6275
|
const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths);
|
|
6222
|
-
this._userIgnored = anymatch
|
|
6276
|
+
this._userIgnored = anymatch(list, undefined, ANYMATCH_OPTS);
|
|
6223
6277
|
}
|
|
6224
6278
|
|
|
6225
6279
|
return this._userIgnored([path, stats]);
|
|
@@ -6330,14 +6384,14 @@ _remove(directory, item, isDirectory) {
|
|
|
6330
6384
|
if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path);
|
|
6331
6385
|
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
|
6332
6386
|
const event = this._pendingWrites.get(relPath).cancelWait();
|
|
6333
|
-
if (event === EV_ADD
|
|
6387
|
+
if (event === EV_ADD) return;
|
|
6334
6388
|
}
|
|
6335
6389
|
|
|
6336
6390
|
// The Entry will either be a directory that just got removed
|
|
6337
6391
|
// or a bogus entry to a file, in either case we have to remove it
|
|
6338
6392
|
this._watched.delete(path);
|
|
6339
6393
|
this._watched.delete(fullPath);
|
|
6340
|
-
const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK
|
|
6394
|
+
const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK;
|
|
6341
6395
|
if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path);
|
|
6342
6396
|
|
|
6343
6397
|
// Avoid conflicts if we later create another file with the same name
|
|
@@ -6385,12 +6439,12 @@ _addPathCloser(path, closer) {
|
|
|
6385
6439
|
_readdirp(root, opts) {
|
|
6386
6440
|
if (this.closed) return;
|
|
6387
6441
|
const options = {type: EV_ALL, alwaysStat: true, lstat: true, ...opts};
|
|
6388
|
-
let stream =
|
|
6442
|
+
let stream = readdirp(root, options);
|
|
6389
6443
|
this._streams.add(stream);
|
|
6390
6444
|
stream.once(STR_CLOSE, () => {
|
|
6391
6445
|
stream = undefined;
|
|
6392
6446
|
});
|
|
6393
|
-
stream.once(STR_END
|
|
6447
|
+
stream.once(STR_END, () => {
|
|
6394
6448
|
if (stream) {
|
|
6395
6449
|
this._streams.delete(stream);
|
|
6396
6450
|
stream = undefined;
|
|
@@ -6402,7 +6456,7 @@ _readdirp(root, opts) {
|
|
|
6402
6456
|
}
|
|
6403
6457
|
|
|
6404
6458
|
// Export FSWatcher class
|
|
6405
|
-
|
|
6459
|
+
chokidar.FSWatcher = FSWatcher;
|
|
6406
6460
|
|
|
6407
6461
|
/**
|
|
6408
6462
|
* Instantiates watcher with paths to be tracked.
|
|
@@ -6416,15 +6470,10 @@ const watch = (paths, options) => {
|
|
|
6416
6470
|
return watcher;
|
|
6417
6471
|
};
|
|
6418
6472
|
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
var chokidar = {
|
|
6422
|
-
FSWatcher: FSWatcher_1,
|
|
6423
|
-
watch: watch_1
|
|
6424
|
-
};
|
|
6473
|
+
chokidar.watch = watch;
|
|
6425
6474
|
|
|
6426
6475
|
exports.braces_1 = braces_1;
|
|
6427
6476
|
exports.chokidar = chokidar;
|
|
6428
|
-
exports.picomatch = picomatch$
|
|
6429
|
-
exports.utils = utils$
|
|
6477
|
+
exports.picomatch = picomatch$2;
|
|
6478
|
+
exports.utils = utils$3;
|
|
6430
6479
|
//# sourceMappingURL=index.js.map
|