@emulsify/cli 1.11.4 → 1.12.1
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/dist/index.js +1 -1
- package/dist/node_modules/.package-lock.json +34 -24
- package/dist/node_modules/@types/node/README.md +2 -2
- package/dist/node_modules/@types/node/assert.d.ts +23 -1
- package/dist/node_modules/@types/node/async_hooks.d.ts +64 -0
- package/dist/node_modules/@types/node/buffer.buffer.d.ts +124 -38
- package/dist/node_modules/@types/node/buffer.d.ts +19 -17
- package/dist/node_modules/@types/node/child_process.d.ts +88 -161
- package/dist/node_modules/@types/node/cluster.d.ts +5 -6
- package/dist/node_modules/@types/node/constants.d.ts +14 -12
- package/dist/node_modules/@types/node/crypto.d.ts +237 -166
- package/dist/node_modules/@types/node/dgram.d.ts +15 -14
- package/dist/node_modules/@types/node/diagnostics_channel.d.ts +39 -15
- package/dist/node_modules/@types/node/dns/promises.d.ts +11 -9
- package/dist/node_modules/@types/node/dns.d.ts +28 -21
- package/dist/node_modules/@types/node/events.d.ts +81 -35
- package/dist/node_modules/@types/node/fs/promises.d.ts +61 -36
- package/dist/node_modules/@types/node/fs.d.ts +251 -193
- package/dist/node_modules/@types/node/globals.d.ts +146 -442
- package/dist/node_modules/@types/node/globals.typedarray.d.ts +17 -0
- package/dist/node_modules/@types/node/http.d.ts +136 -31
- package/dist/node_modules/@types/node/http2.d.ts +102 -26
- package/dist/node_modules/@types/node/https.d.ts +94 -60
- package/dist/node_modules/@types/node/index.d.ts +5 -3
- package/dist/node_modules/@types/node/{inspector.d.ts → inspector.generated.d.ts} +272 -2
- package/dist/node_modules/@types/node/module.d.ts +362 -138
- package/dist/node_modules/@types/node/net.d.ts +27 -20
- package/dist/node_modules/@types/node/os.d.ts +14 -3
- package/dist/node_modules/@types/node/package.json +4 -89
- package/dist/node_modules/@types/node/perf_hooks.d.ts +37 -10
- package/dist/node_modules/@types/node/process.d.ts +108 -35
- package/dist/node_modules/@types/node/querystring.d.ts +2 -3
- package/dist/node_modules/@types/node/readline/promises.d.ts +1 -1
- package/dist/node_modules/@types/node/stream/consumers.d.ts +33 -7
- package/dist/node_modules/@types/node/stream/web.d.ts +13 -4
- package/dist/node_modules/@types/node/stream.d.ts +963 -1014
- package/dist/node_modules/@types/node/string_decoder.d.ts +2 -2
- package/dist/node_modules/@types/node/test.d.ts +1504 -1655
- package/dist/node_modules/@types/node/timers/promises.d.ts +28 -17
- package/dist/node_modules/@types/node/timers.d.ts +157 -111
- package/dist/node_modules/@types/node/tls.d.ts +105 -67
- package/dist/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +120 -37
- package/dist/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +15 -0
- package/dist/node_modules/@types/node/ts5.6/index.d.ts +5 -3
- package/dist/node_modules/@types/node/url.d.ts +10 -1
- package/dist/node_modules/@types/node/util.d.ts +28 -3
- package/dist/node_modules/@types/node/v8.d.ts +6 -5
- package/dist/node_modules/@types/node/vm.d.ts +147 -68
- package/dist/node_modules/@types/node/wasi.d.ts +1 -1
- package/dist/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/dist/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/dist/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/dist/node_modules/@types/node/web-globals/fetch.d.ts +46 -0
- package/dist/node_modules/@types/node/worker_threads.d.ts +60 -39
- package/dist/node_modules/@types/node/zlib.d.ts +21 -20
- package/dist/node_modules/debug/package.json +7 -3
- package/dist/node_modules/debug/src/browser.js +2 -1
- package/dist/node_modules/debug/src/common.js +57 -39
- package/dist/node_modules/fast-uri/.github/dependabot.yml +1 -1
- package/dist/node_modules/fast-uri/.github/workflows/ci.yml +81 -3
- package/dist/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +6 -2
- package/dist/node_modules/fast-uri/LICENSE +3 -1
- package/dist/node_modules/fast-uri/README.md +55 -37
- package/dist/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
- package/dist/node_modules/fast-uri/benchmark/equal.mjs +51 -0
- package/dist/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
- package/dist/node_modules/fast-uri/benchmark/package.json +17 -0
- package/dist/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
- package/dist/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
- package/dist/node_modules/fast-uri/eslint.config.js +6 -0
- package/dist/node_modules/fast-uri/index.js +98 -61
- package/dist/node_modules/fast-uri/lib/schemes.js +160 -81
- package/dist/node_modules/fast-uri/lib/utils.js +217 -123
- package/dist/node_modules/fast-uri/package.json +44 -14
- package/dist/node_modules/fast-uri/test/ajv.test.js +7 -3
- package/dist/node_modules/fast-uri/test/equal.test.js +7 -2
- package/dist/node_modules/fast-uri/test/fixtures/uri-js-parse.json +501 -0
- package/dist/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
- package/dist/node_modules/fast-uri/test/parse.test.js +31 -31
- package/dist/node_modules/fast-uri/test/resolve.test.js +52 -49
- package/dist/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
- package/dist/node_modules/fast-uri/test/serialize.test.js +55 -47
- package/dist/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
- package/dist/node_modules/fast-uri/test/uri-js.test.js +230 -230
- package/dist/node_modules/fast-uri/test/util.test.js +23 -8
- package/dist/node_modules/fast-uri/tsconfig.json +9 -0
- package/dist/node_modules/fast-uri/types/index.d.ts +16 -9
- package/dist/node_modules/fast-uri/types/index.test-d.ts +9 -9
- package/dist/node_modules/fs-extra/LICENSE +1 -1
- package/dist/node_modules/fs-extra/README.md +3 -1
- package/dist/node_modules/fs-extra/lib/copy/copy-sync.js +11 -1
- package/dist/node_modules/fs-extra/lib/copy/copy.js +13 -15
- package/dist/node_modules/fs-extra/lib/fs/index.js +6 -0
- package/dist/node_modules/fs-extra/lib/util/async.js +29 -0
- package/dist/node_modules/fs-extra/lib/util/stat.js +2 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/jsonfile/README.md +1 -1
- package/dist/node_modules/jsonfile/index.js +3 -3
- package/dist/node_modules/jsonfile/package.json +1 -1
- package/dist/node_modules/simple-git/dist/cjs/index.js +235 -235
- package/dist/node_modules/simple-git/dist/cjs/index.js.map +3 -3
- package/dist/node_modules/simple-git/dist/esm/index.js +229 -233
- package/dist/node_modules/simple-git/dist/esm/index.js.map +3 -3
- package/dist/node_modules/simple-git/dist/src/lib/git-logger.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-branch.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/plugins/error-detection.plugin.d.ts +2 -3
- package/dist/node_modules/simple-git/dist/src/lib/plugins/simple-git-plugin.d.ts +2 -3
- package/dist/node_modules/simple-git/dist/src/lib/plugins/spawn-options-plugin.d.ts +0 -1
- package/dist/node_modules/simple-git/dist/src/lib/runners/scheduler.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/runners/tasks-pending-queue.d.ts +2 -2
- package/dist/node_modules/simple-git/dist/src/lib/tasks/apply-patch.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/clean.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/clone.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/log.d.ts +3 -3
- package/dist/node_modules/simple-git/dist/src/lib/tasks/push.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/remote.d.ts +4 -2
- package/dist/node_modules/simple-git/dist/src/lib/tasks/reset.d.ts +3 -3
- package/dist/node_modules/simple-git/dist/src/lib/tasks/stash-list.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/task.d.ts +2 -2
- package/dist/node_modules/simple-git/dist/src/lib/types/handlers.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/types/index.d.ts +9 -13
- package/dist/node_modules/simple-git/dist/src/lib/types/tasks.d.ts +5 -6
- package/dist/node_modules/simple-git/dist/src/lib/utils/argument-filters.d.ts +5 -7
- package/dist/node_modules/simple-git/dist/src/lib/utils/git-output-streams.d.ts +0 -1
- package/dist/node_modules/simple-git/dist/src/lib/utils/line-parser.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/utils/task-options.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/utils/util.d.ts +11 -10
- package/dist/node_modules/simple-git/package.json +6 -6
- package/dist/node_modules/simple-git/readme.md +8 -0
- package/dist/node_modules/undici-types/dispatcher.d.ts +1 -0
- package/dist/node_modules/undici-types/eventsource.d.ts +0 -2
- package/dist/node_modules/undici-types/filereader.d.ts +1 -1
- package/dist/node_modules/undici-types/interceptors.d.ts +3 -1
- package/dist/node_modules/undici-types/package.json +1 -1
- package/dist/node_modules/undici-types/patch.d.ts +0 -38
- package/dist/node_modules/undici-types/readable.d.ts +5 -0
- package/dist/node_modules/undici-types/webidl.d.ts +6 -0
- package/dist/node_modules/undici-types/websocket.d.ts +0 -2
- package/dist/package-lock.json +912 -813
- package/dist/package.json +2 -2
- package/dist/util/getAvailableStarters.js +3 -3
- package/package.json +2 -2
- package/dist/node_modules/@types/node/dom-events.d.ts +0 -124
- package/dist/node_modules/fast-uri/benchmark.js +0 -105
- package/dist/node_modules/fast-uri/lib/scopedChars.js +0 -30
- package/dist/node_modules/fast-uri/test/.gitkeep +0 -0
- package/dist/node_modules/fast-uri/test/compatibility.test.js +0 -131
- package/dist/node_modules/jsonfile/CHANGELOG.md +0 -171
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const test = require('tape')
|
|
4
|
-
const
|
|
4
|
+
const fastURI = require('..')
|
|
5
5
|
|
|
6
6
|
test('URI parse', (t) => {
|
|
7
7
|
let components
|
|
8
8
|
|
|
9
9
|
// scheme
|
|
10
|
-
components =
|
|
10
|
+
components = fastURI.parse('uri:')
|
|
11
11
|
t.equal(components.error, undefined, 'scheme errors')
|
|
12
12
|
t.equal(components.scheme, 'uri', 'scheme')
|
|
13
13
|
// t.equal(components.authority, undefined, "authority");
|
|
@@ -19,7 +19,7 @@ test('URI parse', (t) => {
|
|
|
19
19
|
t.equal(components.fragment, undefined, 'fragment')
|
|
20
20
|
|
|
21
21
|
// userinfo
|
|
22
|
-
components =
|
|
22
|
+
components = fastURI.parse('//@')
|
|
23
23
|
t.equal(components.error, undefined, 'userinfo errors')
|
|
24
24
|
t.equal(components.scheme, undefined, 'scheme')
|
|
25
25
|
// t.equal(components.authority, "@", "authority");
|
|
@@ -31,7 +31,7 @@ test('URI parse', (t) => {
|
|
|
31
31
|
t.equal(components.fragment, undefined, 'fragment')
|
|
32
32
|
|
|
33
33
|
// host
|
|
34
|
-
components =
|
|
34
|
+
components = fastURI.parse('//')
|
|
35
35
|
t.equal(components.error, undefined, 'host errors')
|
|
36
36
|
t.equal(components.scheme, undefined, 'scheme')
|
|
37
37
|
// t.equal(components.authority, "", "authority");
|
|
@@ -43,7 +43,7 @@ test('URI parse', (t) => {
|
|
|
43
43
|
t.equal(components.fragment, undefined, 'fragment')
|
|
44
44
|
|
|
45
45
|
// port
|
|
46
|
-
components =
|
|
46
|
+
components = fastURI.parse('//:')
|
|
47
47
|
t.equal(components.error, undefined, 'port errors')
|
|
48
48
|
t.equal(components.scheme, undefined, 'scheme')
|
|
49
49
|
// t.equal(components.authority, ":", "authority");
|
|
@@ -55,7 +55,7 @@ test('URI parse', (t) => {
|
|
|
55
55
|
t.equal(components.fragment, undefined, 'fragment')
|
|
56
56
|
|
|
57
57
|
// path
|
|
58
|
-
components =
|
|
58
|
+
components = fastURI.parse('')
|
|
59
59
|
t.equal(components.error, undefined, 'path errors')
|
|
60
60
|
t.equal(components.scheme, undefined, 'scheme')
|
|
61
61
|
// t.equal(components.authority, undefined, "authority");
|
|
@@ -67,7 +67,7 @@ test('URI parse', (t) => {
|
|
|
67
67
|
t.equal(components.fragment, undefined, 'fragment')
|
|
68
68
|
|
|
69
69
|
// query
|
|
70
|
-
components =
|
|
70
|
+
components = fastURI.parse('?')
|
|
71
71
|
t.equal(components.error, undefined, 'query errors')
|
|
72
72
|
t.equal(components.scheme, undefined, 'scheme')
|
|
73
73
|
// t.equal(components.authority, undefined, "authority");
|
|
@@ -79,7 +79,7 @@ test('URI parse', (t) => {
|
|
|
79
79
|
t.equal(components.fragment, undefined, 'fragment')
|
|
80
80
|
|
|
81
81
|
// fragment
|
|
82
|
-
components =
|
|
82
|
+
components = fastURI.parse('#')
|
|
83
83
|
t.equal(components.error, undefined, 'fragment errors')
|
|
84
84
|
t.equal(components.scheme, undefined, 'scheme')
|
|
85
85
|
// t.equal(components.authority, undefined, "authority");
|
|
@@ -91,7 +91,7 @@ test('URI parse', (t) => {
|
|
|
91
91
|
t.equal(components.fragment, '', 'fragment')
|
|
92
92
|
|
|
93
93
|
// fragment with character tabulation
|
|
94
|
-
components =
|
|
94
|
+
components = fastURI.parse('#\t')
|
|
95
95
|
t.equal(components.error, undefined, 'path errors')
|
|
96
96
|
t.equal(components.scheme, undefined, 'scheme')
|
|
97
97
|
// t.equal(components.authority, undefined, "authority");
|
|
@@ -103,7 +103,7 @@ test('URI parse', (t) => {
|
|
|
103
103
|
t.equal(components.fragment, '%09', 'fragment')
|
|
104
104
|
|
|
105
105
|
// fragment with line feed
|
|
106
|
-
components =
|
|
106
|
+
components = fastURI.parse('#\n')
|
|
107
107
|
t.equal(components.error, undefined, 'path errors')
|
|
108
108
|
t.equal(components.scheme, undefined, 'scheme')
|
|
109
109
|
// t.equal(components.authority, undefined, "authority");
|
|
@@ -115,7 +115,7 @@ test('URI parse', (t) => {
|
|
|
115
115
|
t.equal(components.fragment, '%0A', 'fragment')
|
|
116
116
|
|
|
117
117
|
// fragment with line tabulation
|
|
118
|
-
components =
|
|
118
|
+
components = fastURI.parse('#\v')
|
|
119
119
|
t.equal(components.error, undefined, 'path errors')
|
|
120
120
|
t.equal(components.scheme, undefined, 'scheme')
|
|
121
121
|
// t.equal(components.authority, undefined, "authority");
|
|
@@ -127,7 +127,7 @@ test('URI parse', (t) => {
|
|
|
127
127
|
t.equal(components.fragment, '%0B', 'fragment')
|
|
128
128
|
|
|
129
129
|
// fragment with form feed
|
|
130
|
-
components =
|
|
130
|
+
components = fastURI.parse('#\f')
|
|
131
131
|
t.equal(components.error, undefined, 'path errors')
|
|
132
132
|
t.equal(components.scheme, undefined, 'scheme')
|
|
133
133
|
// t.equal(components.authority, undefined, "authority");
|
|
@@ -139,7 +139,7 @@ test('URI parse', (t) => {
|
|
|
139
139
|
t.equal(components.fragment, '%0C', 'fragment')
|
|
140
140
|
|
|
141
141
|
// fragment with carriage return
|
|
142
|
-
components =
|
|
142
|
+
components = fastURI.parse('#\r')
|
|
143
143
|
t.equal(components.error, undefined, 'path errors')
|
|
144
144
|
t.equal(components.scheme, undefined, 'scheme')
|
|
145
145
|
// t.equal(components.authority, undefined, "authority");
|
|
@@ -151,7 +151,7 @@ test('URI parse', (t) => {
|
|
|
151
151
|
t.equal(components.fragment, '%0D', 'fragment')
|
|
152
152
|
|
|
153
153
|
// all
|
|
154
|
-
components =
|
|
154
|
+
components = fastURI.parse('uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body')
|
|
155
155
|
t.equal(components.error, undefined, 'all errors')
|
|
156
156
|
t.equal(components.scheme, 'uri', 'scheme')
|
|
157
157
|
// t.equal(components.authority, "user:pass@example.com:123", "authority");
|
|
@@ -163,7 +163,7 @@ test('URI parse', (t) => {
|
|
|
163
163
|
t.equal(components.fragment, 'body', 'fragment')
|
|
164
164
|
|
|
165
165
|
// IPv4address
|
|
166
|
-
components =
|
|
166
|
+
components = fastURI.parse('//10.10.10.10')
|
|
167
167
|
t.equal(components.error, undefined, 'IPv4address errors')
|
|
168
168
|
t.equal(components.scheme, undefined, 'scheme')
|
|
169
169
|
t.equal(components.userinfo, undefined, 'userinfo')
|
|
@@ -174,7 +174,7 @@ test('URI parse', (t) => {
|
|
|
174
174
|
t.equal(components.fragment, undefined, 'fragment')
|
|
175
175
|
|
|
176
176
|
// IPv4address with unformated 0 stay as-is
|
|
177
|
-
components =
|
|
177
|
+
components = fastURI.parse('//10.10.000.10') // not valid as per https://datatracker.ietf.org/doc/html/rfc5954#section-4.1
|
|
178
178
|
t.equal(components.error, undefined, 'IPv4address errors')
|
|
179
179
|
t.equal(components.scheme, undefined, 'scheme')
|
|
180
180
|
t.equal(components.userinfo, undefined, 'userinfo')
|
|
@@ -183,7 +183,7 @@ test('URI parse', (t) => {
|
|
|
183
183
|
t.equal(components.path, '', 'path')
|
|
184
184
|
t.equal(components.query, undefined, 'query')
|
|
185
185
|
t.equal(components.fragment, undefined, 'fragment')
|
|
186
|
-
components =
|
|
186
|
+
components = fastURI.parse('//01.01.01.01') // not valid in URIs: https://datatracker.ietf.org/doc/html/rfc3986#section-7.4
|
|
187
187
|
t.equal(components.error, undefined, 'IPv4address errors')
|
|
188
188
|
t.equal(components.scheme, undefined, 'scheme')
|
|
189
189
|
t.equal(components.userinfo, undefined, 'userinfo')
|
|
@@ -194,7 +194,7 @@ test('URI parse', (t) => {
|
|
|
194
194
|
t.equal(components.fragment, undefined, 'fragment')
|
|
195
195
|
|
|
196
196
|
// IPv6address
|
|
197
|
-
components =
|
|
197
|
+
components = fastURI.parse('//[2001:db8::7]')
|
|
198
198
|
t.equal(components.error, undefined, 'IPv4address errors')
|
|
199
199
|
t.equal(components.scheme, undefined, 'scheme')
|
|
200
200
|
t.equal(components.userinfo, undefined, 'userinfo')
|
|
@@ -205,11 +205,11 @@ test('URI parse', (t) => {
|
|
|
205
205
|
t.equal(components.fragment, undefined, 'fragment')
|
|
206
206
|
|
|
207
207
|
// invalid IPv6
|
|
208
|
-
components =
|
|
208
|
+
components = fastURI.parse('//[2001:dbZ::7]')
|
|
209
209
|
t.equal(components.host, '[2001:dbz::7]')
|
|
210
210
|
|
|
211
211
|
// mixed IPv4address & IPv6address
|
|
212
|
-
components =
|
|
212
|
+
components = fastURI.parse('//[::ffff:129.144.52.38]')
|
|
213
213
|
t.equal(components.error, undefined, 'IPv4address errors')
|
|
214
214
|
t.equal(components.scheme, undefined, 'scheme')
|
|
215
215
|
t.equal(components.userinfo, undefined, 'userinfo')
|
|
@@ -220,7 +220,7 @@ test('URI parse', (t) => {
|
|
|
220
220
|
t.equal(components.fragment, undefined, 'fragment')
|
|
221
221
|
|
|
222
222
|
// mixed IPv4address & reg-name, example from terion-name (https://github.com/garycourt/uri-js/issues/4)
|
|
223
|
-
components =
|
|
223
|
+
components = fastURI.parse('uri://10.10.10.10.example.com/en/process')
|
|
224
224
|
t.equal(components.error, undefined, 'mixed errors')
|
|
225
225
|
t.equal(components.scheme, 'uri', 'scheme')
|
|
226
226
|
t.equal(components.userinfo, undefined, 'userinfo')
|
|
@@ -231,7 +231,7 @@ test('URI parse', (t) => {
|
|
|
231
231
|
t.equal(components.fragment, undefined, 'fragment')
|
|
232
232
|
|
|
233
233
|
// IPv6address, example from bkw (https://github.com/garycourt/uri-js/pull/16)
|
|
234
|
-
components =
|
|
234
|
+
components = fastURI.parse('//[2606:2800:220:1:248:1893:25c8:1946]/test')
|
|
235
235
|
t.equal(components.error, undefined, 'IPv6address errors')
|
|
236
236
|
t.equal(components.scheme, undefined, 'scheme')
|
|
237
237
|
t.equal(components.userinfo, undefined, 'userinfo')
|
|
@@ -242,7 +242,7 @@ test('URI parse', (t) => {
|
|
|
242
242
|
t.equal(components.fragment, undefined, 'fragment')
|
|
243
243
|
|
|
244
244
|
// IPv6address, example from RFC 5952
|
|
245
|
-
components =
|
|
245
|
+
components = fastURI.parse('//[2001:db8::1]:80')
|
|
246
246
|
t.equal(components.error, undefined, 'IPv6address errors')
|
|
247
247
|
t.equal(components.scheme, undefined, 'scheme')
|
|
248
248
|
t.equal(components.userinfo, undefined, 'userinfo')
|
|
@@ -253,7 +253,7 @@ test('URI parse', (t) => {
|
|
|
253
253
|
t.equal(components.fragment, undefined, 'fragment')
|
|
254
254
|
|
|
255
255
|
// IPv6address with zone identifier, RFC 6874
|
|
256
|
-
components =
|
|
256
|
+
components = fastURI.parse('//[fe80::a%25en1]')
|
|
257
257
|
t.equal(components.error, undefined, 'IPv4address errors')
|
|
258
258
|
t.equal(components.scheme, undefined, 'scheme')
|
|
259
259
|
t.equal(components.userinfo, undefined, 'userinfo')
|
|
@@ -264,7 +264,7 @@ test('URI parse', (t) => {
|
|
|
264
264
|
t.equal(components.fragment, undefined, 'fragment')
|
|
265
265
|
|
|
266
266
|
// IPv6address with an unescaped interface specifier, example from pekkanikander (https://github.com/garycourt/uri-js/pull/22)
|
|
267
|
-
components =
|
|
267
|
+
components = fastURI.parse('//[2001:db8::7%en0]')
|
|
268
268
|
t.equal(components.error, undefined, 'IPv6address interface errors')
|
|
269
269
|
t.equal(components.scheme, undefined, 'scheme')
|
|
270
270
|
t.equal(components.userinfo, undefined, 'userinfo')
|
|
@@ -275,7 +275,7 @@ test('URI parse', (t) => {
|
|
|
275
275
|
t.equal(components.fragment, undefined, 'fragment')
|
|
276
276
|
|
|
277
277
|
// UUID V1
|
|
278
|
-
components =
|
|
278
|
+
components = fastURI.parse('urn:uuid:b571b0bc-4713-11ec-81d3-0242ac130003')
|
|
279
279
|
t.equal(components.error, undefined, 'errors')
|
|
280
280
|
t.equal(components.scheme, 'urn', 'scheme')
|
|
281
281
|
// t.equal(components.authority, undefined, "authority");
|
|
@@ -290,13 +290,13 @@ test('URI parse', (t) => {
|
|
|
290
290
|
t.equal(components.uuid, 'b571b0bc-4713-11ec-81d3-0242ac130003', 'uuid')
|
|
291
291
|
|
|
292
292
|
// UUID v4
|
|
293
|
-
components =
|
|
293
|
+
components = fastURI.parse('urn:uuid:97a32222-89b7-420e-8507-4360723e2c2a')
|
|
294
294
|
t.equal(components.uuid, '97a32222-89b7-420e-8507-4360723e2c2a', 'uuid')
|
|
295
295
|
|
|
296
|
-
components =
|
|
296
|
+
components = fastURI.parse('urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6')
|
|
297
297
|
t.notSame(components.error, undefined, 'errors')
|
|
298
298
|
|
|
299
|
-
components =
|
|
299
|
+
components = fastURI.parse('urn:foo:a123,456')
|
|
300
300
|
t.equal(components.error, undefined, 'errors')
|
|
301
301
|
t.equal(components.scheme, 'urn', 'scheme')
|
|
302
302
|
// t.equal(components.authority, undefined, "authority");
|
|
@@ -309,10 +309,10 @@ test('URI parse', (t) => {
|
|
|
309
309
|
t.equal(components.nid, 'foo', 'nid')
|
|
310
310
|
t.equal(components.nss, 'a123,456', 'nss')
|
|
311
311
|
|
|
312
|
-
components =
|
|
312
|
+
components = fastURI.parse('//[2606:2800:220:1:248:1893:25c8:1946:43209]')
|
|
313
313
|
t.equal(components.host, '[2606:2800:220:1:248:1893:25c8:1946:43209]')
|
|
314
314
|
|
|
315
|
-
components =
|
|
315
|
+
components = fastURI.parse('urn:foo:|\\24fpl')
|
|
316
316
|
t.equal(components.error, 'URN can not be parsed.')
|
|
317
317
|
t.end()
|
|
318
318
|
})
|
|
@@ -1,61 +1,64 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const test = require('tape')
|
|
4
|
-
const
|
|
4
|
+
const fastURI = require('..')
|
|
5
5
|
|
|
6
6
|
test('URI Resolving', (t) => {
|
|
7
7
|
// normal examples from RFC 3986
|
|
8
8
|
const base = 'uri://a/b/c/d;p?q'
|
|
9
|
-
t.equal(
|
|
10
|
-
t.equal(
|
|
11
|
-
t.equal(
|
|
12
|
-
t.equal(
|
|
13
|
-
t.equal(
|
|
14
|
-
t.equal(
|
|
15
|
-
t.equal(
|
|
16
|
-
t.equal(
|
|
17
|
-
t.equal(
|
|
18
|
-
t.equal(
|
|
19
|
-
t.equal(
|
|
20
|
-
t.equal(
|
|
21
|
-
t.equal(
|
|
22
|
-
t.equal(
|
|
23
|
-
t.equal(
|
|
24
|
-
t.equal(
|
|
25
|
-
t.equal(
|
|
26
|
-
t.equal(
|
|
27
|
-
t.equal(
|
|
28
|
-
t.equal(
|
|
29
|
-
t.equal(
|
|
30
|
-
t.equal(
|
|
31
|
-
t.equal(
|
|
32
|
-
t.equal(
|
|
9
|
+
t.equal(fastURI.resolve(base, 'g:h'), 'g:h', 'g:h')
|
|
10
|
+
t.equal(fastURI.resolve(base, 'g:h'), 'g:h', 'g:h')
|
|
11
|
+
t.equal(fastURI.resolve(base, 'g'), 'uri://a/b/c/g', 'g')
|
|
12
|
+
t.equal(fastURI.resolve(base, './g'), 'uri://a/b/c/g', './g')
|
|
13
|
+
t.equal(fastURI.resolve(base, 'g/'), 'uri://a/b/c/g/', 'g/')
|
|
14
|
+
t.equal(fastURI.resolve(base, '/g'), 'uri://a/g', '/g')
|
|
15
|
+
t.equal(fastURI.resolve(base, '//g'), 'uri://g', '//g')
|
|
16
|
+
t.equal(fastURI.resolve(base, '?y'), 'uri://a/b/c/d;p?y', '?y')
|
|
17
|
+
t.equal(fastURI.resolve(base, 'g?y'), 'uri://a/b/c/g?y', 'g?y')
|
|
18
|
+
t.equal(fastURI.resolve(base, '#s'), 'uri://a/b/c/d;p?q#s', '#s')
|
|
19
|
+
t.equal(fastURI.resolve(base, 'g#s'), 'uri://a/b/c/g#s', 'g#s')
|
|
20
|
+
t.equal(fastURI.resolve(base, 'g?y#s'), 'uri://a/b/c/g?y#s', 'g?y#s')
|
|
21
|
+
t.equal(fastURI.resolve(base, ';x'), 'uri://a/b/c/;x', ';x')
|
|
22
|
+
t.equal(fastURI.resolve(base, 'g;x'), 'uri://a/b/c/g;x', 'g;x')
|
|
23
|
+
t.equal(fastURI.resolve(base, 'g;x?y#s'), 'uri://a/b/c/g;x?y#s', 'g;x?y#s')
|
|
24
|
+
t.equal(fastURI.resolve(base, ''), 'uri://a/b/c/d;p?q', '')
|
|
25
|
+
t.equal(fastURI.resolve(base, '.'), 'uri://a/b/c/', '.')
|
|
26
|
+
t.equal(fastURI.resolve(base, './'), 'uri://a/b/c/', './')
|
|
27
|
+
t.equal(fastURI.resolve(base, '..'), 'uri://a/b/', '..')
|
|
28
|
+
t.equal(fastURI.resolve(base, '../'), 'uri://a/b/', '../')
|
|
29
|
+
t.equal(fastURI.resolve(base, '../g'), 'uri://a/b/g', '../g')
|
|
30
|
+
t.equal(fastURI.resolve(base, '../..'), 'uri://a/', '../..')
|
|
31
|
+
t.equal(fastURI.resolve(base, '../../'), 'uri://a/', '../../')
|
|
32
|
+
t.equal(fastURI.resolve(base, '../../g'), 'uri://a/g', '../../g')
|
|
33
33
|
|
|
34
34
|
// abnormal examples from RFC 3986
|
|
35
|
-
t.equal(
|
|
36
|
-
t.equal(
|
|
35
|
+
t.equal(fastURI.resolve(base, '../../../g'), 'uri://a/g', '../../../g')
|
|
36
|
+
t.equal(fastURI.resolve(base, '../../../../g'), 'uri://a/g', '../../../../g')
|
|
37
37
|
|
|
38
|
-
t.equal(
|
|
39
|
-
t.equal(
|
|
40
|
-
t.equal(
|
|
41
|
-
t.equal(
|
|
42
|
-
t.equal(
|
|
43
|
-
t.equal(
|
|
38
|
+
t.equal(fastURI.resolve(base, '/./g'), 'uri://a/g', '/./g')
|
|
39
|
+
t.equal(fastURI.resolve(base, '/../g'), 'uri://a/g', '/../g')
|
|
40
|
+
t.equal(fastURI.resolve(base, 'g.'), 'uri://a/b/c/g.', 'g.')
|
|
41
|
+
t.equal(fastURI.resolve(base, '.g'), 'uri://a/b/c/.g', '.g')
|
|
42
|
+
t.equal(fastURI.resolve(base, 'g..'), 'uri://a/b/c/g..', 'g..')
|
|
43
|
+
t.equal(fastURI.resolve(base, '..g'), 'uri://a/b/c/..g', '..g')
|
|
44
44
|
|
|
45
|
-
t.equal(
|
|
46
|
-
t.equal(
|
|
47
|
-
t.equal(
|
|
48
|
-
t.equal(
|
|
49
|
-
t.equal(
|
|
50
|
-
t.equal(
|
|
45
|
+
t.equal(fastURI.resolve(base, './../g'), 'uri://a/b/g', './../g')
|
|
46
|
+
t.equal(fastURI.resolve(base, './g/.'), 'uri://a/b/c/g/', './g/.')
|
|
47
|
+
t.equal(fastURI.resolve(base, 'g/./h'), 'uri://a/b/c/g/h', 'g/./h')
|
|
48
|
+
t.equal(fastURI.resolve(base, 'g/../h'), 'uri://a/b/c/h', 'g/../h')
|
|
49
|
+
t.equal(fastURI.resolve(base, 'g;x=1/./y'), 'uri://a/b/c/g;x=1/y', 'g;x=1/./y')
|
|
50
|
+
t.equal(fastURI.resolve(base, 'g;x=1/../y'), 'uri://a/b/c/y', 'g;x=1/../y')
|
|
51
51
|
|
|
52
|
-
t.equal(
|
|
53
|
-
t.equal(
|
|
54
|
-
t.equal(
|
|
55
|
-
t.equal(
|
|
52
|
+
t.equal(fastURI.resolve(base, 'g?y/./x'), 'uri://a/b/c/g?y/./x', 'g?y/./x')
|
|
53
|
+
t.equal(fastURI.resolve(base, 'g?y/../x'), 'uri://a/b/c/g?y/../x', 'g?y/../x')
|
|
54
|
+
t.equal(fastURI.resolve(base, 'g#s/./x'), 'uri://a/b/c/g#s/./x', 'g#s/./x')
|
|
55
|
+
t.equal(fastURI.resolve(base, 'g#s/../x'), 'uri://a/b/c/g#s/../x', 'g#s/../x')
|
|
56
56
|
|
|
57
|
-
t.equal(
|
|
58
|
-
t.equal(
|
|
57
|
+
t.equal(fastURI.resolve(base, 'uri:g'), 'uri:g', 'uri:g')
|
|
58
|
+
t.equal(fastURI.resolve(base, 'uri:g', {}), 'uri:g', 'uri:g')
|
|
59
|
+
t.equal(fastURI.resolve(base, 'uri:g', { tolerant: undefined }), 'uri:g', 'uri:g')
|
|
60
|
+
t.equal(fastURI.resolve(base, 'uri:g', { tolerant: false }), 'uri:g', 'uri:g')
|
|
61
|
+
t.equal(fastURI.resolve(base, 'uri:g', { tolerant: true }), 'uri://a/b/c/g', 'uri:g')
|
|
59
62
|
|
|
60
63
|
// examples by PAEz
|
|
61
64
|
// example was provided to avoid infinite loop within regex
|
|
@@ -67,9 +70,9 @@ test('URI Resolving', (t) => {
|
|
|
67
70
|
|
|
68
71
|
test('URN Resolving', (t) => {
|
|
69
72
|
// example from epoberezkin
|
|
70
|
-
t.equal(
|
|
71
|
-
t.equal(
|
|
72
|
-
t.equal(
|
|
73
|
-
t.equal(
|
|
73
|
+
t.equal(fastURI.resolve('', 'urn:some:ip:prop'), 'urn:some:ip:prop', 'urn:some:ip:prop')
|
|
74
|
+
t.equal(fastURI.resolve('#', 'urn:some:ip:prop'), 'urn:some:ip:prop', 'urn:some:ip:prop')
|
|
75
|
+
t.equal(fastURI.resolve('urn:some:ip:prop', 'urn:some:ip:prop'), 'urn:some:ip:prop', 'urn:some:ip:prop')
|
|
76
|
+
t.equal(fastURI.resolve('urn:some:other:prop', 'urn:some:ip:prop'), 'urn:some:ip:prop', 'urn:some:ip:prop')
|
|
74
77
|
t.end()
|
|
75
78
|
})
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const test = require('tape')
|
|
4
|
+
const fastURI = require('..')
|
|
5
|
+
|
|
6
|
+
test('RFC 3986', (t) => {
|
|
7
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/', secure: true }),
|
|
8
|
+
'http://example.com/', 'http://example.com/')
|
|
9
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/foo', secure: true }),
|
|
10
|
+
'http://example.com/foo', 'http://example.com/foo')
|
|
11
|
+
|
|
12
|
+
// A. If the input buffer begins with a prefix of "../" or "./",
|
|
13
|
+
// then remove that prefix from the input buffer; otherwise,
|
|
14
|
+
|
|
15
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '../', secure: true }),
|
|
16
|
+
'http://example.com/', 'http://example.com/')
|
|
17
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: './', secure: true }),
|
|
18
|
+
'http://example.com/', 'http://example.com/')
|
|
19
|
+
|
|
20
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '../../', secure: true }),
|
|
21
|
+
'http://example.com/', 'http://example.com/')
|
|
22
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '././', secure: true }),
|
|
23
|
+
'http://example.com/', 'http://example.com/')
|
|
24
|
+
|
|
25
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: './../', secure: true }),
|
|
26
|
+
'http://example.com/', 'http://example.com/')
|
|
27
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '.././', secure: true }),
|
|
28
|
+
'http://example.com/', 'http://example.com/')
|
|
29
|
+
|
|
30
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '../foo', secure: true }),
|
|
31
|
+
'http://example.com/foo', 'http://example.com/foo')
|
|
32
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: './foo', secure: true }),
|
|
33
|
+
'http://example.com/foo', 'http://example.com/foo')
|
|
34
|
+
|
|
35
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '../../foo', secure: true }),
|
|
36
|
+
'http://example.com/foo', 'http://example.com/foo')
|
|
37
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '././foo', secure: true }),
|
|
38
|
+
'http://example.com/foo', 'http://example.com/foo')
|
|
39
|
+
|
|
40
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: './../foo', secure: true }),
|
|
41
|
+
'http://example.com/foo', 'http://example.com/foo')
|
|
42
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '.././foo', secure: true }),
|
|
43
|
+
'http://example.com/foo', 'http://example.com/foo')
|
|
44
|
+
|
|
45
|
+
// B. if the input buffer begins with a prefix of "/./" or "/.",
|
|
46
|
+
// where "." is a complete path segment, then replace that
|
|
47
|
+
// prefix with "/" in the input buffer; otherwise,
|
|
48
|
+
|
|
49
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/./', secure: true }),
|
|
50
|
+
'http://example.com/', 'http://example.com/')
|
|
51
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/.', secure: true }),
|
|
52
|
+
'http://example.com/', 'http://example.com/')
|
|
53
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/./foo', secure: true }),
|
|
54
|
+
'http://example.com/foo', 'http://example.com/foo')
|
|
55
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/.././foo', secure: true }),
|
|
56
|
+
'http://example.com/foo', 'http://example.com/foo')
|
|
57
|
+
|
|
58
|
+
// C. if the input buffer begins with a prefix of "/../" or "/..",
|
|
59
|
+
// where ".." is a complete path segment, then replace that
|
|
60
|
+
// prefix with "/" in the input buffer and remove the last
|
|
61
|
+
// segment and its preceding "/" (if any) from the output
|
|
62
|
+
// buffer; otherwise,
|
|
63
|
+
|
|
64
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/../', secure: true }),
|
|
65
|
+
'http://example.com/', 'http://example.com/')
|
|
66
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/..', secure: true }),
|
|
67
|
+
'http://example.com/', 'http://example.com/')
|
|
68
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/../foo', secure: true }),
|
|
69
|
+
'http://example.com/foo', 'http://example.com/foo')
|
|
70
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/foo/..', secure: true }),
|
|
71
|
+
'http://example.com/', 'http://example.com/')
|
|
72
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/foo/bar/..', secure: true }),
|
|
73
|
+
'http://example.com/foo/', 'http://example.com/foo/')
|
|
74
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/foo/../bar/..', secure: true }),
|
|
75
|
+
'http://example.com/', 'http://example.com/')
|
|
76
|
+
|
|
77
|
+
// D. if the input buffer consists only of "." or "..", then remove
|
|
78
|
+
// that from the input buffer; otherwise,
|
|
79
|
+
|
|
80
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/.', secure: true }),
|
|
81
|
+
'http://example.com/', 'http://example.com/')
|
|
82
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/..', secure: true }),
|
|
83
|
+
'http://example.com/', 'http://example.com/')
|
|
84
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '.', secure: true }),
|
|
85
|
+
'http://example.com/', 'http://example.com/')
|
|
86
|
+
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '..', secure: true }),
|
|
87
|
+
'http://example.com/', 'http://example.com/')
|
|
88
|
+
|
|
89
|
+
t.end()
|
|
90
|
+
})
|