step-node-agent 3.29.2 → 3.29.3-customJava25v2
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/node_modules/har-validator/node_modules/ajv/README.md +14 -6
- package/node_modules/har-validator/node_modules/ajv/dist/ajv.bundle.js +23 -11
- package/node_modules/har-validator/node_modules/ajv/dist/ajv.min.js +2 -2
- package/node_modules/har-validator/node_modules/ajv/dist/ajv.min.js.map +1 -1
- package/node_modules/har-validator/node_modules/ajv/lib/ajv.d.ts +5 -0
- package/node_modules/har-validator/node_modules/ajv/lib/compile/index.js +8 -6
- package/node_modules/har-validator/node_modules/ajv/lib/dot/pattern.jst +15 -4
- package/node_modules/har-validator/node_modules/ajv/lib/dotjs/pattern.js +14 -4
- package/node_modules/har-validator/node_modules/ajv/package.json +2 -1
- package/node_modules/har-validator/node_modules/ajv/scripts/info +0 -0
- package/node_modules/har-validator/node_modules/ajv/scripts/prepare-tests +0 -0
- package/node_modules/har-validator/node_modules/ajv/scripts/publish-built-version +0 -0
- package/node_modules/har-validator/node_modules/ajv/scripts/travis-gh-pages +0 -0
- package/node_modules/minimatch/README.md +37 -0
- package/node_modules/minimatch/minimatch.js +160 -102
- package/node_modules/minimatch/package.json +2 -2
- package/node_modules/qs/.editorconfig +1 -1
- package/node_modules/qs/CHANGELOG.md +14 -1
- package/node_modules/qs/README.md +11 -4
- package/node_modules/qs/dist/qs.js +20 -20
- package/node_modules/qs/lib/parse.js +21 -10
- package/node_modules/qs/lib/utils.js +28 -8
- package/node_modules/qs/package.json +1 -1
- package/node_modules/qs/test/parse.js +125 -9
- package/node_modules/qs/test/utils.js +36 -20
- package/node_modules/request/node_modules/qs/CHANGELOG.md +12 -0
- package/node_modules/request/node_modules/qs/README.md +9 -3
- package/node_modules/request/node_modules/qs/dist/qs.js +10 -10
- package/node_modules/request/node_modules/qs/lib/parse.js +4 -4
- package/node_modules/request/node_modules/qs/lib/utils.js +6 -6
- package/node_modules/request/node_modules/qs/package.json +13 -4
- package/node_modules/request/node_modules/qs/test/parse.js +9 -0
- package/node_modules/request/node_modules/qs/test/stringify.js +6 -0
- package/node_modules/underscore/amd/_setup.js +1 -1
- package/node_modules/underscore/amd/pipe.js +13 -0
- package/node_modules/underscore/cjs/_setup.js +1 -1
- package/node_modules/underscore/cjs/pipe.js +12 -0
- package/node_modules/underscore/modules/_flatten.js +20 -18
- package/node_modules/underscore/modules/_setup.js +1 -1
- package/node_modules/underscore/modules/index.js +2 -2
- package/node_modules/underscore/modules/isEqual.js +108 -93
- package/node_modules/underscore/modules/package.json +1 -1
- package/node_modules/underscore/package.json +1 -1
- package/node_modules/underscore/underscore-esm-min.js +3 -3
- package/node_modules/underscore/underscore-esm-min.js.map +1 -1
- package/node_modules/underscore/underscore-esm.js +132 -115
- package/node_modules/underscore/underscore-esm.js.map +1 -1
- package/node_modules/underscore/underscore-min.js +3 -3
- package/node_modules/underscore/underscore-min.js.map +1 -1
- package/node_modules/underscore/underscore-node-f.cjs +132 -115
- package/node_modules/underscore/underscore-node-f.cjs.map +1 -1
- package/node_modules/underscore/underscore-node.cjs +2 -2
- package/node_modules/underscore/underscore-node.mjs +2 -2
- package/node_modules/underscore/underscore-umd-min.js +3 -3
- package/node_modules/underscore/underscore-umd-min.js.map +1 -1
- package/node_modules/underscore/underscore-umd.js +132 -115
- package/node_modules/underscore/underscore-umd.js.map +1 -1
- package/node_modules/underscore/underscore.js +132 -115
- package/package.json +1 -1
- package/node_modules/request/node_modules/qs/bower.json +0 -21
- package/node_modules/request/node_modules/qs/component.json +0 -15
- package/node_modules/underscore/amd/_set.js +0 -21
- package/node_modules/underscore/amd/set.js +0 -15
- package/node_modules/underscore/cjs/_set.js +0 -21
- package/node_modules/underscore/cjs/set.js +0 -15
|
@@ -203,6 +203,11 @@ declare namespace ajv {
|
|
|
203
203
|
logger?: CustomLogger | false;
|
|
204
204
|
nullable?: boolean;
|
|
205
205
|
serialize?: ((schema: object | boolean) => any) | false;
|
|
206
|
+
regExp?: (pattern: string) => RegExpLike;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
interface RegExpLike {
|
|
210
|
+
test: (s: string) => boolean;
|
|
206
211
|
}
|
|
207
212
|
|
|
208
213
|
type FormatValidator = string | RegExp | ((data: string) => boolean | PromiseLike<any>);
|
|
@@ -42,6 +42,11 @@ function compile(schema, root, localRefs, baseId) {
|
|
|
42
42
|
, defaultsHash = {}
|
|
43
43
|
, customRules = [];
|
|
44
44
|
|
|
45
|
+
function patternCode(i, patterns) {
|
|
46
|
+
var regExpCode = opts.regExp ? 'regExp' : 'new RegExp';
|
|
47
|
+
return 'var pattern' + i + ' = ' + regExpCode + '(' + util.toQuotedString(patterns[i]) + ');';
|
|
48
|
+
}
|
|
49
|
+
|
|
45
50
|
root = root || { schema: schema, refVal: refVal, refs: refs };
|
|
46
51
|
|
|
47
52
|
var c = checkCompiling.call(this, schema, root, baseId);
|
|
@@ -128,6 +133,7 @@ function compile(schema, root, localRefs, baseId) {
|
|
|
128
133
|
'equal',
|
|
129
134
|
'ucs2length',
|
|
130
135
|
'ValidationError',
|
|
136
|
+
'regExp',
|
|
131
137
|
sourceCode
|
|
132
138
|
);
|
|
133
139
|
|
|
@@ -141,7 +147,8 @@ function compile(schema, root, localRefs, baseId) {
|
|
|
141
147
|
customRules,
|
|
142
148
|
equal,
|
|
143
149
|
ucs2length,
|
|
144
|
-
ValidationError
|
|
150
|
+
ValidationError,
|
|
151
|
+
opts.regExp
|
|
145
152
|
);
|
|
146
153
|
|
|
147
154
|
refVal[0] = validate;
|
|
@@ -358,11 +365,6 @@ function compIndex(schema, root, baseId) {
|
|
|
358
365
|
}
|
|
359
366
|
|
|
360
367
|
|
|
361
|
-
function patternCode(i, patterns) {
|
|
362
|
-
return 'var pattern' + i + ' = new RegExp(' + util.toQuotedString(patterns[i]) + ');';
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
|
|
366
368
|
function defaultCode(i) {
|
|
367
369
|
return 'var default' + i + ' = defaults[' + i + '];';
|
|
368
370
|
}
|
|
@@ -4,11 +4,22 @@
|
|
|
4
4
|
{{# def.$data }}
|
|
5
5
|
|
|
6
6
|
{{
|
|
7
|
-
var $
|
|
8
|
-
? '(new RegExp(' + $schemaValue + '))'
|
|
9
|
-
: it.usePattern($schema);
|
|
7
|
+
var $regExpCode = it.opts.regExp ? 'regExp' : 'new RegExp';
|
|
10
8
|
}}
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
{{? $isData }}
|
|
11
|
+
var {{=$valid}} = true;
|
|
12
|
+
try {
|
|
13
|
+
{{=$valid}} = {{=$regExpCode}}({{=$schemaValue}}).test({{=$data}});
|
|
14
|
+
} catch(e) {
|
|
15
|
+
{{=$valid}} = false;
|
|
16
|
+
}
|
|
17
|
+
if ({{# def.$dataNotType:'string' }} !{{=$valid}}) {
|
|
18
|
+
{{??}}
|
|
19
|
+
{{
|
|
20
|
+
var $regexp = it.usePattern($schema);
|
|
21
|
+
}}
|
|
22
|
+
if ({{# def.$dataNotType:'string' }} !{{=$regexp}}.test({{=$data}}) ) {
|
|
23
|
+
{{?}}
|
|
13
24
|
{{# def.error:'pattern' }}
|
|
14
25
|
} {{? $breakOnError }} else { {{?}}
|
|
@@ -8,6 +8,7 @@ module.exports = function generate_pattern(it, $keyword, $ruleType) {
|
|
|
8
8
|
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
|
|
9
9
|
var $breakOnError = !it.opts.allErrors;
|
|
10
10
|
var $data = 'data' + ($dataLvl || '');
|
|
11
|
+
var $valid = 'valid' + $lvl;
|
|
11
12
|
var $isData = it.opts.$data && $schema && $schema.$data,
|
|
12
13
|
$schemaValue;
|
|
13
14
|
if ($isData) {
|
|
@@ -16,12 +17,21 @@ module.exports = function generate_pattern(it, $keyword, $ruleType) {
|
|
|
16
17
|
} else {
|
|
17
18
|
$schemaValue = $schema;
|
|
18
19
|
}
|
|
19
|
-
var $
|
|
20
|
-
out += 'if ( ';
|
|
20
|
+
var $regExpCode = it.opts.regExp ? 'regExp' : 'new RegExp';
|
|
21
21
|
if ($isData) {
|
|
22
|
-
out += ' (' + ($
|
|
22
|
+
out += ' var ' + ($valid) + ' = true; try { ' + ($valid) + ' = ' + ($regExpCode) + '(' + ($schemaValue) + ').test(' + ($data) + '); } catch(e) { ' + ($valid) + ' = false; } if ( ';
|
|
23
|
+
if ($isData) {
|
|
24
|
+
out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
|
|
25
|
+
}
|
|
26
|
+
out += ' !' + ($valid) + ') {';
|
|
27
|
+
} else {
|
|
28
|
+
var $regexp = it.usePattern($schema);
|
|
29
|
+
out += ' if ( ';
|
|
30
|
+
if ($isData) {
|
|
31
|
+
out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
|
|
32
|
+
}
|
|
33
|
+
out += ' !' + ($regexp) + '.test(' + ($data) + ') ) {';
|
|
23
34
|
}
|
|
24
|
-
out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { ';
|
|
25
35
|
var $$outStack = $$outStack || [];
|
|
26
36
|
$$outStack.push(out);
|
|
27
37
|
out = ''; /* istanbul ignore else */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ajv",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.14.0",
|
|
4
4
|
"description": "Another JSON Schema Validator",
|
|
5
5
|
"main": "lib/ajv.js",
|
|
6
6
|
"typings": "lib/ajv.d.ts",
|
|
@@ -90,6 +90,7 @@
|
|
|
90
90
|
"mocha": "^8.0.1",
|
|
91
91
|
"nyc": "^15.0.0",
|
|
92
92
|
"pre-commit": "^1.1.1",
|
|
93
|
+
"re2": "^1.21.4",
|
|
93
94
|
"require-globify": "^1.3.0",
|
|
94
95
|
"typescript": "^3.9.5",
|
|
95
96
|
"uglify-js": "^3.6.9",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -10,6 +10,43 @@ This is the matching library used internally by npm.
|
|
|
10
10
|
It works by converting glob expressions into JavaScript `RegExp`
|
|
11
11
|
objects.
|
|
12
12
|
|
|
13
|
+
## Important Security Consideration!
|
|
14
|
+
|
|
15
|
+
> [!WARNING]
|
|
16
|
+
> This library uses JavaScript regular expressions. Please read
|
|
17
|
+
> the following warning carefully, and be thoughtful about what
|
|
18
|
+
> you provide to this library in production systems.
|
|
19
|
+
|
|
20
|
+
_Any_ library in JavaScript that deals with matching string
|
|
21
|
+
patterns using regular expressions will be subject to
|
|
22
|
+
[ReDoS](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS)
|
|
23
|
+
if the pattern is generated using untrusted input.
|
|
24
|
+
|
|
25
|
+
Efforts have been made to mitigate risk as much as is feasible in
|
|
26
|
+
such a library, providing maximum recursion depths and so forth,
|
|
27
|
+
but these measures can only ultimately protect against accidents,
|
|
28
|
+
not malice. A dedicated attacker can _always_ find patterns that
|
|
29
|
+
cannot be defended against by a bash-compatible glob pattern
|
|
30
|
+
matching system that uses JavaScript regular expressions.
|
|
31
|
+
|
|
32
|
+
To be extremely clear:
|
|
33
|
+
|
|
34
|
+
> [!WARNING]
|
|
35
|
+
> **If you create a system where you take user input, and use
|
|
36
|
+
> that input as the source of a Regular Expression pattern, in
|
|
37
|
+
> this or any extant glob matcher in JavaScript, you will be
|
|
38
|
+
> pwned.**
|
|
39
|
+
|
|
40
|
+
A future version of this library _may_ use a different matching
|
|
41
|
+
algorithm which does not exhibit backtracking problems. If and
|
|
42
|
+
when that happens, it will likely be a sweeping change, and those
|
|
43
|
+
improvements will **not** be backported to legacy versions.
|
|
44
|
+
|
|
45
|
+
In the near term, it is not reasonable to continue to play
|
|
46
|
+
whack-a-mole with security advisories, and so any future ReDoS
|
|
47
|
+
reports will be considered "working as intended", and resolved
|
|
48
|
+
entirely by this warning.
|
|
49
|
+
|
|
13
50
|
## Usage
|
|
14
51
|
|
|
15
52
|
```javascript
|
|
@@ -142,6 +142,8 @@ function Minimatch (pattern, options) {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
this.options = options
|
|
145
|
+
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== undefined
|
|
146
|
+
? options.maxGlobstarRecursion : 200
|
|
145
147
|
this.set = []
|
|
146
148
|
this.pattern = pattern
|
|
147
149
|
this.regexp = null
|
|
@@ -390,6 +392,9 @@ function parse (pattern, isSub) {
|
|
|
390
392
|
continue
|
|
391
393
|
}
|
|
392
394
|
|
|
395
|
+
// coalesce consecutive non-globstar * characters
|
|
396
|
+
if (c === '*' && stateChar === '*') continue
|
|
397
|
+
|
|
393
398
|
// if we already have a stateChar, then it means
|
|
394
399
|
// that there was something like ** or +? in there.
|
|
395
400
|
// Handle the stateChar, then proceed with this one.
|
|
@@ -784,109 +789,173 @@ Minimatch.prototype.match = function match (f, partial) {
|
|
|
784
789
|
// out of pattern, then that's fine, as long as all
|
|
785
790
|
// the parts match.
|
|
786
791
|
Minimatch.prototype.matchOne = function (file, pattern, partial) {
|
|
787
|
-
|
|
792
|
+
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
|
793
|
+
return this._matchGlobstar(file, pattern, partial, 0, 0)
|
|
794
|
+
}
|
|
795
|
+
return this._matchOne(file, pattern, partial, 0, 0)
|
|
796
|
+
}
|
|
788
797
|
|
|
789
|
-
|
|
790
|
-
|
|
798
|
+
Minimatch.prototype._matchGlobstar = function (file, pattern, partial, fileIndex, patternIndex) {
|
|
799
|
+
var i
|
|
791
800
|
|
|
792
|
-
|
|
801
|
+
// find first globstar from patternIndex
|
|
802
|
+
var firstgs = -1
|
|
803
|
+
for (i = patternIndex; i < pattern.length; i++) {
|
|
804
|
+
if (pattern[i] === GLOBSTAR) { firstgs = i; break }
|
|
805
|
+
}
|
|
793
806
|
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
; fi++, pi++) {
|
|
800
|
-
this.debug('matchOne loop')
|
|
801
|
-
var p = pattern[pi]
|
|
802
|
-
var f = file[fi]
|
|
807
|
+
// find last globstar
|
|
808
|
+
var lastgs = -1
|
|
809
|
+
for (i = pattern.length - 1; i >= 0; i--) {
|
|
810
|
+
if (pattern[i] === GLOBSTAR) { lastgs = i; break }
|
|
811
|
+
}
|
|
803
812
|
|
|
804
|
-
|
|
813
|
+
var head = pattern.slice(patternIndex, firstgs)
|
|
814
|
+
var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs)
|
|
815
|
+
var tail = partial ? [] : pattern.slice(lastgs + 1)
|
|
805
816
|
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
if (
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
//
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
// - matchOne(x/y/z/c, c) -> no
|
|
833
|
-
// - matchOne(y/z/c, c) -> no
|
|
834
|
-
// - matchOne(z/c, c) -> no
|
|
835
|
-
// - matchOne(c, c) yes, hit
|
|
836
|
-
var fr = fi
|
|
837
|
-
var pr = pi + 1
|
|
838
|
-
if (pr === pl) {
|
|
839
|
-
this.debug('** at the end')
|
|
840
|
-
// a ** at the end will just swallow the rest.
|
|
841
|
-
// We have found a match.
|
|
842
|
-
// however, it will not swallow /.x, unless
|
|
843
|
-
// options.dot is set.
|
|
844
|
-
// . and .. are *never* matched by **, for explosively
|
|
845
|
-
// exponential reasons.
|
|
846
|
-
for (; fi < fl; fi++) {
|
|
847
|
-
if (file[fi] === '.' || file[fi] === '..' ||
|
|
848
|
-
(!options.dot && file[fi].charAt(0) === '.')) return false
|
|
849
|
-
}
|
|
850
|
-
return true
|
|
817
|
+
// check the head
|
|
818
|
+
if (head.length) {
|
|
819
|
+
var fileHead = file.slice(fileIndex, fileIndex + head.length)
|
|
820
|
+
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
|
821
|
+
return false
|
|
822
|
+
}
|
|
823
|
+
fileIndex += head.length
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
// check the tail
|
|
827
|
+
var fileTailMatch = 0
|
|
828
|
+
if (tail.length) {
|
|
829
|
+
if (tail.length + fileIndex > file.length) return false
|
|
830
|
+
|
|
831
|
+
var tailStart = file.length - tail.length
|
|
832
|
+
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
|
833
|
+
fileTailMatch = tail.length
|
|
834
|
+
} else {
|
|
835
|
+
// affordance for stuff like a/**/* matching a/b/
|
|
836
|
+
if (file[file.length - 1] !== '' ||
|
|
837
|
+
fileIndex + tail.length === file.length) {
|
|
838
|
+
return false
|
|
839
|
+
}
|
|
840
|
+
tailStart--
|
|
841
|
+
if (!this._matchOne(file, tail, partial, tailStart, 0)) {
|
|
842
|
+
return false
|
|
851
843
|
}
|
|
844
|
+
fileTailMatch = tail.length + 1
|
|
845
|
+
}
|
|
846
|
+
}
|
|
852
847
|
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
// found a match.
|
|
863
|
-
return true
|
|
864
|
-
} else {
|
|
865
|
-
// can't swallow "." or ".." ever.
|
|
866
|
-
// can only swallow ".foo" when explicitly asked.
|
|
867
|
-
if (swallowee === '.' || swallowee === '..' ||
|
|
868
|
-
(!options.dot && swallowee.charAt(0) === '.')) {
|
|
869
|
-
this.debug('dot detected!', file, fr, pattern, pr)
|
|
870
|
-
break
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
// ** swallows a segment, and continue.
|
|
874
|
-
this.debug('globstar swallow a segment, and continue')
|
|
875
|
-
fr++
|
|
876
|
-
}
|
|
848
|
+
// if body is empty (single ** between head and tail)
|
|
849
|
+
if (!body.length) {
|
|
850
|
+
var sawSome = !!fileTailMatch
|
|
851
|
+
for (i = fileIndex; i < file.length - fileTailMatch; i++) {
|
|
852
|
+
var f = String(file[i])
|
|
853
|
+
sawSome = true
|
|
854
|
+
if (f === '.' || f === '..' ||
|
|
855
|
+
(!this.options.dot && f.charAt(0) === '.')) {
|
|
856
|
+
return false
|
|
877
857
|
}
|
|
858
|
+
}
|
|
859
|
+
return partial || sawSome
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
// split body into segments at each GLOBSTAR
|
|
863
|
+
var bodySegments = [[[], 0]]
|
|
864
|
+
var currentBody = bodySegments[0]
|
|
865
|
+
var nonGsParts = 0
|
|
866
|
+
var nonGsPartsSums = [0]
|
|
867
|
+
for (var bi = 0; bi < body.length; bi++) {
|
|
868
|
+
var b = body[bi]
|
|
869
|
+
if (b === GLOBSTAR) {
|
|
870
|
+
nonGsPartsSums.push(nonGsParts)
|
|
871
|
+
currentBody = [[], 0]
|
|
872
|
+
bodySegments.push(currentBody)
|
|
873
|
+
} else {
|
|
874
|
+
currentBody[0].push(b)
|
|
875
|
+
nonGsParts++
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
var idx = bodySegments.length - 1
|
|
880
|
+
var fileLength = file.length - fileTailMatch
|
|
881
|
+
for (var si = 0; si < bodySegments.length; si++) {
|
|
882
|
+
bodySegments[si][1] = fileLength -
|
|
883
|
+
(nonGsPartsSums[idx--] + bodySegments[si][0].length)
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
return !!this._matchGlobStarBodySections(
|
|
887
|
+
file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch
|
|
888
|
+
)
|
|
889
|
+
}
|
|
878
890
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
891
|
+
// return false for "nope, not matching"
|
|
892
|
+
// return null for "not matching, cannot keep trying"
|
|
893
|
+
Minimatch.prototype._matchGlobStarBodySections = function (
|
|
894
|
+
file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail
|
|
895
|
+
) {
|
|
896
|
+
var bs = bodySegments[bodyIndex]
|
|
897
|
+
if (!bs) {
|
|
898
|
+
// just make sure there are no bad dots
|
|
899
|
+
for (var i = fileIndex; i < file.length; i++) {
|
|
900
|
+
sawTail = true
|
|
901
|
+
var f = file[i]
|
|
902
|
+
if (f === '.' || f === '..' ||
|
|
903
|
+
(!this.options.dot && f.charAt(0) === '.')) {
|
|
904
|
+
return false
|
|
887
905
|
}
|
|
906
|
+
}
|
|
907
|
+
return sawTail
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
var body = bs[0]
|
|
911
|
+
var after = bs[1]
|
|
912
|
+
while (fileIndex <= after) {
|
|
913
|
+
var m = this._matchOne(
|
|
914
|
+
file.slice(0, fileIndex + body.length),
|
|
915
|
+
body,
|
|
916
|
+
partial,
|
|
917
|
+
fileIndex,
|
|
918
|
+
0
|
|
919
|
+
)
|
|
920
|
+
// if limit exceeded, no match. intentional false negative,
|
|
921
|
+
// acceptable break in correctness for security.
|
|
922
|
+
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
|
923
|
+
var sub = this._matchGlobStarBodySections(
|
|
924
|
+
file, bodySegments,
|
|
925
|
+
fileIndex + body.length, bodyIndex + 1,
|
|
926
|
+
partial, globStarDepth + 1, sawTail
|
|
927
|
+
)
|
|
928
|
+
if (sub !== false) {
|
|
929
|
+
return sub
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
var f = file[fileIndex]
|
|
933
|
+
if (f === '.' || f === '..' ||
|
|
934
|
+
(!this.options.dot && f.charAt(0) === '.')) {
|
|
888
935
|
return false
|
|
889
936
|
}
|
|
937
|
+
fileIndex++
|
|
938
|
+
}
|
|
939
|
+
return partial || null
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
Minimatch.prototype._matchOne = function (file, pattern, partial, fileIndex, patternIndex) {
|
|
943
|
+
var fi, pi, fl, pl
|
|
944
|
+
for (
|
|
945
|
+
fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length
|
|
946
|
+
; (fi < fl) && (pi < pl)
|
|
947
|
+
; fi++, pi++
|
|
948
|
+
) {
|
|
949
|
+
this.debug('matchOne loop')
|
|
950
|
+
var p = pattern[pi]
|
|
951
|
+
var f = file[fi]
|
|
952
|
+
|
|
953
|
+
this.debug(pattern, p, f)
|
|
954
|
+
|
|
955
|
+
// should be impossible.
|
|
956
|
+
// some invalid regexp stuff in the set.
|
|
957
|
+
/* istanbul ignore if */
|
|
958
|
+
if (p === false || p === GLOBSTAR) return false
|
|
890
959
|
|
|
891
960
|
// something other than **
|
|
892
961
|
// non-magic patterns just have to match exactly
|
|
@@ -903,17 +972,6 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
|
|
|
903
972
|
if (!hit) return false
|
|
904
973
|
}
|
|
905
974
|
|
|
906
|
-
// Note: ending in / means that we'll get a final ""
|
|
907
|
-
// at the end of the pattern. This can only match a
|
|
908
|
-
// corresponding "" at the end of the file.
|
|
909
|
-
// If the file ends in /, then it can only match a
|
|
910
|
-
// a pattern that ends in /, unless the pattern just
|
|
911
|
-
// doesn't have any more for it. But, a/b/ should *not*
|
|
912
|
-
// match "a/b/*", even though "" matches against the
|
|
913
|
-
// [^/]*? pattern, except in partial mode, where it might
|
|
914
|
-
// simply not be reached yet.
|
|
915
|
-
// However, a/b/ should still satisfy a/*
|
|
916
|
-
|
|
917
975
|
// now either we fell off the end of the pattern, or we're done.
|
|
918
976
|
if (fi === fl && pi === pl) {
|
|
919
977
|
// ran out of pattern and filename at the same time.
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
|
|
3
3
|
"name": "minimatch",
|
|
4
4
|
"description": "a glob matcher in javascript",
|
|
5
|
-
"version": "3.1.
|
|
5
|
+
"version": "3.1.5",
|
|
6
6
|
"publishConfig": {
|
|
7
|
-
"tag": "v3
|
|
7
|
+
"tag": "legacy-v3"
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -1,5 +1,18 @@
|
|
|
1
|
+
## **6.14.2**
|
|
2
|
+
- [Fix] `parse`: mark overflow objects for indexed notation exceeding `arrayLimit` (#546)
|
|
3
|
+
- [Fix] `arrayLimit` means max count, not max index, in `combine`/`merge`/`parseArrayValue`
|
|
4
|
+
- [Fix] `parse`: throw on `arrayLimit` exceeded with indexed notation when `throwOnLimitExceeded` is true (#529)
|
|
5
|
+
- [Fix] `parse`: enforce `arrayLimit` on `comma`-parsed values
|
|
6
|
+
- [Fix] `parse`: fix error message to reflect arrayLimit as max index; remove extraneous comments (#545)
|
|
7
|
+
- [Robustness] avoid `.push`, use `void`
|
|
8
|
+
- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
|
|
9
|
+
- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
|
|
10
|
+
- [readme] replace runkit CI badge with shields.io check-runs badge
|
|
11
|
+
- [meta] fix changelog typo (`arrayLength` → `arrayLimit`)
|
|
12
|
+
- [actions] fix rebase workflow permissions
|
|
13
|
+
|
|
1
14
|
## **6.14.1**
|
|
2
|
-
- [Fix] ensure
|
|
15
|
+
- [Fix] ensure `arrayLimit` applies to `[]` notation as well
|
|
3
16
|
- [Fix] `parse`: when a custom decoder returns `null` for a key, ignore that key
|
|
4
17
|
- [Refactor] `parse`: extract key segment splitting helper
|
|
5
18
|
- [meta] add threat model
|
|
@@ -282,8 +282,8 @@ var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c');
|
|
|
282
282
|
assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] });
|
|
283
283
|
```
|
|
284
284
|
|
|
285
|
-
**qs** will also limit
|
|
286
|
-
Any array members with an index of
|
|
285
|
+
**qs** will also limit arrays to a maximum of `20` elements.
|
|
286
|
+
Any array members with an index of `20` or greater will instead be converted to an object with the index as the key.
|
|
287
287
|
This is needed to handle cases when someone sent, for example, `a[999999999]` and it will take significant time to iterate over this huge array.
|
|
288
288
|
|
|
289
289
|
```javascript
|
|
@@ -310,7 +310,8 @@ try {
|
|
|
310
310
|
|
|
311
311
|
When `throwOnLimitExceeded` is set to `false` (default), **qs** will parse up to the specified `arrayLimit` and if the limit is exceeded, the array will instead be converted to an object with the index as the key
|
|
312
312
|
|
|
313
|
-
To
|
|
313
|
+
To prevent array syntax (`a[]`, `a[0]`) from being parsed as arrays, set `parseArrays` to `false`.
|
|
314
|
+
Note that duplicate keys (e.g. `a=b&a=c`) may still produce arrays when `duplicates` is `'combine'` (the default).
|
|
314
315
|
|
|
315
316
|
```javascript
|
|
316
317
|
var noParsingArrays = qs.parse('a[]=b', { parseArrays: false });
|
|
@@ -512,6 +513,12 @@ The query string may optionally be prepended with a question mark:
|
|
|
512
513
|
assert.equal(qs.stringify({ a: 'b', c: 'd' }, { addQueryPrefix: true }), '?a=b&c=d');
|
|
513
514
|
```
|
|
514
515
|
|
|
516
|
+
Note that when the output is an empty string, the prefix will not be added:
|
|
517
|
+
|
|
518
|
+
```javascript
|
|
519
|
+
assert.equal(qs.stringify({}, { addQueryPrefix: true }), '');
|
|
520
|
+
```
|
|
521
|
+
|
|
515
522
|
The delimiter may be overridden with stringify as well:
|
|
516
523
|
|
|
517
524
|
```javascript
|
|
@@ -723,7 +730,7 @@ Save time, reduce risk, and improve code health, while paying the maintainers of
|
|
|
723
730
|
[downloads-url]: https://npm-stat.com/charts.html?package=qs
|
|
724
731
|
[codecov-image]: https://codecov.io/gh/ljharb/qs/branch/main/graphs/badge.svg
|
|
725
732
|
[codecov-url]: https://app.codecov.io/gh/ljharb/qs/
|
|
726
|
-
[actions-image]: https://img.shields.io/
|
|
733
|
+
[actions-image]: https://img.shields.io/github/check-runs/ljharb/qs/main
|
|
727
734
|
[actions-url]: https://github.com/ljharb/qs/actions
|
|
728
735
|
|
|
729
736
|
## Acknowledgements
|