sequenceserver 1.1.0.beta → 1.1.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -7
- data/README.md +9 -11
- data/Rakefile +2 -15
- data/lib/sequenceserver/database.rb +7 -1
- data/lib/sequenceserver/routes.rb +5 -2
- data/lib/sequenceserver/version.rb +1 -1
- data/lib/sequenceserver.rb +3 -1
- data/package.json +2 -3
- data/public/config.js +0 -7
- data/public/css/sequenceserver.css +8 -17
- data/public/css/sequenceserver.min.css +2 -2
- data/public/js/report.js +62 -45
- data/public/js/search.js +24 -17
- data/public/js/sequenceserver.js +23 -60
- data/public/sequenceserver-report.min.js +17 -0
- data/public/sequenceserver-search.min.js +11 -0
- data/sequenceserver.gemspec +5 -5
- data/spec/capybara_spec.rb +3 -3
- data/spec/sequence_spec.rb +2 -2
- data/views/layout.erb +1 -13
- data/views/report.erb +13 -0
- data/views/search.erb +45 -0
- metadata +26 -92
- data/public/css/sequenceserver.min.css.gz +0 -0
- data/public/sequenceserver.min.js +0 -26
- data/public/sequenceserver.min.js.gz +0 -0
- data/public/vendor/npm/object-assign@2.1.1/.jspm-hash +0 -1
- data/public/vendor/npm/object-assign@2.1.1/.jspm.json +0 -72
- data/public/vendor/npm/object-assign@2.1.1/index.js +0 -27
- data/public/vendor/npm/object-assign@2.1.1/package.json +0 -38
- data/public/vendor/npm/object-assign@2.1.1.js +0 -1
- data/public/vendor/npm/qs@2.4.1/.jshintignore +0 -1
- data/public/vendor/npm/qs@2.4.1/.jshintrc +0 -10
- data/public/vendor/npm/qs@2.4.1/.jspm-hash +0 -1
- data/public/vendor/npm/qs@2.4.1/.jspm.json +0 -61
- data/public/vendor/npm/qs@2.4.1/.npmignore +0 -18
- data/public/vendor/npm/qs@2.4.1/.travis.yml +0 -6
- data/public/vendor/npm/qs@2.4.1/CHANGELOG.md +0 -68
- data/public/vendor/npm/qs@2.4.1/CONTRIBUTING.md +0 -1
- data/public/vendor/npm/qs@2.4.1/LICENSE +0 -28
- data/public/vendor/npm/qs@2.4.1/Makefile +0 -8
- data/public/vendor/npm/qs@2.4.1/README.md +0 -233
- data/public/vendor/npm/qs@2.4.1/index.js +0 -2
- data/public/vendor/npm/qs@2.4.1/lib/index.js +0 -8
- data/public/vendor/npm/qs@2.4.1/lib/parse.js +0 -100
- data/public/vendor/npm/qs@2.4.1/lib/stringify.js +0 -67
- data/public/vendor/npm/qs@2.4.1/lib/utils.js +0 -132
- data/public/vendor/npm/qs@2.4.1/lib.js +0 -2
- data/public/vendor/npm/qs@2.4.1/package.json +0 -29
- data/public/vendor/npm/qs@2.4.1/test/parse.js +0 -359
- data/public/vendor/npm/qs@2.4.1.js +0 -1
- data/public/vendor/npm/react-router@0.13.3/.jspm-hash +0 -1
- data/public/vendor/npm/react-router@0.13.3/.jspm.json +0 -70
- data/public/vendor/npm/react-router@0.13.3/README.md +0 -140
- data/public/vendor/npm/react-router@0.13.3/lib/Cancellation.js +0 -9
- data/public/vendor/npm/react-router@0.13.3/lib/History.js +0 -31
- data/public/vendor/npm/react-router@0.13.3/lib/Match.js +0 -80
- data/public/vendor/npm/react-router@0.13.3/lib/Navigation.js +0 -22
- data/public/vendor/npm/react-router@0.13.3/lib/PathUtils.js +0 -154
- data/public/vendor/npm/react-router@0.13.3/lib/PropTypes.js +0 -15
- data/public/vendor/npm/react-router@0.13.3/lib/Redirect.js +0 -12
- data/public/vendor/npm/react-router@0.13.3/lib/Route.js +0 -133
- data/public/vendor/npm/react-router@0.13.3/lib/ScrollHistory.js +0 -53
- data/public/vendor/npm/react-router@0.13.3/lib/State.js +0 -25
- data/public/vendor/npm/react-router@0.13.3/lib/TestUtils.js +0 -102
- data/public/vendor/npm/react-router@0.13.3/lib/Transition.js +0 -58
- data/public/vendor/npm/react-router@0.13.3/lib/actions/LocationActions.js +0 -25
- data/public/vendor/npm/react-router@0.13.3/lib/behaviors/ImitateBrowserBehavior.js +0 -19
- data/public/vendor/npm/react-router@0.13.3/lib/behaviors/ScrollToTopBehavior.js +0 -15
- data/public/vendor/npm/react-router@0.13.3/lib/components/ActiveHandler.js +0 -111
- data/public/vendor/npm/react-router@0.13.3/lib/components/ContextWrapper.js +0 -39
- data/public/vendor/npm/react-router@0.13.3/lib/components/DefaultRoute.js +0 -41
- data/public/vendor/npm/react-router@0.13.3/lib/components/Link.js +0 -119
- data/public/vendor/npm/react-router@0.13.3/lib/components/NotFoundRoute.js +0 -41
- data/public/vendor/npm/react-router@0.13.3/lib/components/Redirect.js +0 -40
- data/public/vendor/npm/react-router@0.13.3/lib/components/Route.js +0 -67
- data/public/vendor/npm/react-router@0.13.3/lib/components/RouteHandler.js +0 -111
- data/public/vendor/npm/react-router@0.13.3/lib/createRouter.js +0 -329
- data/public/vendor/npm/react-router@0.13.3/lib/createRoutesFromReactChildren.js +0 -59
- data/public/vendor/npm/react-router@0.13.3/lib/getWindowScrollPosition.js +0 -19
- data/public/vendor/npm/react-router@0.13.3/lib/index.js +0 -26
- data/public/vendor/npm/react-router@0.13.3/lib/isReactChildren.js +0 -14
- data/public/vendor/npm/react-router@0.13.3/lib/locations/HashLocation.js +0 -79
- data/public/vendor/npm/react-router@0.13.3/lib/locations/HistoryLocation.js +0 -64
- data/public/vendor/npm/react-router@0.13.3/lib/locations/RefreshLocation.js +0 -18
- data/public/vendor/npm/react-router@0.13.3/lib/locations/StaticLocation.js +0 -50
- data/public/vendor/npm/react-router@0.13.3/lib/locations/TestLocation.js +0 -104
- data/public/vendor/npm/react-router@0.13.3/lib/runRouter.js +0 -16
- data/public/vendor/npm/react-router@0.13.3/lib/supportsHistory.js +0 -17
- data/public/vendor/npm/react-router@0.13.3/lib.js +0 -2
- data/public/vendor/npm/react-router@0.13.3/package.json +0 -36
- data/public/vendor/npm/react-router@0.13.3/umd/ReactRouter.js +0 -3388
- data/public/vendor/npm/react-router@0.13.3/umd/ReactRouter.min.js +0 -8
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
43c36e5d569ff8e4816c4efa8be02d26967c18aa99914b932bd37a50b983c5e7c90ae93bjspm-npm@0.240.16
|
@@ -1,72 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "object-assign",
|
3
|
-
"version": "2.1.1",
|
4
|
-
"description": "ES6 Object.assign() ponyfill",
|
5
|
-
"license": "MIT",
|
6
|
-
"repository": {
|
7
|
-
"type": "git",
|
8
|
-
"url": "https://github.com/sindresorhus/object-assign"
|
9
|
-
},
|
10
|
-
"author": {
|
11
|
-
"name": "Sindre Sorhus",
|
12
|
-
"email": "sindresorhus@gmail.com",
|
13
|
-
"url": "http://sindresorhus.com"
|
14
|
-
},
|
15
|
-
"engines": {
|
16
|
-
"node": ">=0.10.0"
|
17
|
-
},
|
18
|
-
"scripts": {
|
19
|
-
"test": "mocha"
|
20
|
-
},
|
21
|
-
"files": [
|
22
|
-
"index.js",
|
23
|
-
"package.json"
|
24
|
-
],
|
25
|
-
"keywords": [
|
26
|
-
"object",
|
27
|
-
"assign",
|
28
|
-
"extend",
|
29
|
-
"properties",
|
30
|
-
"es6",
|
31
|
-
"ecmascript",
|
32
|
-
"harmony",
|
33
|
-
"ponyfill",
|
34
|
-
"prollyfill",
|
35
|
-
"polyfill",
|
36
|
-
"shim",
|
37
|
-
"browser"
|
38
|
-
],
|
39
|
-
"devDependencies": {
|
40
|
-
"mocha": "*"
|
41
|
-
},
|
42
|
-
"gitHead": "4cd0365f5a78dd369473ca0bbd31f7b234148c42",
|
43
|
-
"bugs": {
|
44
|
-
"url": "https://github.com/sindresorhus/object-assign/issues"
|
45
|
-
},
|
46
|
-
"homepage": "https://github.com/sindresorhus/object-assign",
|
47
|
-
"_id": "object-assign@2.1.1",
|
48
|
-
"_shasum": "43c36e5d569ff8e4816c4efa8be02d26967c18aa",
|
49
|
-
"_from": ".",
|
50
|
-
"_npmVersion": "2.10.1",
|
51
|
-
"_nodeVersion": "0.12.4",
|
52
|
-
"_npmUser": {
|
53
|
-
"name": "sindresorhus",
|
54
|
-
"email": "sindresorhus@gmail.com"
|
55
|
-
},
|
56
|
-
"dist": {
|
57
|
-
"shasum": "43c36e5d569ff8e4816c4efa8be02d26967c18aa",
|
58
|
-
"tarball": "http://registry.npmjs.org/object-assign/-/object-assign-2.1.1.tgz"
|
59
|
-
},
|
60
|
-
"maintainers": [
|
61
|
-
{
|
62
|
-
"name": "sindresorhus",
|
63
|
-
"email": "sindresorhus@gmail.com"
|
64
|
-
}
|
65
|
-
],
|
66
|
-
"format": "cjs",
|
67
|
-
"ignore": [
|
68
|
-
"node_modules"
|
69
|
-
],
|
70
|
-
"registry": "npm",
|
71
|
-
"dependencies": {}
|
72
|
-
}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
/* */
|
2
|
-
'use strict';
|
3
|
-
|
4
|
-
function ToObject(val) {
|
5
|
-
if (val == null) {
|
6
|
-
throw new TypeError('Object.assign cannot be called with null or undefined');
|
7
|
-
}
|
8
|
-
|
9
|
-
return Object(val);
|
10
|
-
}
|
11
|
-
|
12
|
-
module.exports = Object.assign || function (target, source) {
|
13
|
-
var from;
|
14
|
-
var keys;
|
15
|
-
var to = ToObject(target);
|
16
|
-
|
17
|
-
for (var s = 1; s < arguments.length; s++) {
|
18
|
-
from = arguments[s];
|
19
|
-
keys = Object.keys(Object(from));
|
20
|
-
|
21
|
-
for (var i = 0; i < keys.length; i++) {
|
22
|
-
to[keys[i]] = from[keys[i]];
|
23
|
-
}
|
24
|
-
}
|
25
|
-
|
26
|
-
return to;
|
27
|
-
};
|
@@ -1,38 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "object-assign",
|
3
|
-
"version": "2.1.1",
|
4
|
-
"description": "ES6 Object.assign() ponyfill",
|
5
|
-
"license": "MIT",
|
6
|
-
"repository": "sindresorhus/object-assign",
|
7
|
-
"author": {
|
8
|
-
"name": "Sindre Sorhus",
|
9
|
-
"email": "sindresorhus@gmail.com",
|
10
|
-
"url": "http://sindresorhus.com"
|
11
|
-
},
|
12
|
-
"engines": {
|
13
|
-
"node": ">=0.10.0"
|
14
|
-
},
|
15
|
-
"scripts": {
|
16
|
-
"test": "mocha"
|
17
|
-
},
|
18
|
-
"files": [
|
19
|
-
"index.js"
|
20
|
-
],
|
21
|
-
"keywords": [
|
22
|
-
"object",
|
23
|
-
"assign",
|
24
|
-
"extend",
|
25
|
-
"properties",
|
26
|
-
"es6",
|
27
|
-
"ecmascript",
|
28
|
-
"harmony",
|
29
|
-
"ponyfill",
|
30
|
-
"prollyfill",
|
31
|
-
"polyfill",
|
32
|
-
"shim",
|
33
|
-
"browser"
|
34
|
-
],
|
35
|
-
"devDependencies": {
|
36
|
-
"mocha": "*"
|
37
|
-
}
|
38
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
module.exports = require("npm:object-assign@2.1.1/index");
|
@@ -1 +0,0 @@
|
|
1
|
-
node_modules
|
@@ -1 +0,0 @@
|
|
1
|
-
68cbaea971013426a80c1404fad6b1a6b117524599914b932bd37a50b983c5e7c90ae93bjspm-npm@0.240.16
|
@@ -1,61 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "qs",
|
3
|
-
"version": "2.4.1",
|
4
|
-
"description": "A querystring parser that supports nesting and arrays, with a depth limit",
|
5
|
-
"homepage": "https://github.com/hapijs/qs",
|
6
|
-
"main": "index.js",
|
7
|
-
"devDependencies": {
|
8
|
-
"code": "1.x.x",
|
9
|
-
"lab": "5.x.x"
|
10
|
-
},
|
11
|
-
"scripts": {
|
12
|
-
"test": "make test-cov"
|
13
|
-
},
|
14
|
-
"repository": {
|
15
|
-
"type": "git",
|
16
|
-
"url": "https://github.com/hapijs/qs.git"
|
17
|
-
},
|
18
|
-
"keywords": [
|
19
|
-
"querystring",
|
20
|
-
"qs"
|
21
|
-
],
|
22
|
-
"licenses": [
|
23
|
-
{
|
24
|
-
"type": "BSD",
|
25
|
-
"url": "http://github.com/hapijs/qs/raw/master/LICENSE"
|
26
|
-
}
|
27
|
-
],
|
28
|
-
"gitHead": "58c6540418954867822c1af3e45fb4c26708b07e",
|
29
|
-
"bugs": {
|
30
|
-
"url": "https://github.com/hapijs/qs/issues"
|
31
|
-
},
|
32
|
-
"_id": "qs@2.4.1",
|
33
|
-
"_shasum": "68cbaea971013426a80c1404fad6b1a6b1175245",
|
34
|
-
"_from": ".",
|
35
|
-
"_npmVersion": "2.6.1",
|
36
|
-
"_nodeVersion": "0.10.36",
|
37
|
-
"_npmUser": {
|
38
|
-
"name": "nlf",
|
39
|
-
"email": "quitlahok@gmail.com"
|
40
|
-
},
|
41
|
-
"maintainers": [
|
42
|
-
{
|
43
|
-
"name": "nlf",
|
44
|
-
"email": "quitlahok@gmail.com"
|
45
|
-
},
|
46
|
-
{
|
47
|
-
"name": "hueniverse",
|
48
|
-
"email": "eran@hueniverse.com"
|
49
|
-
}
|
50
|
-
],
|
51
|
-
"dist": {
|
52
|
-
"shasum": "68cbaea971013426a80c1404fad6b1a6b1175245",
|
53
|
-
"tarball": "http://registry.npmjs.org/qs/-/qs-2.4.1.tgz"
|
54
|
-
},
|
55
|
-
"format": "cjs",
|
56
|
-
"ignore": [
|
57
|
-
"node_modules"
|
58
|
-
],
|
59
|
-
"registry": "npm",
|
60
|
-
"dependencies": {}
|
61
|
-
}
|
@@ -1,68 +0,0 @@
|
|
1
|
-
|
2
|
-
## [**2.3.3**](https://github.com/hapijs/qs/issues?milestone=18&state=open)
|
3
|
-
- [**#59**](https://github.com/hapijs/qs/issues/59) make sure array indexes are >= 0, closes #57
|
4
|
-
- [**#58**](https://github.com/hapijs/qs/issues/58) make qs usable for browser loader
|
5
|
-
|
6
|
-
## [**2.3.2**](https://github.com/hapijs/qs/issues?milestone=17&state=closed)
|
7
|
-
- [**#55**](https://github.com/hapijs/qs/issues/55) allow merging a string into an object
|
8
|
-
|
9
|
-
## [**2.3.1**](https://github.com/hapijs/qs/issues?milestone=16&state=closed)
|
10
|
-
- [**#52**](https://github.com/hapijs/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError".
|
11
|
-
|
12
|
-
## [**2.3.0**](https://github.com/hapijs/qs/issues?milestone=15&state=closed)
|
13
|
-
- [**#50**](https://github.com/hapijs/qs/issues/50) add option to omit array indices, closes #46
|
14
|
-
|
15
|
-
## [**2.2.5**](https://github.com/hapijs/qs/issues?milestone=14&state=closed)
|
16
|
-
- [**#39**](https://github.com/hapijs/qs/issues/39) Is there an alternative to Buffer.isBuffer?
|
17
|
-
- [**#49**](https://github.com/hapijs/qs/issues/49) refactor utils.merge, fixes #45
|
18
|
-
- [**#41**](https://github.com/hapijs/qs/issues/41) avoid browserifying Buffer, for #39
|
19
|
-
|
20
|
-
## [**2.2.4**](https://github.com/hapijs/qs/issues?milestone=13&state=closed)
|
21
|
-
- [**#38**](https://github.com/hapijs/qs/issues/38) how to handle object keys beginning with a number
|
22
|
-
|
23
|
-
## [**2.2.3**](https://github.com/hapijs/qs/issues?milestone=12&state=closed)
|
24
|
-
- [**#37**](https://github.com/hapijs/qs/issues/37) parser discards first empty value in array
|
25
|
-
- [**#36**](https://github.com/hapijs/qs/issues/36) Update to lab 4.x
|
26
|
-
|
27
|
-
## [**2.2.2**](https://github.com/hapijs/qs/issues?milestone=11&state=closed)
|
28
|
-
- [**#33**](https://github.com/hapijs/qs/issues/33) Error when plain object in a value
|
29
|
-
- [**#34**](https://github.com/hapijs/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty
|
30
|
-
- [**#24**](https://github.com/hapijs/qs/issues/24) Changelog? Semver?
|
31
|
-
|
32
|
-
## [**2.2.1**](https://github.com/hapijs/qs/issues?milestone=10&state=closed)
|
33
|
-
- [**#32**](https://github.com/hapijs/qs/issues/32) account for circular references properly, closes #31
|
34
|
-
- [**#31**](https://github.com/hapijs/qs/issues/31) qs.parse stackoverflow on circular objects
|
35
|
-
|
36
|
-
## [**2.2.0**](https://github.com/hapijs/qs/issues?milestone=9&state=closed)
|
37
|
-
- [**#26**](https://github.com/hapijs/qs/issues/26) Don't use Buffer global if it's not present
|
38
|
-
- [**#30**](https://github.com/hapijs/qs/issues/30) Bug when merging non-object values into arrays
|
39
|
-
- [**#29**](https://github.com/hapijs/qs/issues/29) Don't call Utils.clone at the top of Utils.merge
|
40
|
-
- [**#23**](https://github.com/hapijs/qs/issues/23) Ability to not limit parameters?
|
41
|
-
|
42
|
-
## [**2.1.0**](https://github.com/hapijs/qs/issues?milestone=8&state=closed)
|
43
|
-
- [**#22**](https://github.com/hapijs/qs/issues/22) Enable using a RegExp as delimiter
|
44
|
-
|
45
|
-
## [**2.0.0**](https://github.com/hapijs/qs/issues?milestone=7&state=closed)
|
46
|
-
- [**#18**](https://github.com/hapijs/qs/issues/18) Why is there arrayLimit?
|
47
|
-
- [**#20**](https://github.com/hapijs/qs/issues/20) Configurable parametersLimit
|
48
|
-
- [**#21**](https://github.com/hapijs/qs/issues/21) make all limits optional, for #18, for #20
|
49
|
-
|
50
|
-
## [**1.2.2**](https://github.com/hapijs/qs/issues?milestone=6&state=closed)
|
51
|
-
- [**#19**](https://github.com/hapijs/qs/issues/19) Don't overwrite null values
|
52
|
-
|
53
|
-
## [**1.2.1**](https://github.com/hapijs/qs/issues?milestone=5&state=closed)
|
54
|
-
- [**#16**](https://github.com/hapijs/qs/issues/16) ignore non-string delimiters
|
55
|
-
- [**#15**](https://github.com/hapijs/qs/issues/15) Close code block
|
56
|
-
|
57
|
-
## [**1.2.0**](https://github.com/hapijs/qs/issues?milestone=4&state=closed)
|
58
|
-
- [**#12**](https://github.com/hapijs/qs/issues/12) Add optional delim argument
|
59
|
-
- [**#13**](https://github.com/hapijs/qs/issues/13) fix #11: flattened keys in array are now correctly parsed
|
60
|
-
|
61
|
-
## [**1.1.0**](https://github.com/hapijs/qs/issues?milestone=3&state=closed)
|
62
|
-
- [**#7**](https://github.com/hapijs/qs/issues/7) Empty values of a POST array disappear after being submitted
|
63
|
-
- [**#9**](https://github.com/hapijs/qs/issues/9) Should not omit equals signs (=) when value is null
|
64
|
-
- [**#6**](https://github.com/hapijs/qs/issues/6) Minor grammar fix in README
|
65
|
-
|
66
|
-
## [**1.0.2**](https://github.com/hapijs/qs/issues?milestone=2&state=closed)
|
67
|
-
- [**#5**](https://github.com/hapijs/qs/issues/5) array holes incorrectly copied into object on large index
|
68
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md).
|
@@ -1,28 +0,0 @@
|
|
1
|
-
Copyright (c) 2014 Nathan LaFreniere and other contributors.
|
2
|
-
All rights reserved.
|
3
|
-
|
4
|
-
Redistribution and use in source and binary forms, with or without
|
5
|
-
modification, are permitted provided that the following conditions are met:
|
6
|
-
* Redistributions of source code must retain the above copyright
|
7
|
-
notice, this list of conditions and the following disclaimer.
|
8
|
-
* Redistributions in binary form must reproduce the above copyright
|
9
|
-
notice, this list of conditions and the following disclaimer in the
|
10
|
-
documentation and/or other materials provided with the distribution.
|
11
|
-
* The names of any contributors may not be used to endorse or promote
|
12
|
-
products derived from this software without specific prior written
|
13
|
-
permission.
|
14
|
-
|
15
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
16
|
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
17
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
18
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
|
19
|
-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
20
|
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
21
|
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
22
|
-
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
23
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
24
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
25
|
-
|
26
|
-
* * *
|
27
|
-
|
28
|
-
The complete list of contributors can be found at: https://github.com/hapijs/qs/graphs/contributors
|
@@ -1,233 +0,0 @@
|
|
1
|
-
# qs
|
2
|
-
|
3
|
-
A querystring parsing and stringifying library with some added security.
|
4
|
-
|
5
|
-
[![Build Status](https://secure.travis-ci.org/hapijs/qs.svg)](http://travis-ci.org/hapijs/qs)
|
6
|
-
|
7
|
-
Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf)
|
8
|
-
|
9
|
-
The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring).
|
10
|
-
|
11
|
-
## Usage
|
12
|
-
|
13
|
-
```javascript
|
14
|
-
var Qs = require('qs');
|
15
|
-
|
16
|
-
var obj = Qs.parse('a=c'); // { a: 'c' }
|
17
|
-
var str = Qs.stringify(obj); // 'a=c'
|
18
|
-
```
|
19
|
-
|
20
|
-
### Parsing Objects
|
21
|
-
|
22
|
-
```javascript
|
23
|
-
Qs.parse(string, [options]);
|
24
|
-
```
|
25
|
-
|
26
|
-
**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`.
|
27
|
-
For example, the string `'foo[bar]=baz'` converts to:
|
28
|
-
|
29
|
-
```javascript
|
30
|
-
{
|
31
|
-
foo: {
|
32
|
-
bar: 'baz'
|
33
|
-
}
|
34
|
-
}
|
35
|
-
```
|
36
|
-
|
37
|
-
URI encoded strings work too:
|
38
|
-
|
39
|
-
```javascript
|
40
|
-
Qs.parse('a%5Bb%5D=c');
|
41
|
-
// { a: { b: 'c' } }
|
42
|
-
```
|
43
|
-
|
44
|
-
You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`:
|
45
|
-
|
46
|
-
```javascript
|
47
|
-
{
|
48
|
-
foo: {
|
49
|
-
bar: {
|
50
|
-
baz: 'foobarbaz'
|
51
|
-
}
|
52
|
-
}
|
53
|
-
}
|
54
|
-
```
|
55
|
-
|
56
|
-
By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like
|
57
|
-
`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be:
|
58
|
-
|
59
|
-
```javascript
|
60
|
-
{
|
61
|
-
a: {
|
62
|
-
b: {
|
63
|
-
c: {
|
64
|
-
d: {
|
65
|
-
e: {
|
66
|
-
f: {
|
67
|
-
'[g][h][i]': 'j'
|
68
|
-
}
|
69
|
-
}
|
70
|
-
}
|
71
|
-
}
|
72
|
-
}
|
73
|
-
}
|
74
|
-
}
|
75
|
-
```
|
76
|
-
|
77
|
-
This depth can be overridden by passing a `depth` option to `Qs.parse(string, [options])`:
|
78
|
-
|
79
|
-
```javascript
|
80
|
-
Qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });
|
81
|
-
// { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }
|
82
|
-
```
|
83
|
-
|
84
|
-
The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number.
|
85
|
-
|
86
|
-
For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option:
|
87
|
-
|
88
|
-
```javascript
|
89
|
-
Qs.parse('a=b&c=d', { parameterLimit: 1 });
|
90
|
-
// { a: 'b' }
|
91
|
-
```
|
92
|
-
|
93
|
-
An optional delimiter can also be passed:
|
94
|
-
|
95
|
-
```javascript
|
96
|
-
Qs.parse('a=b;c=d', { delimiter: ';' });
|
97
|
-
// { a: 'b', c: 'd' }
|
98
|
-
```
|
99
|
-
|
100
|
-
Delimiters can be a regular expression too:
|
101
|
-
|
102
|
-
```javascript
|
103
|
-
Qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });
|
104
|
-
// { a: 'b', c: 'd', e: 'f' }
|
105
|
-
```
|
106
|
-
|
107
|
-
### Parsing Arrays
|
108
|
-
|
109
|
-
**qs** can also parse arrays using a similar `[]` notation:
|
110
|
-
|
111
|
-
```javascript
|
112
|
-
Qs.parse('a[]=b&a[]=c');
|
113
|
-
// { a: ['b', 'c'] }
|
114
|
-
```
|
115
|
-
|
116
|
-
You may specify an index as well:
|
117
|
-
|
118
|
-
```javascript
|
119
|
-
Qs.parse('a[1]=c&a[0]=b');
|
120
|
-
// { a: ['b', 'c'] }
|
121
|
-
```
|
122
|
-
|
123
|
-
Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number
|
124
|
-
to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving
|
125
|
-
their order:
|
126
|
-
|
127
|
-
```javascript
|
128
|
-
Qs.parse('a[1]=b&a[15]=c');
|
129
|
-
// { a: ['b', 'c'] }
|
130
|
-
```
|
131
|
-
|
132
|
-
Note that an empty string is also a value, and will be preserved:
|
133
|
-
|
134
|
-
```javascript
|
135
|
-
Qs.parse('a[]=&a[]=b');
|
136
|
-
// { a: ['', 'b'] }
|
137
|
-
Qs.parse('a[0]=b&a[1]=&a[2]=c');
|
138
|
-
// { a: ['b', '', 'c'] }
|
139
|
-
```
|
140
|
-
|
141
|
-
**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will
|
142
|
-
instead be converted to an object with the index as the key:
|
143
|
-
|
144
|
-
```javascript
|
145
|
-
Qs.parse('a[100]=b');
|
146
|
-
// { a: { '100': 'b' } }
|
147
|
-
```
|
148
|
-
|
149
|
-
This limit can be overridden by passing an `arrayLimit` option:
|
150
|
-
|
151
|
-
```javascript
|
152
|
-
Qs.parse('a[1]=b', { arrayLimit: 0 });
|
153
|
-
// { a: { '1': 'b' } }
|
154
|
-
```
|
155
|
-
|
156
|
-
To disable array parsing entirely, set `arrayLimit` to `-1`.
|
157
|
-
|
158
|
-
If you mix notations, **qs** will merge the two items into an object:
|
159
|
-
|
160
|
-
```javascript
|
161
|
-
Qs.parse('a[0]=b&a[b]=c');
|
162
|
-
// { a: { '0': 'b', b: 'c' } }
|
163
|
-
```
|
164
|
-
|
165
|
-
You can also create arrays of objects:
|
166
|
-
|
167
|
-
```javascript
|
168
|
-
Qs.parse('a[][b]=c');
|
169
|
-
// { a: [{ b: 'c' }] }
|
170
|
-
```
|
171
|
-
|
172
|
-
### Stringifying
|
173
|
-
|
174
|
-
```javascript
|
175
|
-
Qs.stringify(object, [options]);
|
176
|
-
```
|
177
|
-
|
178
|
-
When stringifying, **qs** always URI encodes output. Objects are stringified as you would expect:
|
179
|
-
|
180
|
-
```javascript
|
181
|
-
Qs.stringify({ a: 'b' });
|
182
|
-
// 'a=b'
|
183
|
-
Qs.stringify({ a: { b: 'c' } });
|
184
|
-
// 'a%5Bb%5D=c'
|
185
|
-
```
|
186
|
-
|
187
|
-
Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage.
|
188
|
-
|
189
|
-
When arrays are stringified, by default they are given explicit indices:
|
190
|
-
|
191
|
-
```javascript
|
192
|
-
Qs.stringify({ a: ['b', 'c', 'd'] });
|
193
|
-
// 'a[0]=b&a[1]=c&a[2]=d'
|
194
|
-
```
|
195
|
-
|
196
|
-
You may override this by setting the `indices` option to `false`:
|
197
|
-
|
198
|
-
```javascript
|
199
|
-
Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });
|
200
|
-
// 'a=b&a=c&a=d'
|
201
|
-
```
|
202
|
-
|
203
|
-
You may use the `arrayFormat` option to specify the format of the output array
|
204
|
-
|
205
|
-
```javascript
|
206
|
-
Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })
|
207
|
-
// 'a[0]=b&a[1]=c'
|
208
|
-
Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })
|
209
|
-
// 'a[]=b&a[]=c'
|
210
|
-
Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })
|
211
|
-
// 'a=b&a=c'
|
212
|
-
```
|
213
|
-
|
214
|
-
Empty strings and null values will omit the value, but the equals sign (=) remains in place:
|
215
|
-
|
216
|
-
```javascript
|
217
|
-
Qs.stringify({ a: '' });
|
218
|
-
// 'a='
|
219
|
-
```
|
220
|
-
|
221
|
-
Properties that are set to `undefined` will be omitted entirely:
|
222
|
-
|
223
|
-
```javascript
|
224
|
-
Qs.stringify({ a: null, b: undefined });
|
225
|
-
// 'a='
|
226
|
-
```
|
227
|
-
|
228
|
-
The delimiter may be overridden with stringify as well:
|
229
|
-
|
230
|
-
```javascript
|
231
|
-
Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' });
|
232
|
-
// 'a=b;c=d'
|
233
|
-
```
|