fsevents 1.0.17 → 1.0.18-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.
Potentially problematic release.
This version of fsevents might be problematic. Click here for more details.
- package/fsevents.js +3 -0
- package/install.js +7 -0
- package/node_modules/abbrev/abbrev.js +0 -1
- package/node_modules/abbrev/package.json +16 -13
- package/node_modules/ansi-regex/index.js +1 -1
- package/node_modules/ansi-regex/package.json +32 -21
- package/node_modules/ansi-regex/readme.md +10 -2
- package/node_modules/aproba/README.md +33 -3
- package/node_modules/aproba/index.js +71 -30
- package/node_modules/aproba/package.json +14 -14
- package/node_modules/aws4/aws4.js +15 -6
- package/node_modules/aws4/package.json +10 -10
- package/node_modules/bcrypt-pbkdf/index.js +1 -4
- package/node_modules/bcrypt-pbkdf/package.json +24 -12
- package/node_modules/gauge/CHANGELOG.md +10 -0
- package/node_modules/gauge/index.js +9 -6
- package/node_modules/gauge/package.json +11 -12
- package/node_modules/jsbn/index.js +8 -9
- package/node_modules/jsbn/package.json +15 -11
- package/node_modules/mime-db/HISTORY.md +16 -0
- package/node_modules/mime-db/db.json +41 -2
- package/node_modules/mime-db/package.json +23 -22
- package/node_modules/mime-types/HISTORY.md +6 -0
- package/node_modules/mime-types/package.json +14 -13
- package/node_modules/node-pre-gyp/CHANGELOG.md +4 -0
- package/node_modules/node-pre-gyp/lib/node-pre-gyp.js +1 -1
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +52 -0
- package/node_modules/node-pre-gyp/package.json +15 -19
- package/node_modules/object-assign/index.js +11 -4
- package/node_modules/object-assign/package.json +22 -18
- package/node_modules/object-assign/readme.md +8 -3
- package/node_modules/qs/.eslintrc +3 -3
- package/node_modules/qs/CHANGELOG.md +12 -0
- package/node_modules/qs/README.md +34 -1
- package/node_modules/qs/dist/qs.js +32 -19
- package/node_modules/qs/lib/parse.js +9 -9
- package/node_modules/qs/lib/stringify.js +22 -9
- package/node_modules/qs/lib/utils.js +1 -1
- package/node_modules/qs/package.json +17 -17
- package/node_modules/qs/test/.eslintrc +1 -0
- package/node_modules/qs/test/parse.js +29 -4
- package/node_modules/qs/test/stringify.js +1 -1
- package/node_modules/rc/package.json +14 -10
- package/node_modules/sshpk/lib/identity.js +23 -1
- package/node_modules/sshpk/package.json +10 -10
- package/node_modules/strip-json-comments/index.js +70 -0
- package/node_modules/strip-json-comments/package.json +28 -30
- package/node_modules/strip-json-comments/readme.md +12 -28
- package/node_modules/supports-color/index.js +20 -2
- package/node_modules/supports-color/package.json +32 -31
- package/node_modules/supports-color/readme.md +6 -14
- package/package.json +2 -5
- package/node_modules/chalk/node_modules/supports-color/index.js +0 -50
- package/node_modules/chalk/node_modules/supports-color/package.json +0 -113
- package/node_modules/chalk/node_modules/supports-color/readme.md +0 -36
- package/node_modules/qs/CONTRIBUTING.md +0 -1
- package/node_modules/strip-json-comments/cli.js +0 -41
- package/node_modules/strip-json-comments/strip-json-comments.js +0 -73
- package/node_modules/supports-color/cli.js +0 -28
- /package/node_modules/{chalk/node_modules/supports-color → supports-color}/license +0 -0
@@ -943,6 +943,10 @@
|
|
943
943
|
"node_abi": 14,
|
944
944
|
"v8": "3.28"
|
945
945
|
},
|
946
|
+
"0.12.18": {
|
947
|
+
"node_abi": 14,
|
948
|
+
"v8": "3.28"
|
949
|
+
},
|
946
950
|
"1.0.0": {
|
947
951
|
"node_abi": 42,
|
948
952
|
"v8": "3.31"
|
@@ -1211,6 +1215,22 @@
|
|
1211
1215
|
"node_abi": 46,
|
1212
1216
|
"v8": "4.5"
|
1213
1217
|
},
|
1218
|
+
"4.7.0": {
|
1219
|
+
"node_abi": 46,
|
1220
|
+
"v8": "4.5"
|
1221
|
+
},
|
1222
|
+
"4.7.1": {
|
1223
|
+
"node_abi": 46,
|
1224
|
+
"v8": "4.5"
|
1225
|
+
},
|
1226
|
+
"4.7.2": {
|
1227
|
+
"node_abi": 46,
|
1228
|
+
"v8": "4.5"
|
1229
|
+
},
|
1230
|
+
"4.7.3": {
|
1231
|
+
"node_abi": 46,
|
1232
|
+
"v8": "4.5"
|
1233
|
+
},
|
1214
1234
|
"5.0.0": {
|
1215
1235
|
"node_abi": 47,
|
1216
1236
|
"v8": "4.6"
|
@@ -1347,6 +1367,22 @@
|
|
1347
1367
|
"node_abi": 48,
|
1348
1368
|
"v8": "5.1"
|
1349
1369
|
},
|
1370
|
+
"6.9.2": {
|
1371
|
+
"node_abi": 48,
|
1372
|
+
"v8": "5.1"
|
1373
|
+
},
|
1374
|
+
"6.9.3": {
|
1375
|
+
"node_abi": 48,
|
1376
|
+
"v8": "5.1"
|
1377
|
+
},
|
1378
|
+
"6.9.4": {
|
1379
|
+
"node_abi": 48,
|
1380
|
+
"v8": "5.1"
|
1381
|
+
},
|
1382
|
+
"6.9.5": {
|
1383
|
+
"node_abi": 48,
|
1384
|
+
"v8": "5.1"
|
1385
|
+
},
|
1350
1386
|
"7.0.0": {
|
1351
1387
|
"node_abi": 51,
|
1352
1388
|
"v8": "5.4"
|
@@ -1358,5 +1394,21 @@
|
|
1358
1394
|
"7.2.0": {
|
1359
1395
|
"node_abi": 51,
|
1360
1396
|
"v8": "5.4"
|
1397
|
+
},
|
1398
|
+
"7.2.1": {
|
1399
|
+
"node_abi": 51,
|
1400
|
+
"v8": "5.4"
|
1401
|
+
},
|
1402
|
+
"7.3.0": {
|
1403
|
+
"node_abi": 51,
|
1404
|
+
"v8": "5.4"
|
1405
|
+
},
|
1406
|
+
"7.4.0": {
|
1407
|
+
"node_abi": 51,
|
1408
|
+
"v8": "5.4"
|
1409
|
+
},
|
1410
|
+
"7.5.0": {
|
1411
|
+
"node_abi": 51,
|
1412
|
+
"v8": "5.4"
|
1361
1413
|
}
|
1362
1414
|
}
|
@@ -14,13 +14,13 @@
|
|
14
14
|
]
|
15
15
|
],
|
16
16
|
"_from": "node-pre-gyp@>=0.6.29 <0.7.0",
|
17
|
-
"_id": "node-pre-gyp@0.6.
|
17
|
+
"_id": "node-pre-gyp@0.6.33",
|
18
18
|
"_inCache": true,
|
19
19
|
"_location": "/node-pre-gyp",
|
20
|
-
"_nodeVersion": "4.
|
20
|
+
"_nodeVersion": "4.7.2",
|
21
21
|
"_npmOperationalInternal": {
|
22
|
-
"host": "packages-
|
23
|
-
"tmp": "tmp/node-pre-gyp-0.6.
|
22
|
+
"host": "packages-12-west.internal.npmjs.com",
|
23
|
+
"tmp": "tmp/node-pre-gyp-0.6.33.tgz_1486012902452_0.33904882124625146"
|
24
24
|
},
|
25
25
|
"_npmUser": {
|
26
26
|
"name": "springmeyer",
|
@@ -40,8 +40,8 @@
|
|
40
40
|
"_requiredBy": [
|
41
41
|
"/"
|
42
42
|
],
|
43
|
-
"_resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.
|
44
|
-
"_shasum": "
|
43
|
+
"_resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.33.tgz",
|
44
|
+
"_shasum": "640ac55198f6a925972e0c16c4ac26a034d5ecc9",
|
45
45
|
"_shrinkwrap": null,
|
46
46
|
"_spec": "node-pre-gyp@^0.6.29",
|
47
47
|
"_where": "/Users/eshanker/Code/fsevents",
|
@@ -75,10 +75,10 @@
|
|
75
75
|
},
|
76
76
|
"directories": {},
|
77
77
|
"dist": {
|
78
|
-
"shasum": "
|
79
|
-
"tarball": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.
|
78
|
+
"shasum": "640ac55198f6a925972e0c16c4ac26a034d5ecc9",
|
79
|
+
"tarball": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.33.tgz"
|
80
80
|
},
|
81
|
-
"gitHead": "
|
81
|
+
"gitHead": "a597beb973e690e82452946c380fd8e94f40d3f5",
|
82
82
|
"homepage": "https://github.com/mapbox/node-pre-gyp#readme",
|
83
83
|
"jshintConfig": {
|
84
84
|
"node": true,
|
@@ -100,25 +100,21 @@
|
|
100
100
|
"license": "BSD-3-Clause",
|
101
101
|
"main": "./lib/node-pre-gyp.js",
|
102
102
|
"maintainers": [
|
103
|
-
{
|
104
|
-
"name": "springmeyer",
|
105
|
-
"email": "dane@dbsgeo.com"
|
106
|
-
},
|
107
103
|
{
|
108
104
|
"name": "bergwerkgis",
|
109
105
|
"email": "wb@bergwerk-gis.at"
|
110
106
|
},
|
111
107
|
{
|
112
|
-
"name": "
|
113
|
-
"email": "
|
108
|
+
"name": "kkaefer",
|
109
|
+
"email": "mail@kkaefer.com"
|
114
110
|
},
|
115
111
|
{
|
116
|
-
"name": "
|
117
|
-
"email": "
|
112
|
+
"name": "springmeyer",
|
113
|
+
"email": "dane@mapbox.com"
|
118
114
|
},
|
119
115
|
{
|
120
116
|
"name": "yhahn",
|
121
|
-
"email": "young@
|
117
|
+
"email": "young@mapbox.com"
|
122
118
|
}
|
123
119
|
],
|
124
120
|
"name": "node-pre-gyp",
|
@@ -133,5 +129,5 @@
|
|
133
129
|
"test": "jshint lib lib/util scripts bin/node-pre-gyp && mocha -R spec --timeout 500000",
|
134
130
|
"update-crosswalk": "node scripts/abi_crosswalk.js"
|
135
131
|
},
|
136
|
-
"version": "0.6.
|
132
|
+
"version": "0.6.33"
|
137
133
|
}
|
@@ -1,5 +1,12 @@
|
|
1
|
+
/*
|
2
|
+
object-assign
|
3
|
+
(c) Sindre Sorhus
|
4
|
+
@license MIT
|
5
|
+
*/
|
6
|
+
|
1
7
|
'use strict';
|
2
8
|
/* eslint-disable no-unused-vars */
|
9
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
3
10
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
4
11
|
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
5
12
|
|
@@ -20,7 +27,7 @@ function shouldUseNative() {
|
|
20
27
|
// Detect buggy property enumeration order in older V8 versions.
|
21
28
|
|
22
29
|
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
23
|
-
var test1 = new String('abc'); // eslint-disable-line
|
30
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
24
31
|
test1[5] = 'de';
|
25
32
|
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
26
33
|
return false;
|
@@ -49,7 +56,7 @@ function shouldUseNative() {
|
|
49
56
|
}
|
50
57
|
|
51
58
|
return true;
|
52
|
-
} catch (
|
59
|
+
} catch (err) {
|
53
60
|
// We don't expect any of the above to throw, but better to be safe.
|
54
61
|
return false;
|
55
62
|
}
|
@@ -69,8 +76,8 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
|
69
76
|
}
|
70
77
|
}
|
71
78
|
|
72
|
-
if (
|
73
|
-
symbols =
|
79
|
+
if (getOwnPropertySymbols) {
|
80
|
+
symbols = getOwnPropertySymbols(from);
|
74
81
|
for (var i = 0; i < symbols.length; i++) {
|
75
82
|
if (propIsEnumerable.call(from, symbols[i])) {
|
76
83
|
to[symbols[i]] = from[symbols[i]];
|
@@ -14,19 +14,19 @@
|
|
14
14
|
]
|
15
15
|
],
|
16
16
|
"_from": "object-assign@>=4.1.0 <5.0.0",
|
17
|
-
"_id": "object-assign@4.1.
|
17
|
+
"_id": "object-assign@4.1.1",
|
18
18
|
"_inCache": true,
|
19
19
|
"_location": "/object-assign",
|
20
|
-
"_nodeVersion": "4.
|
20
|
+
"_nodeVersion": "4.6.2",
|
21
21
|
"_npmOperationalInternal": {
|
22
|
-
"host": "packages-
|
23
|
-
"tmp": "tmp/object-assign-4.1.
|
22
|
+
"host": "packages-12-west.internal.npmjs.com",
|
23
|
+
"tmp": "tmp/object-assign-4.1.1.tgz_1484580915042_0.07107710791751742"
|
24
24
|
},
|
25
25
|
"_npmUser": {
|
26
|
-
"name": "
|
27
|
-
"email": "
|
26
|
+
"name": "sindresorhus",
|
27
|
+
"email": "sindresorhus@gmail.com"
|
28
28
|
},
|
29
|
-
"_npmVersion": "2.
|
29
|
+
"_npmVersion": "2.15.11",
|
30
30
|
"_phantomChildren": {},
|
31
31
|
"_requested": {
|
32
32
|
"raw": "object-assign@^4.1.0",
|
@@ -40,8 +40,8 @@
|
|
40
40
|
"_requiredBy": [
|
41
41
|
"/gauge"
|
42
42
|
],
|
43
|
-
"_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.
|
44
|
-
"_shasum": "
|
43
|
+
"_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
44
|
+
"_shasum": "2109adc7965887cfc05cbbd442cac8bfbb360863",
|
45
45
|
"_shrinkwrap": null,
|
46
46
|
"_spec": "object-assign@^4.1.0",
|
47
47
|
"_where": "/Users/eshanker/Code/fsevents/node_modules/gauge",
|
@@ -54,17 +54,17 @@
|
|
54
54
|
"url": "https://github.com/sindresorhus/object-assign/issues"
|
55
55
|
},
|
56
56
|
"dependencies": {},
|
57
|
-
"description": "ES2015 Object.assign() ponyfill",
|
57
|
+
"description": "ES2015 `Object.assign()` ponyfill",
|
58
58
|
"devDependencies": {
|
59
|
-
"
|
59
|
+
"ava": "^0.16.0",
|
60
|
+
"lodash": "^4.16.4",
|
60
61
|
"matcha": "^0.7.0",
|
61
|
-
"
|
62
|
-
"xo": "*"
|
62
|
+
"xo": "^0.16.0"
|
63
63
|
},
|
64
64
|
"directories": {},
|
65
65
|
"dist": {
|
66
|
-
"shasum": "
|
67
|
-
"tarball": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.
|
66
|
+
"shasum": "2109adc7965887cfc05cbbd442cac8bfbb360863",
|
67
|
+
"tarball": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz"
|
68
68
|
},
|
69
69
|
"engines": {
|
70
70
|
"node": ">=0.10.0"
|
@@ -72,7 +72,7 @@
|
|
72
72
|
"files": [
|
73
73
|
"index.js"
|
74
74
|
],
|
75
|
-
"gitHead": "
|
75
|
+
"gitHead": "a89774b252c91612203876984bbd6addbe3b5a0e",
|
76
76
|
"homepage": "https://github.com/sindresorhus/object-assign#readme",
|
77
77
|
"keywords": [
|
78
78
|
"object",
|
@@ -90,6 +90,10 @@
|
|
90
90
|
],
|
91
91
|
"license": "MIT",
|
92
92
|
"maintainers": [
|
93
|
+
{
|
94
|
+
"name": "gaearon",
|
95
|
+
"email": "dan.abramov@gmail.com"
|
96
|
+
},
|
93
97
|
{
|
94
98
|
"name": "sindresorhus",
|
95
99
|
"email": "sindresorhus@gmail.com"
|
@@ -108,7 +112,7 @@
|
|
108
112
|
},
|
109
113
|
"scripts": {
|
110
114
|
"bench": "matcha bench.js",
|
111
|
-
"test": "xo &&
|
115
|
+
"test": "xo && ava"
|
112
116
|
},
|
113
|
-
"version": "4.1.
|
117
|
+
"version": "4.1.1"
|
114
118
|
}
|
@@ -1,8 +1,13 @@
|
|
1
1
|
# object-assign [](https://travis-ci.org/sindresorhus/object-assign)
|
2
2
|
|
3
|
-
> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) ponyfill
|
3
|
+
> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com)
|
4
4
|
|
5
|
-
|
5
|
+
|
6
|
+
## Use the built-in
|
7
|
+
|
8
|
+
Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari),
|
9
|
+
support `Object.assign()` :tada:. If you target only those environments, then by all
|
10
|
+
means, use `Object.assign()` instead of this package.
|
6
11
|
|
7
12
|
|
8
13
|
## Install
|
@@ -36,7 +41,7 @@ objectAssign({foo: 0}, null, {bar: 1}, undefined);
|
|
36
41
|
|
37
42
|
## API
|
38
43
|
|
39
|
-
### objectAssign(target,
|
44
|
+
### objectAssign(target, [source, ...])
|
40
45
|
|
41
46
|
Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones.
|
42
47
|
|
@@ -5,13 +5,13 @@
|
|
5
5
|
|
6
6
|
"rules": {
|
7
7
|
"complexity": [2, 25],
|
8
|
-
"consistent-return":
|
8
|
+
"consistent-return": 1,
|
9
9
|
"id-length": [2, { "min": 1, "max": 25, "properties": "never" }],
|
10
10
|
"indent": [2, 4],
|
11
11
|
"max-params": [2, 11],
|
12
12
|
"max-statements": [2, 42],
|
13
|
-
"no-extra-parens":
|
14
|
-
"no-continue":
|
13
|
+
"no-extra-parens": 1,
|
14
|
+
"no-continue": 1,
|
15
15
|
"no-magic-numbers": 0,
|
16
16
|
"no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],
|
17
17
|
"operator-linebreak": 1
|
@@ -1,3 +1,15 @@
|
|
1
|
+
## **6.3.1**
|
2
|
+
- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties (thanks, @snyk!)
|
3
|
+
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `iconv-lite`, `qs-iconv`, `tape`
|
4
|
+
- [Tests] on all node minors; improve test matrix
|
5
|
+
- [Docs] document stringify option `allowDots` (#195)
|
6
|
+
- [Docs] add empty object and array values example (#195)
|
7
|
+
- [Docs] Fix minor inconsistency/typo (#192)
|
8
|
+
- [Docs] document stringify option `sort` (#191)
|
9
|
+
- [Refactor] `stringify`: throw faster with an invalid encoder
|
10
|
+
- [Refactor] remove unnecessary escapes (#184)
|
11
|
+
- Remove contributing.md, since `qs` is no longer part of `hapi` (#183)
|
12
|
+
|
1
13
|
## **6.3.0**
|
2
14
|
- [New] Add support for RFC 1738 (#174, #173)
|
3
15
|
- [New] `stringify`: Add `serializeDate` option to customize Date serialization (#159)
|
@@ -261,7 +261,7 @@ qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });
|
|
261
261
|
// 'a=b&a=c&a=d'
|
262
262
|
```
|
263
263
|
|
264
|
-
You may use the `arrayFormat` option to specify the format of the output array
|
264
|
+
You may use the `arrayFormat` option to specify the format of the output array:
|
265
265
|
|
266
266
|
```javascript
|
267
267
|
qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })
|
@@ -272,12 +272,36 @@ qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })
|
|
272
272
|
// 'a=b&a=c'
|
273
273
|
```
|
274
274
|
|
275
|
+
When objects are stringified, by default they use bracket notation:
|
276
|
+
|
277
|
+
```javascript
|
278
|
+
qs.stringify({ a: { b: { c: 'd', e: 'f' } } });
|
279
|
+
// 'a[b][c]=d&a[b][e]=f'
|
280
|
+
```
|
281
|
+
|
282
|
+
You may override this to use dot notation by setting the `allowDots` option to `true`:
|
283
|
+
|
284
|
+
```javascript
|
285
|
+
qs.stringify({ a: { b: { c: 'd', e: 'f' } } }, { allowDots: true });
|
286
|
+
// 'a.b.c=d&a.b.e=f'
|
287
|
+
```
|
288
|
+
|
275
289
|
Empty strings and null values will omit the value, but the equals sign (=) remains in place:
|
276
290
|
|
277
291
|
```javascript
|
278
292
|
assert.equal(qs.stringify({ a: '' }), 'a=');
|
279
293
|
```
|
280
294
|
|
295
|
+
Key with no values (such as an empty object or array) will return nothing:
|
296
|
+
|
297
|
+
```javascript
|
298
|
+
assert.equal(qs.stringify({ a: [] }), '');
|
299
|
+
assert.equal(qs.stringify({ a: {} }), '');
|
300
|
+
assert.equal(qs.stringify({ a: [{}] }), '');
|
301
|
+
assert.equal(qs.stringify({ a: { b: []} }), '');
|
302
|
+
assert.equal(qs.stringify({ a: { b: {}} }), '');
|
303
|
+
```
|
304
|
+
|
281
305
|
Properties that are set to `undefined` will be omitted entirely:
|
282
306
|
|
283
307
|
```javascript
|
@@ -301,6 +325,15 @@ assert.equal(
|
|
301
325
|
);
|
302
326
|
```
|
303
327
|
|
328
|
+
You may use the `sort` option to affect the order of parameter keys:
|
329
|
+
|
330
|
+
```javascript
|
331
|
+
function alphabeticalSort(a, b) {
|
332
|
+
return a.localeCompare(b);
|
333
|
+
}
|
334
|
+
assert.equal(qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort: alphabeticalSort }), 'a=c&b=f&z=y');
|
335
|
+
```
|
336
|
+
|
304
337
|
Finally, you can use the `filter` option to restrict which keys will be included in the stringified output.
|
305
338
|
If you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if you
|
306
339
|
pass an array, it will be used to select properties and array indices for stringification:
|
@@ -50,7 +50,7 @@ var defaults = {
|
|
50
50
|
strictNullHandling: false
|
51
51
|
};
|
52
52
|
|
53
|
-
var parseValues = function
|
53
|
+
var parseValues = function parseQueryStringValues(str, options) {
|
54
54
|
var obj = {};
|
55
55
|
var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit);
|
56
56
|
|
@@ -76,7 +76,7 @@ var parseValues = function parseValues(str, options) {
|
|
76
76
|
return obj;
|
77
77
|
};
|
78
78
|
|
79
|
-
var parseObject = function
|
79
|
+
var parseObject = function parseObjectRecursive(chain, val, options) {
|
80
80
|
if (!chain.length) {
|
81
81
|
return val;
|
82
82
|
}
|
@@ -89,7 +89,7 @@ var parseObject = function parseObject(chain, val, options) {
|
|
89
89
|
obj = obj.concat(parseObject(chain, val, options));
|
90
90
|
} else {
|
91
91
|
obj = options.plainObjects ? Object.create(null) : {};
|
92
|
-
var cleanRoot = root
|
92
|
+
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
93
93
|
var index = parseInt(cleanRoot, 10);
|
94
94
|
if (
|
95
95
|
!isNaN(index) &&
|
@@ -108,18 +108,18 @@ var parseObject = function parseObject(chain, val, options) {
|
|
108
108
|
return obj;
|
109
109
|
};
|
110
110
|
|
111
|
-
var parseKeys = function
|
111
|
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
|
112
112
|
if (!givenKey) {
|
113
113
|
return;
|
114
114
|
}
|
115
115
|
|
116
116
|
// Transform dot notation to bracket notation
|
117
|
-
var key = options.allowDots ? givenKey.replace(/\.([
|
117
|
+
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
118
118
|
|
119
119
|
// The regex chunks
|
120
120
|
|
121
|
-
var parent = /^([
|
122
|
-
var child = /(\[[
|
121
|
+
var parent = /^([^[]*)/;
|
122
|
+
var child = /(\[[^[\]]*])/g;
|
123
123
|
|
124
124
|
// Get the parent
|
125
125
|
|
@@ -145,9 +145,9 @@ var parseKeys = function parseKeys(givenKey, val, options) {
|
|
145
145
|
var i = 0;
|
146
146
|
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
147
147
|
i += 1;
|
148
|
-
if (!options.plainObjects && has.call(Object.prototype, segment[1].
|
148
|
+
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
149
149
|
if (!options.allowPrototypes) {
|
150
|
-
|
150
|
+
return;
|
151
151
|
}
|
152
152
|
}
|
153
153
|
keys.push(segment[1]);
|
@@ -206,13 +206,13 @@ var utils = require('./utils');
|
|
206
206
|
var formats = require('./formats');
|
207
207
|
|
208
208
|
var arrayPrefixGenerators = {
|
209
|
-
brackets: function brackets(prefix) {
|
209
|
+
brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
|
210
210
|
return prefix + '[]';
|
211
211
|
},
|
212
|
-
indices: function indices(prefix, key) {
|
212
|
+
indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
|
213
213
|
return prefix + '[' + key + ']';
|
214
214
|
},
|
215
|
-
repeat: function repeat(prefix) {
|
215
|
+
repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
|
216
216
|
return prefix;
|
217
217
|
}
|
218
218
|
};
|
@@ -223,14 +223,26 @@ var defaults = {
|
|
223
223
|
delimiter: '&',
|
224
224
|
encode: true,
|
225
225
|
encoder: utils.encode,
|
226
|
-
serializeDate: function serializeDate(date) {
|
226
|
+
serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
|
227
227
|
return toISO.call(date);
|
228
228
|
},
|
229
229
|
skipNulls: false,
|
230
230
|
strictNullHandling: false
|
231
231
|
};
|
232
232
|
|
233
|
-
var stringify = function stringify(
|
233
|
+
var stringify = function stringify( // eslint-disable-line func-name-matching
|
234
|
+
object,
|
235
|
+
prefix,
|
236
|
+
generateArrayPrefix,
|
237
|
+
strictNullHandling,
|
238
|
+
skipNulls,
|
239
|
+
encoder,
|
240
|
+
filter,
|
241
|
+
sort,
|
242
|
+
allowDots,
|
243
|
+
serializeDate,
|
244
|
+
formatter
|
245
|
+
) {
|
234
246
|
var obj = object;
|
235
247
|
if (typeof filter === 'function') {
|
236
248
|
obj = filter(prefix, obj);
|
@@ -309,6 +321,11 @@ var stringify = function stringify(object, prefix, generateArrayPrefix, strictNu
|
|
309
321
|
module.exports = function (object, opts) {
|
310
322
|
var obj = object;
|
311
323
|
var options = opts || {};
|
324
|
+
|
325
|
+
if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
|
326
|
+
throw new TypeError('Encoder has to be a function.');
|
327
|
+
}
|
328
|
+
|
312
329
|
var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
|
313
330
|
var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
314
331
|
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
|
@@ -326,10 +343,6 @@ module.exports = function (object, opts) {
|
|
326
343
|
var objKeys;
|
327
344
|
var filter;
|
328
345
|
|
329
|
-
if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
|
330
|
-
throw new TypeError('Encoder has to be a function.');
|
331
|
-
}
|
332
|
-
|
333
346
|
if (typeof options.filter === 'function') {
|
334
347
|
filter = options.filter;
|
335
348
|
obj = filter('', obj);
|
@@ -517,7 +530,7 @@ exports.encode = function (str) {
|
|
517
530
|
|
518
531
|
i += 1;
|
519
532
|
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
520
|
-
out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)];
|
533
|
+
out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; // eslint-disable-line max-len
|
521
534
|
}
|
522
535
|
|
523
536
|
return out;
|
@@ -16,7 +16,7 @@ var defaults = {
|
|
16
16
|
strictNullHandling: false
|
17
17
|
};
|
18
18
|
|
19
|
-
var parseValues = function
|
19
|
+
var parseValues = function parseQueryStringValues(str, options) {
|
20
20
|
var obj = {};
|
21
21
|
var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit);
|
22
22
|
|
@@ -42,7 +42,7 @@ var parseValues = function parseValues(str, options) {
|
|
42
42
|
return obj;
|
43
43
|
};
|
44
44
|
|
45
|
-
var parseObject = function
|
45
|
+
var parseObject = function parseObjectRecursive(chain, val, options) {
|
46
46
|
if (!chain.length) {
|
47
47
|
return val;
|
48
48
|
}
|
@@ -55,7 +55,7 @@ var parseObject = function parseObject(chain, val, options) {
|
|
55
55
|
obj = obj.concat(parseObject(chain, val, options));
|
56
56
|
} else {
|
57
57
|
obj = options.plainObjects ? Object.create(null) : {};
|
58
|
-
var cleanRoot = root
|
58
|
+
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
59
59
|
var index = parseInt(cleanRoot, 10);
|
60
60
|
if (
|
61
61
|
!isNaN(index) &&
|
@@ -74,18 +74,18 @@ var parseObject = function parseObject(chain, val, options) {
|
|
74
74
|
return obj;
|
75
75
|
};
|
76
76
|
|
77
|
-
var parseKeys = function
|
77
|
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
|
78
78
|
if (!givenKey) {
|
79
79
|
return;
|
80
80
|
}
|
81
81
|
|
82
82
|
// Transform dot notation to bracket notation
|
83
|
-
var key = options.allowDots ? givenKey.replace(/\.([
|
83
|
+
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
84
84
|
|
85
85
|
// The regex chunks
|
86
86
|
|
87
|
-
var parent = /^([
|
88
|
-
var child = /(\[[
|
87
|
+
var parent = /^([^[]*)/;
|
88
|
+
var child = /(\[[^[\]]*])/g;
|
89
89
|
|
90
90
|
// Get the parent
|
91
91
|
|
@@ -111,9 +111,9 @@ var parseKeys = function parseKeys(givenKey, val, options) {
|
|
111
111
|
var i = 0;
|
112
112
|
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
113
113
|
i += 1;
|
114
|
-
if (!options.plainObjects && has.call(Object.prototype, segment[1].
|
114
|
+
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
115
115
|
if (!options.allowPrototypes) {
|
116
|
-
|
116
|
+
return;
|
117
117
|
}
|
118
118
|
}
|
119
119
|
keys.push(segment[1]);
|