step-node-agent 3.19.0 → 3.20.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/node_modules/body-parser/HISTORY.md +6 -0
- package/node_modules/body-parser/README.md +1 -1
- package/node_modules/body-parser/index.js +8 -9
- package/node_modules/body-parser/package.json +8 -8
- package/node_modules/capture-stack-trace/license +2 -1
- package/node_modules/capture-stack-trace/package.json +28 -27
- package/node_modules/capture-stack-trace/readme.md +1 -5
- package/node_modules/duplexer3/license +10 -0
- package/node_modules/duplexer3/package.json +25 -26
- package/node_modules/duplexer3/{README.md → readme.md} +25 -41
- package/node_modules/express/History.md +9 -0
- package/node_modules/express/Readme.md +2 -2
- package/node_modules/express/lib/router/route.js +8 -8
- package/node_modules/express/package.json +7 -7
- package/node_modules/get-intrinsic/.eslintrc +2 -8
- package/node_modules/get-intrinsic/.nycrc +0 -4
- package/node_modules/get-intrinsic/CHANGELOG.md +34 -0
- package/node_modules/get-intrinsic/README.md +7 -1
- package/node_modules/get-intrinsic/index.js +4 -0
- package/node_modules/get-intrinsic/package.json +25 -12
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +25 -11
- package/node_modules/glob/common.js +2 -0
- package/node_modules/glob/glob.js +4 -1
- package/node_modules/glob/package.json +5 -2
- package/node_modules/glob/sync.js +6 -3
- package/node_modules/is-callable/.editorconfig +5 -0
- package/node_modules/is-callable/.eslintrc +0 -11
- package/node_modules/is-callable/CHANGELOG.md +50 -0
- package/node_modules/is-callable/README.md +16 -0
- package/node_modules/is-callable/index.js +35 -8
- package/node_modules/is-callable/package.json +27 -13
- package/node_modules/is-callable/test/index.js +86 -12
- package/node_modules/is-core-module/CHANGELOG.md +7 -0
- package/node_modules/is-core-module/core.json +1 -1
- package/node_modules/is-core-module/package.json +1 -1
- package/node_modules/is-core-module/test/index.js +1 -1
- package/node_modules/minimist/.eslintrc +54 -0
- package/node_modules/minimist/.github/FUNDING.yml +12 -0
- package/node_modules/minimist/.nycrc +14 -0
- package/node_modules/minimist/CHANGELOG.md +212 -0
- package/node_modules/minimist/{readme.markdown → README.md} +20 -1
- package/node_modules/minimist/package.json +39 -9
- package/node_modules/object-inspect/CHANGELOG.md +18 -0
- package/node_modules/object-inspect/index.js +7 -6
- package/node_modules/object-inspect/package-support.json +20 -0
- package/node_modules/object-inspect/package.json +20 -10
- package/node_modules/object-inspect/test/err.js +3 -3
- package/node_modules/object-inspect/test/has.js +6 -25
- package/node_modules/object-inspect/test/inspect.js +37 -0
- package/node_modules/object-inspect/test/values.js +3 -3
- package/node_modules/psl/.env +0 -0
- package/node_modules/psl/README.md +1 -5
- package/node_modules/psl/data/rules.json +718 -176
- package/node_modules/psl/dist/psl.js +720 -178
- package/node_modules/psl/dist/psl.min.js +1 -1
- package/node_modules/psl/package.json +16 -17
- package/node_modules/qs/.editorconfig +3 -0
- package/node_modules/qs/.eslintrc +5 -5
- package/node_modules/qs/CHANGELOG.md +158 -0
- package/node_modules/qs/README.md +3 -1
- package/node_modules/qs/dist/qs.js +19 -9
- package/node_modules/qs/lib/stringify.js +12 -3
- package/node_modules/qs/package.json +16 -12
- package/node_modules/qs/test/parse.js +14 -0
- package/node_modules/qs/test/stringify.js +54 -10
- package/node_modules/resolve/lib/async.js +1 -1
- package/node_modules/resolve/lib/core.json +1 -0
- package/node_modules/resolve/lib/sync.js +1 -1
- package/node_modules/resolve/package.json +14 -5
- package/node_modules/resolve/test/core.js +8 -1
- package/node_modules/resolve/test/resolver/false_main/index.js +0 -0
- package/node_modules/resolve/test/resolver/false_main/package.json +4 -0
- package/node_modules/resolve/test/resolver.js +49 -0
- package/node_modules/resolve/test/resolver_sync.js +82 -1
- package/node_modules/underscore/amd/_set.js +21 -0
- package/node_modules/underscore/amd/_setup.js +1 -1
- package/node_modules/underscore/amd/set.js +15 -0
- package/node_modules/underscore/cjs/_set.js +21 -0
- package/node_modules/underscore/cjs/_setup.js +1 -1
- package/node_modules/underscore/cjs/set.js +15 -0
- package/node_modules/underscore/modules/_setup.js +1 -1
- package/node_modules/underscore/modules/index.js +1 -1
- package/node_modules/underscore/modules/package.json +1 -3
- package/node_modules/underscore/package.json +14 -11
- package/node_modules/underscore/underscore-esm-min.js +2 -2
- package/node_modules/underscore/underscore-esm.js +2 -2
- package/node_modules/underscore/underscore-min.js +2 -2
- package/node_modules/underscore/underscore-node-f.cjs +2 -2
- package/node_modules/underscore/underscore-node.cjs +1 -1
- package/node_modules/underscore/underscore-node.mjs +1 -1
- package/node_modules/underscore/underscore-umd-min.js +2 -2
- package/node_modules/underscore/underscore-umd.js +2 -2
- package/node_modules/underscore/underscore.js +2 -2
- package/package.json +1 -1
- package/node_modules/duplexer3/LICENSE.md +0 -26
- package/node_modules/get-intrinsic/.eslintignore +0 -1
- package/node_modules/is-callable/.eslintignore +0 -1
- package/node_modules/is-callable/.istanbul.yml +0 -47
- package/node_modules/minimist/.travis.yml +0 -8
- package/node_modules/object-inspect/.eslintignore +0 -1
- package/node_modules/path-exists/index.js +0 -17
- package/node_modules/path-exists/license +0 -21
- package/node_modules/path-exists/package.json +0 -40
- package/node_modules/path-exists/readme.md +0 -50
- package/node_modules/resolve/appveyor.yml +0 -76
|
@@ -131,6 +131,38 @@ test('stringify()', function (t) {
|
|
|
131
131
|
st.end();
|
|
132
132
|
});
|
|
133
133
|
|
|
134
|
+
t.test('stringifies an array value with one item vs multiple items', function (st) {
|
|
135
|
+
st.test('non-array item', function (s2t) {
|
|
136
|
+
s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=c');
|
|
137
|
+
s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=c');
|
|
138
|
+
s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c');
|
|
139
|
+
s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true }), 'a=c');
|
|
140
|
+
|
|
141
|
+
s2t.end();
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
st.test('array with a single item', function (s2t) {
|
|
145
|
+
s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c');
|
|
146
|
+
s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c');
|
|
147
|
+
s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c');
|
|
148
|
+
s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a[]=c'); // so it parses back as an array
|
|
149
|
+
s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true }), 'a[0]=c');
|
|
150
|
+
|
|
151
|
+
s2t.end();
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
st.test('array with multiple items', function (s2t) {
|
|
155
|
+
s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c&a[1]=d');
|
|
156
|
+
s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c&a[]=d');
|
|
157
|
+
s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c,d');
|
|
158
|
+
s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true }), 'a[0]=c&a[1]=d');
|
|
159
|
+
|
|
160
|
+
s2t.end();
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
st.end();
|
|
164
|
+
});
|
|
165
|
+
|
|
134
166
|
t.test('stringifies a nested array value', function (st) {
|
|
135
167
|
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[b][0]=c&a[b][1]=d');
|
|
136
168
|
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[b][]=c&a[b][]=d');
|
|
@@ -349,11 +381,13 @@ test('stringify()', function (t) {
|
|
|
349
381
|
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' }), 'b[]=&c=c');
|
|
350
382
|
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' }), 'b=&c=c');
|
|
351
383
|
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' }), 'b=&c=c');
|
|
384
|
+
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', commaRoundTrip: true }), 'b[]=&c=c');
|
|
352
385
|
// with strictNullHandling
|
|
353
386
|
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', strictNullHandling: true }), 'b[0]&c=c');
|
|
354
387
|
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', strictNullHandling: true }), 'b[]&c=c');
|
|
355
388
|
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', strictNullHandling: true }), 'b&c=c');
|
|
356
389
|
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true }), 'b&c=c');
|
|
390
|
+
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true, commaRoundTrip: true }), 'b[]&c=c');
|
|
357
391
|
// with skipNulls
|
|
358
392
|
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', skipNulls: true }), 'c=c');
|
|
359
393
|
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', skipNulls: true }), 'c=c');
|
|
@@ -684,6 +718,18 @@ test('stringify()', function (t) {
|
|
|
684
718
|
'a=' + date.getTime(),
|
|
685
719
|
'works with arrayFormat comma'
|
|
686
720
|
);
|
|
721
|
+
st.equal(
|
|
722
|
+
qs.stringify(
|
|
723
|
+
{ a: [date] },
|
|
724
|
+
{
|
|
725
|
+
serializeDate: function (d) { return d.getTime(); },
|
|
726
|
+
arrayFormat: 'comma',
|
|
727
|
+
commaRoundTrip: true
|
|
728
|
+
}
|
|
729
|
+
),
|
|
730
|
+
'a%5B%5D=' + date.getTime(),
|
|
731
|
+
'works with arrayFormat comma'
|
|
732
|
+
);
|
|
687
733
|
|
|
688
734
|
st.end();
|
|
689
735
|
});
|
|
@@ -714,16 +760,14 @@ test('stringify()', function (t) {
|
|
|
714
760
|
});
|
|
715
761
|
|
|
716
762
|
t.test('Edge cases and unknown formats', function (st) {
|
|
717
|
-
['UFO1234', false, 1234, null, {}, []].forEach(
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
}
|
|
726
|
-
);
|
|
763
|
+
['UFO1234', false, 1234, null, {}, []].forEach(function (format) {
|
|
764
|
+
st['throws'](
|
|
765
|
+
function () {
|
|
766
|
+
qs.stringify({ a: 'b c' }, { format: format });
|
|
767
|
+
},
|
|
768
|
+
new TypeError('Unknown format option provided.')
|
|
769
|
+
);
|
|
770
|
+
});
|
|
727
771
|
st.end();
|
|
728
772
|
});
|
|
729
773
|
|
|
@@ -6,7 +6,7 @@ var nodeModulesPaths = require('./node-modules-paths');
|
|
|
6
6
|
var normalizeOptions = require('./normalize-options');
|
|
7
7
|
var isCore = require('is-core-module');
|
|
8
8
|
|
|
9
|
-
var realpathFS = fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath;
|
|
9
|
+
var realpathFS = process.platform !== 'win32' && fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath;
|
|
10
10
|
|
|
11
11
|
var homedir = getHomedir();
|
|
12
12
|
var defaultPaths = function () {
|
|
@@ -112,6 +112,7 @@
|
|
|
112
112
|
"node:string_decoder": [">= 14.18 && < 15", ">= 16"],
|
|
113
113
|
"sys": [">= 0.4 && < 0.7", ">= 0.8"],
|
|
114
114
|
"node:sys": [">= 14.18 && < 15", ">= 16"],
|
|
115
|
+
"node:test": ">= 18",
|
|
115
116
|
"timers": true,
|
|
116
117
|
"node:timers": [">= 14.18 && < 15", ">= 16"],
|
|
117
118
|
"timers/promises": ">= 15",
|
|
@@ -6,7 +6,7 @@ var caller = require('./caller');
|
|
|
6
6
|
var nodeModulesPaths = require('./node-modules-paths');
|
|
7
7
|
var normalizeOptions = require('./normalize-options');
|
|
8
8
|
|
|
9
|
-
var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync;
|
|
9
|
+
var realpathFS = process.platform !== 'win32' && fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync;
|
|
10
10
|
|
|
11
11
|
var homedir = getHomedir();
|
|
12
12
|
var defaultPaths = function () {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resolve",
|
|
3
3
|
"description": "resolve like require.resolve() on behalf of files asynchronously and synchronously",
|
|
4
|
-
"version": "1.22.
|
|
4
|
+
"version": "1.22.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git://github.com/browserify/resolve.git"
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"module"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
|
+
"prepack": "npmignore --auto --commentLines=autogenerated",
|
|
20
21
|
"prepublishOnly": "safe-publish-latest && cp node_modules/is-core-module/core.json ./lib/ ||:",
|
|
21
22
|
"prepublish": "not-in-publish || npm run prepublishOnly",
|
|
22
23
|
"prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')",
|
|
@@ -29,20 +30,22 @@
|
|
|
29
30
|
"test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
|
-
"@ljharb/eslint-config": "^
|
|
33
|
+
"@ljharb/eslint-config": "^21.0.0",
|
|
33
34
|
"array.prototype.map": "^1.0.4",
|
|
34
35
|
"aud": "^2.0.0",
|
|
35
36
|
"copy-dir": "^1.3.0",
|
|
36
37
|
"eclint": "^2.8.1",
|
|
37
|
-
"eslint": "
|
|
38
|
+
"eslint": "=8.8.0",
|
|
38
39
|
"in-publish": "^2.0.1",
|
|
39
40
|
"mkdirp": "^0.5.5",
|
|
40
41
|
"mv": "^2.1.1",
|
|
42
|
+
"npmignore": "^0.3.0",
|
|
41
43
|
"object-keys": "^1.1.1",
|
|
42
44
|
"rimraf": "^2.7.1",
|
|
43
45
|
"safe-publish-latest": "^2.0.0",
|
|
46
|
+
"semver": "^6.3.0",
|
|
44
47
|
"tap": "0.4.13",
|
|
45
|
-
"tape": "^5.
|
|
48
|
+
"tape": "^5.5.3",
|
|
46
49
|
"tmp": "^0.0.31"
|
|
47
50
|
},
|
|
48
51
|
"license": "MIT",
|
|
@@ -55,8 +58,14 @@
|
|
|
55
58
|
"url": "https://github.com/sponsors/ljharb"
|
|
56
59
|
},
|
|
57
60
|
"dependencies": {
|
|
58
|
-
"is-core-module": "^2.
|
|
61
|
+
"is-core-module": "^2.9.0",
|
|
59
62
|
"path-parse": "^1.0.7",
|
|
60
63
|
"supports-preserve-symlinks-flag": "^1.0.0"
|
|
64
|
+
},
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"ignore": [
|
|
67
|
+
".github/workflows",
|
|
68
|
+
"appveyor.yml"
|
|
69
|
+
]
|
|
61
70
|
}
|
|
62
71
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
var test = require('tape');
|
|
2
2
|
var keys = require('object-keys');
|
|
3
|
+
var semver = require('semver');
|
|
4
|
+
|
|
3
5
|
var resolve = require('../');
|
|
4
6
|
|
|
7
|
+
var brokenNode = semver.satisfies(process.version, '11.11 - 11.13');
|
|
8
|
+
|
|
5
9
|
test('core modules', function (t) {
|
|
6
10
|
t.test('isCore()', function (st) {
|
|
7
11
|
st.ok(resolve.isCore('fs'));
|
|
@@ -22,10 +26,13 @@ test('core modules', function (t) {
|
|
|
22
26
|
|
|
23
27
|
for (var i = 0; i < cores.length; ++i) {
|
|
24
28
|
var mod = cores[i];
|
|
29
|
+
// note: this must be require, not require.resolve, due to https://github.com/nodejs/node/issues/43274
|
|
25
30
|
var requireFunc = function () { require(mod); }; // eslint-disable-line no-loop-func
|
|
26
|
-
|
|
31
|
+
t.comment(mod + ': ' + resolve.core[mod]);
|
|
27
32
|
if (resolve.core[mod]) {
|
|
28
33
|
st.doesNotThrow(requireFunc, mod + ' supported; requiring does not throw');
|
|
34
|
+
} else if (brokenNode) {
|
|
35
|
+
st.ok(true, 'this version of node is broken: attempting to require things that fail to resolve breaks "home_paths" tests');
|
|
29
36
|
} else {
|
|
30
37
|
st.throws(requireFunc, mod + ' not supported; requiring throws');
|
|
31
38
|
}
|
|
File without changes
|
|
@@ -290,6 +290,55 @@ test('incorrect main', function (t) {
|
|
|
290
290
|
});
|
|
291
291
|
});
|
|
292
292
|
|
|
293
|
+
test('missing index', function (t) {
|
|
294
|
+
t.plan(2);
|
|
295
|
+
|
|
296
|
+
var resolverDir = path.join(__dirname, 'resolver');
|
|
297
|
+
resolve('./missing_index', { basedir: resolverDir }, function (err, res, pkg) {
|
|
298
|
+
t.ok(err instanceof Error);
|
|
299
|
+
t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code');
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
test('missing main', function (t) {
|
|
304
|
+
t.plan(1);
|
|
305
|
+
|
|
306
|
+
var resolverDir = path.join(__dirname, 'resolver');
|
|
307
|
+
|
|
308
|
+
resolve('./missing_main', { basedir: resolverDir }, function (err, res, pkg) {
|
|
309
|
+
t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code');
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
test('null main', function (t) {
|
|
314
|
+
t.plan(1);
|
|
315
|
+
|
|
316
|
+
var resolverDir = path.join(__dirname, 'resolver');
|
|
317
|
+
|
|
318
|
+
resolve('./null_main', { basedir: resolverDir }, function (err, res, pkg) {
|
|
319
|
+
t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code');
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
test('main: false', function (t) {
|
|
324
|
+
t.plan(2);
|
|
325
|
+
|
|
326
|
+
var basedir = path.join(__dirname, 'resolver');
|
|
327
|
+
var dir = path.join(basedir, 'false_main');
|
|
328
|
+
resolve('./false_main', { basedir: basedir }, function (err, res, pkg) {
|
|
329
|
+
if (err) t.fail(err);
|
|
330
|
+
t.equal(
|
|
331
|
+
res,
|
|
332
|
+
path.join(dir, 'index.js'),
|
|
333
|
+
'`"main": false`: resolves to `index.js`'
|
|
334
|
+
);
|
|
335
|
+
t.deepEqual(pkg, {
|
|
336
|
+
name: 'false_main',
|
|
337
|
+
main: false
|
|
338
|
+
});
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
|
|
293
342
|
test('without basedir', function (t) {
|
|
294
343
|
t.plan(1);
|
|
295
344
|
|
|
@@ -6,7 +6,7 @@ var resolve = require('../');
|
|
|
6
6
|
var sync = require('../sync');
|
|
7
7
|
|
|
8
8
|
var requireResolveSupportsPaths = require.resolve.length > 1
|
|
9
|
-
&& (/^
|
|
9
|
+
&& !(/^v12\.[012]\./).test(process.version); // broken in v12.0-12.2, see https://github.com/nodejs/node/issues/27794
|
|
10
10
|
|
|
11
11
|
test('`./sync` entry point', function (t) {
|
|
12
12
|
t.equal(resolve.sync, sync, '`./sync` entry point is the same as `.sync` on `main`');
|
|
@@ -309,6 +309,87 @@ test('incorrect main', function (t) {
|
|
|
309
309
|
t.end();
|
|
310
310
|
});
|
|
311
311
|
|
|
312
|
+
test('missing index', function (t) {
|
|
313
|
+
t.plan(requireResolveSupportsPaths ? 2 : 1);
|
|
314
|
+
|
|
315
|
+
var resolverDir = path.join(__dirname, 'resolver');
|
|
316
|
+
try {
|
|
317
|
+
resolve.sync('./missing_index', { basedir: resolverDir });
|
|
318
|
+
t.fail('did not fail');
|
|
319
|
+
} catch (err) {
|
|
320
|
+
t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code');
|
|
321
|
+
}
|
|
322
|
+
if (requireResolveSupportsPaths) {
|
|
323
|
+
try {
|
|
324
|
+
require.resolve('./missing_index', { basedir: resolverDir });
|
|
325
|
+
t.fail('require.resolve did not fail');
|
|
326
|
+
} catch (err) {
|
|
327
|
+
t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code');
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
test('missing main', function (t) {
|
|
333
|
+
var resolverDir = path.join(__dirname, 'resolver');
|
|
334
|
+
|
|
335
|
+
try {
|
|
336
|
+
resolve.sync('./missing_main', { basedir: resolverDir });
|
|
337
|
+
t.fail('require.resolve did not fail');
|
|
338
|
+
} catch (err) {
|
|
339
|
+
t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code');
|
|
340
|
+
}
|
|
341
|
+
if (requireResolveSupportsPaths) {
|
|
342
|
+
try {
|
|
343
|
+
resolve.sync('./missing_main', { basedir: resolverDir });
|
|
344
|
+
t.fail('require.resolve did not fail');
|
|
345
|
+
} catch (err) {
|
|
346
|
+
t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code');
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
t.end();
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
test('null main', function (t) {
|
|
354
|
+
var resolverDir = path.join(__dirname, 'resolver');
|
|
355
|
+
|
|
356
|
+
try {
|
|
357
|
+
resolve.sync('./null_main', { basedir: resolverDir });
|
|
358
|
+
t.fail('require.resolve did not fail');
|
|
359
|
+
} catch (err) {
|
|
360
|
+
t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code');
|
|
361
|
+
}
|
|
362
|
+
if (requireResolveSupportsPaths) {
|
|
363
|
+
try {
|
|
364
|
+
resolve.sync('./null_main', { basedir: resolverDir });
|
|
365
|
+
t.fail('require.resolve did not fail');
|
|
366
|
+
} catch (err) {
|
|
367
|
+
t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error has correct error code');
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
t.end();
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
test('main: false', function (t) {
|
|
375
|
+
var basedir = path.join(__dirname, 'resolver');
|
|
376
|
+
var dir = path.join(basedir, 'false_main');
|
|
377
|
+
t.equal(
|
|
378
|
+
resolve.sync('./false_main', { basedir: basedir }),
|
|
379
|
+
path.join(dir, 'index.js'),
|
|
380
|
+
'`"main": false`: resolves to `index.js`'
|
|
381
|
+
);
|
|
382
|
+
if (requireResolveSupportsPaths) {
|
|
383
|
+
t.equal(
|
|
384
|
+
resolve.sync('./false_main', { basedir: basedir }),
|
|
385
|
+
require.resolve('./false_main', { paths: [basedir] }),
|
|
386
|
+
'`"main": false`: resolve.sync === require.resolve'
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
t.end();
|
|
391
|
+
});
|
|
392
|
+
|
|
312
393
|
var stubStatSync = function stubStatSync(fn) {
|
|
313
394
|
var statSync = fs.statSync;
|
|
314
395
|
try {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
define(['./isNumber', './isArray', './isObject'], function (isNumber, isArray, isObject) {
|
|
2
|
+
|
|
3
|
+
function set (obj, path, value) {
|
|
4
|
+
var key = String(path[0]);
|
|
5
|
+
|
|
6
|
+
if (path.length === 1) {
|
|
7
|
+
obj[key] = value;
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (!isArray(obj[key]) || !isObject(obj[key])) {
|
|
12
|
+
var nextKey = path[1];
|
|
13
|
+
obj[key] = isNumber(nextKey) ? [] : {};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return set(obj[key], path.slice(1), value);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return set;
|
|
20
|
+
|
|
21
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
define(['./isArray', './isObject', './_set'], function (isArray, isObject, _set) {
|
|
2
|
+
|
|
3
|
+
// set the value in given path
|
|
4
|
+
function set (obj, path, value) {
|
|
5
|
+
if (!isObject(obj) || !isArray(path)) return obj;
|
|
6
|
+
if (path.length === 0) return obj;
|
|
7
|
+
|
|
8
|
+
_set(obj, path, value);
|
|
9
|
+
|
|
10
|
+
return obj;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return set;
|
|
14
|
+
|
|
15
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var isNumber = require('./isNumber.js');
|
|
2
|
+
var isArray = require('./isArray.js');
|
|
3
|
+
var isObject = require('./isObject.js');
|
|
4
|
+
|
|
5
|
+
function set (obj, path, value) {
|
|
6
|
+
var key = String(path[0]);
|
|
7
|
+
|
|
8
|
+
if (path.length === 1) {
|
|
9
|
+
obj[key] = value;
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (!isArray(obj[key]) || !isObject(obj[key])) {
|
|
14
|
+
var nextKey = path[1];
|
|
15
|
+
obj[key] = isNumber(nextKey) ? [] : {};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return set(obj[key], path.slice(1), value);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
module.exports = set;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
|
|
3
3
|
// Current version.
|
|
4
|
-
var VERSION = '1.13.
|
|
4
|
+
var VERSION = '1.13.6';
|
|
5
5
|
|
|
6
6
|
// Establish the root object, `window` (`self`) in the browser, `global`
|
|
7
7
|
// on the server, or `this` in some virtual machines. We use `self`
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var isArray = require('./isArray.js');
|
|
2
|
+
var isObject = require('./isObject.js');
|
|
3
|
+
var _set = require('./_set.js');
|
|
4
|
+
|
|
5
|
+
// set the value in given path
|
|
6
|
+
function set (obj, path, value) {
|
|
7
|
+
if (!isObject(obj) || !isArray(path)) return obj;
|
|
8
|
+
if (path.length === 0) return obj;
|
|
9
|
+
|
|
10
|
+
_set(obj, path, value);
|
|
11
|
+
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
module.exports = set;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Named Exports
|
|
2
2
|
// =============
|
|
3
3
|
|
|
4
|
-
// Underscore.js 1.13.
|
|
4
|
+
// Underscore.js 1.13.6
|
|
5
5
|
// https://underscorejs.org
|
|
6
6
|
// (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors
|
|
7
7
|
// Underscore may be freely distributed under the MIT license.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "underscore",
|
|
3
3
|
"description": "JavaScript's functional programming helper library.",
|
|
4
|
-
"version": "1.13.
|
|
4
|
+
"version": "1.13.6",
|
|
5
5
|
"author": "Jeremy Ashkenas <jeremy@documentcloud.org>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://underscorejs.org",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"default": "./underscore-esm.js"
|
|
32
32
|
},
|
|
33
33
|
"require": {
|
|
34
|
+
"module": "./modules/index-all.js",
|
|
34
35
|
"browser": {
|
|
35
36
|
"production": "./underscore-umd-min.js",
|
|
36
37
|
"default": "./underscore-umd.js"
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
"./package.json": "./package.json"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
|
-
"coveralls": "^
|
|
54
|
+
"coveralls": "^3.1.1",
|
|
54
55
|
"cpy-cli": "^3.1.1",
|
|
55
56
|
"docco": "^0.8.0",
|
|
56
57
|
"eslint": "^6.8.0",
|
|
@@ -58,10 +59,11 @@
|
|
|
58
59
|
"glob": "^7.1.6",
|
|
59
60
|
"gzip-size-cli": "^1.0.0",
|
|
60
61
|
"husky": "^4.2.3",
|
|
61
|
-
"karma": "^
|
|
62
|
-
"karma-qunit": "
|
|
63
|
-
"karma-sauce-launcher": "^
|
|
64
|
-
"nyc": "^
|
|
62
|
+
"karma": "^4.4.1",
|
|
63
|
+
"karma-qunit": "^4.1.2",
|
|
64
|
+
"karma-sauce-launcher": "^4.3.6",
|
|
65
|
+
"nyc": "^15.1.0",
|
|
66
|
+
"patch-package": "^6.4.7",
|
|
65
67
|
"pretty-bytes-cli": "^1.0.0",
|
|
66
68
|
"qunit": "2.10.1",
|
|
67
69
|
"rollup": "^2.40.0",
|
|
@@ -71,19 +73,20 @@
|
|
|
71
73
|
"colors@>1.4.0": "1.4.0"
|
|
72
74
|
},
|
|
73
75
|
"scripts": {
|
|
74
|
-
"test": "npm run lint && npm run test-node",
|
|
75
|
-
"coverage": "nyc npm run test-node && nyc report",
|
|
76
|
+
"test": "npm run lint && npm run prepare-tests && npm run test-node",
|
|
77
|
+
"coverage": "npm run prepare-tests && nyc npm run test-node && nyc report",
|
|
76
78
|
"coveralls": "nyc npm run test-node && nyc report --reporter=text-lcov | coveralls",
|
|
77
79
|
"lint": "eslint modules/*.js test/*.js",
|
|
78
|
-
"test-node": "
|
|
79
|
-
"test-browser": "npm
|
|
80
|
+
"test-node": "qunit test/",
|
|
81
|
+
"test-browser": "npm i karma-phantomjs-launcher && karma start",
|
|
80
82
|
"bundle": "rollup -c && eslint underscore-umd.js && rollup -c rollup.config2.js",
|
|
81
83
|
"bundle-treeshake": "cd test-treeshake && rollup --config",
|
|
82
84
|
"prepare-tests": "npm run bundle && npm run bundle-treeshake",
|
|
83
85
|
"minify-umd": "terser underscore-umd.js -c \"evaluate=false\" --comments \"/ .*/\" -m",
|
|
84
86
|
"minify-esm": "terser underscore-esm.js -c \"evaluate=false\" --comments \"/ .*/\" -m",
|
|
87
|
+
"module-package-json": "node -e 'console.log(`{\"type\":\"module\",\"version\":\"${process.env.npm_package_version}\"}`)' > modules/package.json",
|
|
85
88
|
"build-umd": "npm run minify-umd -- --source-map content=underscore-umd.js.map --source-map-url \" \" -o underscore-umd-min.js",
|
|
86
|
-
"build-esm": "npm run minify-esm -- --source-map content=underscore-esm.js.map --source-map-url \" \" -o underscore-esm-min.js",
|
|
89
|
+
"build-esm": "npm run module-package-json && npm run minify-esm -- --source-map content=underscore-esm.js.map --source-map-url \" \" -o underscore-esm-min.js",
|
|
87
90
|
"alias-bundle": "cpy --rename=underscore.js underscore-umd.js . && cpy --rename=underscore-min.js underscore-umd-min.js . && cpy --rename=underscore-min.js.map underscore-umd-min.js.map .",
|
|
88
91
|
"build": "npm run bundle && npm run build-umd && npm run build-esm && npm run alias-bundle",
|
|
89
92
|
"doc": "docco underscore-esm.js && docco modules/*.js -c docco.css -t docs/linked-esm.jst",
|