step-node-agent 3.25.4 → 3.26.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/AgentConf.yaml +13 -0
- package/api/controllers/controller.js +4 -0
- package/api/routes/routes.js +1 -0
- package/node_modules/aws4/aws4.js +1 -1
- package/node_modules/aws4/package.json +2 -2
- package/node_modules/body-parser/HISTORY.md +7 -0
- package/node_modules/body-parser/README.md +11 -0
- package/node_modules/body-parser/lib/types/urlencoded.js +30 -7
- package/node_modules/body-parser/package.json +2 -2
- package/node_modules/encodeurl/README.md +19 -38
- package/node_modules/encodeurl/index.js +1 -1
- package/node_modules/encodeurl/package.json +7 -7
- package/node_modules/express/History.md +27 -0
- package/node_modules/express/Readme.md +100 -6
- package/node_modules/express/lib/response.js +11 -10
- package/node_modules/express/package.json +11 -11
- package/node_modules/finalhandler/HISTORY.md +15 -0
- package/node_modules/finalhandler/README.md +2 -2
- package/node_modules/finalhandler/index.js +7 -2
- package/node_modules/finalhandler/package.json +8 -7
- package/node_modules/get-fqdn/LICENSE +21 -0
- package/node_modules/get-fqdn/README.md +83 -0
- package/node_modules/get-fqdn/index.js +17 -0
- package/node_modules/get-fqdn/package.json +73 -0
- package/node_modules/is-core-module/CHANGELOG.md +10 -0
- package/node_modules/is-core-module/core.json +2 -2
- package/node_modules/is-core-module/package.json +4 -4
- package/node_modules/is-core-module/test/index.js +17 -1
- package/node_modules/merge-descriptors/README.md +4 -3
- package/node_modules/merge-descriptors/index.js +3 -3
- package/node_modules/merge-descriptors/package.json +14 -7
- package/node_modules/path-to-regexp/index.js +57 -40
- package/node_modules/path-to-regexp/package.json +2 -2
- package/node_modules/qs/.editorconfig +3 -0
- package/node_modules/qs/.eslintrc +2 -2
- package/node_modules/qs/CHANGELOG.md +59 -5
- package/node_modules/qs/README.md +133 -49
- package/node_modules/qs/dist/qs.js +56 -2020
- package/node_modules/qs/lib/parse.js +46 -13
- package/node_modules/qs/lib/stringify.js +53 -28
- package/node_modules/qs/lib/utils.js +47 -34
- package/node_modules/qs/package.json +26 -12
- package/node_modules/qs/test/empty-keys-cases.js +267 -0
- package/node_modules/qs/test/parse.js +347 -32
- package/node_modules/qs/test/stringify.js +436 -47
- package/node_modules/send/HISTORY.md +5 -0
- package/node_modules/send/index.js +1 -2
- package/node_modules/send/node_modules/encodeurl/LICENSE +22 -0
- package/node_modules/send/node_modules/encodeurl/README.md +128 -0
- package/node_modules/send/node_modules/encodeurl/index.js +60 -0
- package/node_modules/send/node_modules/encodeurl/package.json +40 -0
- package/node_modules/send/package.json +1 -1
- package/node_modules/serve-static/HISTORY.md +16 -0
- package/node_modules/serve-static/index.js +1 -2
- package/node_modules/serve-static/package.json +3 -3
- package/node_modules/yaml/LICENSE +13 -0
- package/node_modules/yaml/README.md +155 -0
- package/node_modules/yaml/bin.mjs +11 -0
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +42 -0
- package/node_modules/yaml/browser/dist/compose/compose-node.js +92 -0
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +80 -0
- package/node_modules/yaml/browser/dist/compose/composer.js +217 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +113 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +47 -0
- package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +203 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +223 -0
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +148 -0
- package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +27 -0
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +17 -0
- package/node_modules/yaml/browser/dist/doc/Document.js +334 -0
- package/node_modules/yaml/browser/dist/doc/anchors.js +72 -0
- package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/node_modules/yaml/browser/dist/doc/createNode.js +89 -0
- package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/node_modules/yaml/browser/dist/errors.js +57 -0
- package/node_modules/yaml/browser/dist/index.js +17 -0
- package/node_modules/yaml/browser/dist/log.js +14 -0
- package/node_modules/yaml/browser/dist/nodes/Alias.js +101 -0
- package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
- package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
- package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +104 -0
- package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
- package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/node_modules/yaml/browser/dist/parse/lexer.js +717 -0
- package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/node_modules/yaml/browser/dist/parse/parser.js +954 -0
- package/node_modules/yaml/browser/dist/public-api.js +99 -0
- package/node_modules/yaml/browser/dist/schema/Schema.js +38 -0
- package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/node_modules/yaml/browser/dist/schema/tags.js +83 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +66 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +37 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
- package/node_modules/yaml/browser/dist/stringify/stringify.js +124 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +143 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +24 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +328 -0
- package/node_modules/yaml/browser/dist/util.js +11 -0
- package/node_modules/yaml/browser/dist/visit.js +233 -0
- package/node_modules/yaml/browser/index.js +5 -0
- package/node_modules/yaml/browser/package.json +3 -0
- package/node_modules/yaml/dist/cli.d.ts +8 -0
- package/node_modules/yaml/dist/cli.mjs +199 -0
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
- package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
- package/node_modules/yaml/dist/compose/compose-doc.js +44 -0
- package/node_modules/yaml/dist/compose/compose-node.d.ts +28 -0
- package/node_modules/yaml/dist/compose/compose-node.js +95 -0
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-scalar.js +82 -0
- package/node_modules/yaml/dist/compose/composer.d.ts +62 -0
- package/node_modules/yaml/dist/compose/composer.js +221 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.js +115 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +49 -0
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +205 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +225 -0
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
- package/node_modules/yaml/dist/compose/resolve-props.js +150 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +29 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/node_modules/yaml/dist/compose/util-map-includes.js +19 -0
- package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
- package/node_modules/yaml/dist/doc/Document.js +336 -0
- package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/node_modules/yaml/dist/doc/anchors.js +77 -0
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/node_modules/yaml/dist/doc/createNode.js +91 -0
- package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
- package/node_modules/yaml/dist/doc/directives.js +178 -0
- package/node_modules/yaml/dist/errors.d.ts +21 -0
- package/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/yaml/dist/index.d.ts +22 -0
- package/node_modules/yaml/dist/index.js +50 -0
- package/node_modules/yaml/dist/log.d.ts +3 -0
- package/node_modules/yaml/dist/log.js +17 -0
- package/node_modules/yaml/dist/nodes/Alias.d.ts +28 -0
- package/node_modules/yaml/dist/nodes/Alias.js +103 -0
- package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/node_modules/yaml/dist/nodes/Node.d.ts +47 -0
- package/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/node_modules/yaml/dist/nodes/Pair.d.ts +21 -0
- package/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +42 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +106 -0
- package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
- package/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/node_modules/yaml/dist/nodes/toJS.d.ts +27 -0
- package/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/node_modules/yaml/dist/options.d.ts +338 -0
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/yaml/dist/parse/cst.d.ts +108 -0
- package/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/node_modules/yaml/dist/parse/lexer.js +719 -0
- package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/node_modules/yaml/dist/parse/parser.js +958 -0
- package/node_modules/yaml/dist/public-api.d.ts +43 -0
- package/node_modules/yaml/dist/public-api.js +104 -0
- package/node_modules/yaml/dist/schema/Schema.d.ts +18 -0
- package/node_modules/yaml/dist/schema/Schema.js +40 -0
- package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/node_modules/yaml/dist/schema/tags.d.ts +40 -0
- package/node_modules/yaml/dist/schema/tags.js +86 -0
- package/node_modules/yaml/dist/schema/types.d.ts +90 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +68 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +28 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +39 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
- package/node_modules/yaml/dist/stringify/stringify.js +127 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +145 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +26 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
- package/node_modules/yaml/dist/stringify/stringifyString.js +330 -0
- package/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/node_modules/yaml/dist/test-events.js +134 -0
- package/node_modules/yaml/dist/util.d.ts +12 -0
- package/node_modules/yaml/dist/util.js +28 -0
- package/node_modules/yaml/dist/visit.d.ts +102 -0
- package/node_modules/yaml/dist/visit.js +236 -0
- package/node_modules/yaml/package.json +96 -0
- package/node_modules/yaml/util.js +2 -0
- package/package.json +7 -3
- package/server.js +50 -23
- package/node_modules/path-to-regexp/History.md +0 -36
- /package/node_modules/{encodeurl → send/node_modules/encodeurl}/HISTORY.md +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "finalhandler",
|
|
3
3
|
"description": "Node.js final http responder",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.1",
|
|
5
5
|
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "pillarjs/finalhandler",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"debug": "2.6.9",
|
|
10
|
-
"encodeurl": "~
|
|
10
|
+
"encodeurl": "~2.0.0",
|
|
11
11
|
"escape-html": "~1.0.3",
|
|
12
12
|
"on-finished": "2.4.1",
|
|
13
13
|
"parseurl": "~1.3.3",
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"eslint": "7.32.0",
|
|
19
19
|
"eslint-config-standard": "14.1.1",
|
|
20
|
-
"eslint-plugin-import": "2.
|
|
20
|
+
"eslint-plugin-import": "2.26.0",
|
|
21
21
|
"eslint-plugin-markdown": "2.2.1",
|
|
22
22
|
"eslint-plugin-node": "11.1.0",
|
|
23
23
|
"eslint-plugin-promise": "5.2.0",
|
|
24
24
|
"eslint-plugin-standard": "4.1.0",
|
|
25
|
-
"mocha": "
|
|
25
|
+
"mocha": "10.0.0",
|
|
26
26
|
"nyc": "15.1.0",
|
|
27
27
|
"readable-stream": "2.3.6",
|
|
28
28
|
"safe-buffer": "5.2.1",
|
|
29
|
-
"supertest": "6.2.
|
|
29
|
+
"supertest": "6.2.4"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"LICENSE",
|
|
@@ -39,8 +39,9 @@
|
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"lint": "eslint .",
|
|
42
|
-
"test": "mocha --reporter spec --
|
|
42
|
+
"test": "mocha --reporter spec --check-leaks test/",
|
|
43
43
|
"test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
|
|
44
|
-
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
|
44
|
+
"test-cov": "nyc --reporter=html --reporter=text npm test",
|
|
45
|
+
"test-inspect": "mocha --reporter spec --inspect --inspect-brk test/"
|
|
45
46
|
}
|
|
46
47
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# get-fqdn
|
|
2
|
+
|
|
3
|
+
[](https://github.com/forwardemail/get-fqdn/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/sindresorhus/xo)
|
|
5
|
+
[](https://github.com/prettier/prettier)
|
|
6
|
+
[](https://lass.js.org)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](https://npm.im/get-fqdn)
|
|
9
|
+
|
|
10
|
+
> Lookup the fully qualified domain name ("FQDN") of the current server's IP (default) or a custom IP. 90x faster than `hostname -f` and works with Node v14+.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Table of Contents
|
|
14
|
+
|
|
15
|
+
* [Install](#install)
|
|
16
|
+
* [Usage](#usage)
|
|
17
|
+
* [Performance](#performance)
|
|
18
|
+
* [Contributors](#contributors)
|
|
19
|
+
* [License](#license)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
[npm][]:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
npm install get-fqdn
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
const getFQDN = require('get-fqdn');
|
|
35
|
+
|
|
36
|
+
// async/await usage
|
|
37
|
+
(async () => {
|
|
38
|
+
try {
|
|
39
|
+
const fqdn = await getFQDN();
|
|
40
|
+
console.log('fqdn', fqdn);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
console.error(err);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// then/catch usage
|
|
47
|
+
getFQDN().then(fqdn => console.log('fqdn', fqdn)).catch(console.error);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Note that you can also pass a custom IP:
|
|
51
|
+
|
|
52
|
+
```js
|
|
53
|
+
const fqdn = await getFQDN('1.1.1.1');
|
|
54
|
+
console.log('fqdn', fqdn);
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## Performance
|
|
59
|
+
|
|
60
|
+
This package runs approximately 90x faster than the alternative of using `hostname -f`.
|
|
61
|
+
|
|
62
|
+
It was built to ensure that [ForwardEmail.net](https://forwardemail.net) is as optimized as possible.
|
|
63
|
+
|
|
64
|
+
Others packages [were written in CoffeeScript](https://github.com/CliffS/fqdn-promise/blob/master/src/fqdn.coffee), used [deasync](https://github.com/rsrdesarrollo/node-fqdn/blob/master/index.js), or used the [hostname -f](https://github.com/fatelei/js-fqdn/blob/ffec496afb07559fb64dc5e6b78b50c6339d78c5/lib/fqdn.js) approach (also see the [fqdn][] package that uses the wrong approach too).
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## Contributors
|
|
68
|
+
|
|
69
|
+
| Name | Website |
|
|
70
|
+
| -------------- | -------------------------- |
|
|
71
|
+
| **Nick Baugh** | <http://niftylettuce.com/> |
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
##
|
|
80
|
+
|
|
81
|
+
[npm]: https://www.npmjs.com/
|
|
82
|
+
|
|
83
|
+
[fqdn]: https://www.npmjs.com/package/fqdn
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const os = require('node:os');
|
|
2
|
+
const dns = require('node:dns');
|
|
3
|
+
|
|
4
|
+
async function getFQDN(ip) {
|
|
5
|
+
if (ip) {
|
|
6
|
+
const { hostname } = await dns.promises.lookupService(ip, 0);
|
|
7
|
+
return hostname;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { address } = await dns.promises.lookup(os.hostname(), {
|
|
11
|
+
hints: dns.ADDRCONFIG
|
|
12
|
+
});
|
|
13
|
+
const { hostname } = await dns.promises.lookupService(address, 0);
|
|
14
|
+
return hostname;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
module.exports = getFQDN;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "get-fqdn",
|
|
3
|
+
"description": "Lookup the fully qualified domain name (\"FQDN\") of the current server's IP (default) or a custom IP. 90x faster than `hostname -f` and works with Node v6.4+.",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/forwardemail/get-fqdn/issues",
|
|
8
|
+
"email": "niftylettuce@gmail.com"
|
|
9
|
+
},
|
|
10
|
+
"contributors": [
|
|
11
|
+
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)"
|
|
12
|
+
],
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@commitlint/cli": "^17.4.2",
|
|
15
|
+
"@commitlint/config-conventional": "^17.4.2",
|
|
16
|
+
"ava": "^5.1.0",
|
|
17
|
+
"cross-env": "^7.0.3",
|
|
18
|
+
"eslint": "^8.31.0",
|
|
19
|
+
"eslint-config-xo-lass": "^2.0.1",
|
|
20
|
+
"fixpack": "^4.0.0",
|
|
21
|
+
"husky": "^8.0.3",
|
|
22
|
+
"is-ci": "^3.0.1",
|
|
23
|
+
"lint-staged": "^13.1.0",
|
|
24
|
+
"nyc": "^15.1.0",
|
|
25
|
+
"remark-cli": "^11.0.0",
|
|
26
|
+
"remark-preset-github": "^4.0.4",
|
|
27
|
+
"rimraf": "^4.0.4",
|
|
28
|
+
"xo": "^0.53.1"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=14"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"index.js"
|
|
35
|
+
],
|
|
36
|
+
"homepage": "https://github.com/forwardemail/get-fqdn",
|
|
37
|
+
"keywords": [
|
|
38
|
+
"address",
|
|
39
|
+
"dns",
|
|
40
|
+
"domain",
|
|
41
|
+
"domains",
|
|
42
|
+
"fetch",
|
|
43
|
+
"fqdn",
|
|
44
|
+
"fully",
|
|
45
|
+
"get",
|
|
46
|
+
"host",
|
|
47
|
+
"hostname",
|
|
48
|
+
"hostnames",
|
|
49
|
+
"ip",
|
|
50
|
+
"ipv4",
|
|
51
|
+
"ipv6",
|
|
52
|
+
"lookup",
|
|
53
|
+
"machine",
|
|
54
|
+
"name",
|
|
55
|
+
"os",
|
|
56
|
+
"qualifie",
|
|
57
|
+
"qualified",
|
|
58
|
+
"qualify"
|
|
59
|
+
],
|
|
60
|
+
"license": "MIT",
|
|
61
|
+
"main": "index.js",
|
|
62
|
+
"repository": {
|
|
63
|
+
"type": "git",
|
|
64
|
+
"url": "https://github.com/forwardemail/get-fqdn"
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"lint": "xo --fix && remark . -qfo && fixpack",
|
|
68
|
+
"prepare": "husky install",
|
|
69
|
+
"pretest": "npm run lint",
|
|
70
|
+
"test": "npm run test-coverage",
|
|
71
|
+
"test-coverage": "cross-env NODE_ENV=test nyc ava"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [v2.15.1](https://github.com/inspect-js/is-core-module/compare/v2.15.0...v2.15.1) - 2024-08-21
|
|
9
|
+
|
|
10
|
+
### Commits
|
|
11
|
+
|
|
12
|
+
- [Tests] add `process.getBuiltinModule` tests [`28c7791`](https://github.com/inspect-js/is-core-module/commit/28c7791c196d58c64cfdf638b7e68ed1b62a4da0)
|
|
13
|
+
- [Fix] `test/mock_loader` is no longer exposed as of v22.7 [`68b08b0`](https://github.com/inspect-js/is-core-module/commit/68b08b0d7963447dbffa5142e8810dca550383af)
|
|
14
|
+
- [Tests] replace `aud` with `npm audit` [`32f8060`](https://github.com/inspect-js/is-core-module/commit/32f806026dac14f9016be4401a643851240c76b9)
|
|
15
|
+
- [Dev Deps] update `mock-property` [`f7d3c8f`](https://github.com/inspect-js/is-core-module/commit/f7d3c8f01e922be49621683eb41477c4f50522e1)
|
|
16
|
+
- [Dev Deps] add missing peer dep [`eaee885`](https://github.com/inspect-js/is-core-module/commit/eaee885b67238819e9c8ed5bd2098766e1d05331)
|
|
17
|
+
|
|
8
18
|
## [v2.15.0](https://github.com/inspect-js/is-core-module/compare/v2.14.0...v2.15.0) - 2024-07-17
|
|
9
19
|
|
|
10
20
|
### Commits
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
"node:sys": [">= 14.18 && < 15", ">= 16"],
|
|
118
118
|
"test/reporters": ">= 19.9 && < 20.2",
|
|
119
119
|
"node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"],
|
|
120
|
-
"test/mock_loader": ">= 22.3",
|
|
121
|
-
"node:test/mock_loader": ">= 22.3",
|
|
120
|
+
"test/mock_loader": ">= 22.3 && < 22.7",
|
|
121
|
+
"node:test/mock_loader": ">= 22.3 && < 22.7",
|
|
122
122
|
"node:test": [">= 16.17 && < 17", ">= 18"],
|
|
123
123
|
"timers": true,
|
|
124
124
|
"node:timers": [">= 14.18 && < 15", ">= 16"],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "is-core-module",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.1",
|
|
4
4
|
"description": "Is this specifier a node.js core module?",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"pretest": "npm run lint",
|
|
17
17
|
"tests-only": "nyc tape 'test/**/*.js'",
|
|
18
18
|
"test": "npm run tests-only",
|
|
19
|
-
"posttest": "
|
|
19
|
+
"posttest": "npx npm@'>=10.2' audit --production",
|
|
20
20
|
"version": "auto-changelog && git add CHANGELOG.md",
|
|
21
21
|
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
|
22
22
|
},
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@ljharb/eslint-config": "^21.1.1",
|
|
49
|
-
"aud": "^2.0.4",
|
|
50
49
|
"auto-changelog": "^2.4.0",
|
|
50
|
+
"encoding": "^0.1.13",
|
|
51
51
|
"eslint": "=8.8.0",
|
|
52
52
|
"in-publish": "^2.0.1",
|
|
53
|
-
"mock-property": "^1.0
|
|
53
|
+
"mock-property": "^1.1.0",
|
|
54
54
|
"npmignore": "^0.3.1",
|
|
55
55
|
"nyc": "^10.3.2",
|
|
56
56
|
"safe-publish-latest": "^2.0.0",
|
|
@@ -72,7 +72,8 @@ test('core modules', function (t) {
|
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
t.test('core via builtinModules list', { skip: !data.module }, function (st) {
|
|
75
|
-
var
|
|
75
|
+
var Module = require('module');
|
|
76
|
+
var libs = Module.builtinModules;
|
|
76
77
|
if (!libs) {
|
|
77
78
|
st.skip('module.builtinModules does not exist');
|
|
78
79
|
} else {
|
|
@@ -96,10 +97,24 @@ test('core modules', function (t) {
|
|
|
96
97
|
var mod = libs[i];
|
|
97
98
|
if (excludeList.indexOf(mod) === -1) {
|
|
98
99
|
st.ok(data[mod], mod + ' is a core module');
|
|
100
|
+
|
|
101
|
+
if (Module.isBuiltin) {
|
|
102
|
+
st.ok(Module.isBuiltin(mod), 'module.isBuiltin(' + mod + ') is true');
|
|
103
|
+
}
|
|
104
|
+
|
|
99
105
|
st.doesNotThrow(
|
|
100
106
|
function () { require(mod); }, // eslint-disable-line no-loop-func
|
|
101
107
|
'requiring ' + mod + ' does not throw'
|
|
102
108
|
);
|
|
109
|
+
|
|
110
|
+
if (process.getBuiltinModule) {
|
|
111
|
+
st.equal(
|
|
112
|
+
process.getBuiltinModule(mod),
|
|
113
|
+
require(mod),
|
|
114
|
+
'process.getBuiltinModule(' + mod + ') === require(' + mod + ')'
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
103
118
|
if (mod.slice(0, 5) !== 'node:') {
|
|
104
119
|
if (supportsNodePrefix) {
|
|
105
120
|
st.doesNotThrow(
|
|
@@ -116,6 +131,7 @@ test('core modules', function (t) {
|
|
|
116
131
|
}
|
|
117
132
|
}
|
|
118
133
|
}
|
|
134
|
+
|
|
119
135
|
st.end();
|
|
120
136
|
});
|
|
121
137
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# merge-descriptors
|
|
2
2
|
|
|
3
3
|
[![NPM Version][npm-image]][npm-url]
|
|
4
4
|
[![NPM Downloads][downloads-image]][downloads-url]
|
|
@@ -27,12 +27,13 @@ animal.name === 'jon'
|
|
|
27
27
|
|
|
28
28
|
### merge(destination, source)
|
|
29
29
|
|
|
30
|
-
Redefines `destination`'s descriptors with `source`'s.
|
|
30
|
+
Redefines `destination`'s descriptors with `source`'s. The return value is the
|
|
31
|
+
`destination` object.
|
|
31
32
|
|
|
32
33
|
### merge(destination, source, false)
|
|
33
34
|
|
|
34
35
|
Defines `source`'s descriptors on `destination` if `destination` does not have
|
|
35
|
-
a descriptor by the same name.
|
|
36
|
+
a descriptor by the same name. The return value is the `destination` object.
|
|
36
37
|
|
|
37
38
|
## License
|
|
38
39
|
|
|
@@ -31,7 +31,7 @@ var hasOwnProperty = Object.prototype.hasOwnProperty
|
|
|
31
31
|
* @public
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
|
-
function merge(dest, src, redefine) {
|
|
34
|
+
function merge (dest, src, redefine) {
|
|
35
35
|
if (!dest) {
|
|
36
36
|
throw new TypeError('argument dest is required')
|
|
37
37
|
}
|
|
@@ -45,9 +45,9 @@ function merge(dest, src, redefine) {
|
|
|
45
45
|
redefine = true
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName(name) {
|
|
48
|
+
Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName (name) {
|
|
49
49
|
if (!redefine && hasOwnProperty.call(dest, name)) {
|
|
50
|
-
// Skip
|
|
50
|
+
// Skip descriptor
|
|
51
51
|
return
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "merge-descriptors",
|
|
3
3
|
"description": "Merge objects using descriptors",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jonathan Ong",
|
|
7
7
|
"email": "me@jongleberry.com",
|
|
@@ -13,10 +13,17 @@
|
|
|
13
13
|
"Mike Grabowski <grabbou@gmail.com>"
|
|
14
14
|
],
|
|
15
15
|
"license": "MIT",
|
|
16
|
-
"repository": "
|
|
16
|
+
"repository": "sindresorhus/merge-descriptors",
|
|
17
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
17
18
|
"devDependencies": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
19
|
+
"eslint": "5.9.0",
|
|
20
|
+
"eslint-config-standard": "12.0.0",
|
|
21
|
+
"eslint-plugin-import": "2.14.0",
|
|
22
|
+
"eslint-plugin-node": "7.0.1",
|
|
23
|
+
"eslint-plugin-promise": "4.0.1",
|
|
24
|
+
"eslint-plugin-standard": "4.0.0",
|
|
25
|
+
"mocha": "5.2.0",
|
|
26
|
+
"nyc": "13.1.0"
|
|
20
27
|
},
|
|
21
28
|
"files": [
|
|
22
29
|
"HISTORY.md",
|
|
@@ -25,8 +32,8 @@
|
|
|
25
32
|
"index.js"
|
|
26
33
|
],
|
|
27
34
|
"scripts": {
|
|
28
|
-
"
|
|
29
|
-
"test
|
|
30
|
-
"test-cov": "
|
|
35
|
+
"lint": "eslint .",
|
|
36
|
+
"test": "mocha test/",
|
|
37
|
+
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
|
31
38
|
}
|
|
32
39
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Expose `
|
|
2
|
+
* Expose `pathToRegexp`.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
module.exports =
|
|
5
|
+
module.exports = pathToRegexp;
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Match matching groups in a regular expression.
|
|
9
9
|
*/
|
|
10
|
-
var MATCHING_GROUP_REGEXP =
|
|
10
|
+
var MATCHING_GROUP_REGEXP = /\\.|\((?:\?<(.*?)>)?(?!\?)/g;
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Normalize the given path string,
|
|
@@ -25,22 +25,27 @@ var MATCHING_GROUP_REGEXP = /\((?!\?)/g;
|
|
|
25
25
|
* @api private
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
-
function
|
|
28
|
+
function pathToRegexp(path, keys, options) {
|
|
29
29
|
options = options || {};
|
|
30
30
|
keys = keys || [];
|
|
31
31
|
var strict = options.strict;
|
|
32
32
|
var end = options.end !== false;
|
|
33
33
|
var flags = options.sensitive ? '' : 'i';
|
|
34
|
+
var lookahead = options.lookahead !== false;
|
|
34
35
|
var extraOffset = 0;
|
|
35
36
|
var keysOffset = keys.length;
|
|
36
37
|
var i = 0;
|
|
37
38
|
var name = 0;
|
|
39
|
+
var pos = 0;
|
|
40
|
+
var backtrack = '';
|
|
38
41
|
var m;
|
|
39
42
|
|
|
40
43
|
if (path instanceof RegExp) {
|
|
41
44
|
while (m = MATCHING_GROUP_REGEXP.exec(path.source)) {
|
|
45
|
+
if (m[0][0] === '\\') continue;
|
|
46
|
+
|
|
42
47
|
keys.push({
|
|
43
|
-
name: name++,
|
|
48
|
+
name: m[1] || name++,
|
|
44
49
|
optional: false,
|
|
45
50
|
offset: m.index
|
|
46
51
|
});
|
|
@@ -54,20 +59,47 @@ function pathtoRegexp(path, keys, options) {
|
|
|
54
59
|
// the same keys and options instance into every generation to get
|
|
55
60
|
// consistent matching groups before we join the sources together.
|
|
56
61
|
path = path.map(function (value) {
|
|
57
|
-
return
|
|
62
|
+
return pathToRegexp(value, keys, options).source;
|
|
58
63
|
});
|
|
59
64
|
|
|
60
|
-
return new RegExp(
|
|
65
|
+
return new RegExp(path.join('|'), flags);
|
|
61
66
|
}
|
|
62
67
|
|
|
63
|
-
path =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
path = path.replace(
|
|
69
|
+
/\\.|(\/)?(\.)?:(\w+)(\(.*?\))?(\*)?(\?)?|[.*]|\/\(/g,
|
|
70
|
+
function (match, slash, format, key, capture, star, optional, offset) {
|
|
71
|
+
pos = offset + match.length;
|
|
72
|
+
|
|
73
|
+
if (match[0] === '\\') {
|
|
74
|
+
backtrack += match;
|
|
75
|
+
return match;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (match === '.') {
|
|
79
|
+
backtrack += '\\.';
|
|
80
|
+
extraOffset += 1;
|
|
81
|
+
return '\\.';
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
backtrack = slash || format ? '' : path.slice(pos, offset);
|
|
85
|
+
|
|
86
|
+
if (match === '*') {
|
|
87
|
+
extraOffset += 3;
|
|
88
|
+
return '(.*)';
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (match === '/(') {
|
|
92
|
+
backtrack += '/';
|
|
93
|
+
extraOffset += 2;
|
|
94
|
+
return '/(?:';
|
|
95
|
+
}
|
|
96
|
+
|
|
67
97
|
slash = slash || '';
|
|
68
|
-
format = format
|
|
69
|
-
capture = capture || '([^\\/' + format + ']+?)';
|
|
98
|
+
format = format ? '\\.' : '';
|
|
70
99
|
optional = optional || '';
|
|
100
|
+
capture = capture ?
|
|
101
|
+
capture.replace(/\\.|\*/, function (m) { return m === '*' ? '(.*)' : m; }) :
|
|
102
|
+
(backtrack ? '((?:(?!/|' + backtrack + ').)+?)' : '([^/' + format + ']+?)');
|
|
71
103
|
|
|
72
104
|
keys.push({
|
|
73
105
|
name: key,
|
|
@@ -75,41 +107,20 @@ function pathtoRegexp(path, keys, options) {
|
|
|
75
107
|
offset: offset + extraOffset
|
|
76
108
|
});
|
|
77
109
|
|
|
78
|
-
var result = ''
|
|
79
|
-
+
|
|
80
|
-
+ '(?:'
|
|
81
|
-
+ format + (optional ? slash : '') + capture
|
|
82
|
-
+ (star ? '((?:[\\/' + format + '].+?)?)' : '')
|
|
110
|
+
var result = '(?:'
|
|
111
|
+
+ format + slash + capture
|
|
112
|
+
+ (star ? '((?:[/' + format + '].+?)?)' : '')
|
|
83
113
|
+ ')'
|
|
84
114
|
+ optional;
|
|
85
115
|
|
|
86
116
|
extraOffset += result.length - match.length;
|
|
87
117
|
|
|
88
118
|
return result;
|
|
89
|
-
})
|
|
90
|
-
.replace(/\*/g, function (star, index) {
|
|
91
|
-
var len = keys.length
|
|
92
|
-
|
|
93
|
-
while (len-- > keysOffset && keys[len].offset > index) {
|
|
94
|
-
keys[len].offset += 3; // Replacement length minus asterisk length.
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return '(.*)';
|
|
98
119
|
});
|
|
99
120
|
|
|
100
121
|
// This is a workaround for handling unnamed matching groups.
|
|
101
122
|
while (m = MATCHING_GROUP_REGEXP.exec(path)) {
|
|
102
|
-
|
|
103
|
-
var index = m.index;
|
|
104
|
-
|
|
105
|
-
while (path.charAt(--index) === '\\') {
|
|
106
|
-
escapeCount++;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// It's possible to escape the bracket.
|
|
110
|
-
if (escapeCount % 2 === 1) {
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
123
|
+
if (m[0][0] === '\\') continue;
|
|
113
124
|
|
|
114
125
|
if (keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) {
|
|
115
126
|
keys.splice(keysOffset + i, 0, {
|
|
@@ -122,8 +133,14 @@ function pathtoRegexp(path, keys, options) {
|
|
|
122
133
|
i++;
|
|
123
134
|
}
|
|
124
135
|
|
|
136
|
+
path += strict ? '' : path[path.length - 1] === '/' ? '?' : '/?';
|
|
137
|
+
|
|
125
138
|
// If the path is non-ending, match until the end or a slash.
|
|
126
|
-
|
|
139
|
+
if (end) {
|
|
140
|
+
path += '$';
|
|
141
|
+
} else if (path[path.length - 1] !== '/') {
|
|
142
|
+
path += lookahead ? '(?=/|$)' : '(?:/|$)';
|
|
143
|
+
}
|
|
127
144
|
|
|
128
|
-
return new RegExp(path, flags);
|
|
145
|
+
return new RegExp('^' + path, flags);
|
|
129
146
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "path-to-regexp",
|
|
3
3
|
"description": "Express style path to RegExp utility",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.10",
|
|
5
5
|
"files": [
|
|
6
6
|
"index.js",
|
|
7
7
|
"LICENSE"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
|
-
"url": "https://github.com/
|
|
24
|
+
"url": "https://github.com/pillarjs/path-to-regexp.git"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"mocha": "^1.17.1",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"id-length": [2, { "min": 1, "max": 25, "properties": "never" }],
|
|
15
15
|
"indent": [2, 4],
|
|
16
16
|
"max-lines-per-function": [2, { "max": 150 }],
|
|
17
|
-
"max-params": [2,
|
|
18
|
-
"max-statements": [2,
|
|
17
|
+
"max-params": [2, 18],
|
|
18
|
+
"max-statements": [2, 100],
|
|
19
19
|
"multiline-comment-style": 0,
|
|
20
20
|
"no-continue": 1,
|
|
21
21
|
"no-magic-numbers": 0,
|