cdk-common 2.0.863 → 2.0.864

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.
Files changed (85) hide show
  1. package/.jsii +2 -2
  2. package/lib/main.js +1 -1
  3. package/node_modules/punycode/LICENSE-MIT.txt +20 -0
  4. package/node_modules/punycode/README.md +148 -0
  5. package/node_modules/punycode/package.json +58 -0
  6. package/node_modules/punycode/punycode.es6.js +444 -0
  7. package/node_modules/punycode/punycode.js +443 -0
  8. package/node_modules/table/node_modules/ajv/dist/compile/resolve.d.ts +1 -1
  9. package/node_modules/table/node_modules/ajv/dist/runtime/uri.d.ts +1 -1
  10. package/node_modules/table/node_modules/ajv/dist/runtime/uri.js +1 -1
  11. package/node_modules/table/node_modules/ajv/dist/runtime/uri.js.map +1 -1
  12. package/node_modules/table/node_modules/ajv/dist/types/index.d.ts +1 -1
  13. package/node_modules/table/node_modules/ajv/lib/compile/index.ts +1 -1
  14. package/node_modules/table/node_modules/ajv/lib/compile/resolve.ts +1 -1
  15. package/node_modules/table/node_modules/ajv/lib/runtime/uri.ts +1 -1
  16. package/node_modules/table/node_modules/ajv/lib/types/index.ts +1 -1
  17. package/node_modules/table/node_modules/ajv/package.json +4 -4
  18. package/node_modules/uri-js/LICENSE +11 -0
  19. package/node_modules/uri-js/README.md +203 -0
  20. package/node_modules/uri-js/dist/es5/uri.all.d.ts +59 -0
  21. package/node_modules/uri-js/dist/es5/uri.all.js +1443 -0
  22. package/node_modules/uri-js/dist/es5/uri.all.js.map +1 -0
  23. package/node_modules/uri-js/dist/es5/uri.all.min.d.ts +59 -0
  24. package/node_modules/uri-js/dist/es5/uri.all.min.js +3 -0
  25. package/node_modules/uri-js/dist/es5/uri.all.min.js.map +1 -0
  26. package/node_modules/uri-js/dist/esnext/index.d.ts +1 -0
  27. package/node_modules/uri-js/dist/esnext/index.js +17 -0
  28. package/node_modules/uri-js/dist/esnext/index.js.map +1 -0
  29. package/node_modules/uri-js/dist/esnext/regexps-iri.d.ts +3 -0
  30. package/node_modules/uri-js/dist/esnext/regexps-iri.js +3 -0
  31. package/node_modules/uri-js/dist/esnext/regexps-iri.js.map +1 -0
  32. package/node_modules/uri-js/dist/esnext/regexps-uri.d.ts +4 -0
  33. package/node_modules/uri-js/dist/esnext/regexps-uri.js +42 -0
  34. package/node_modules/uri-js/dist/esnext/regexps-uri.js.map +1 -0
  35. package/node_modules/uri-js/dist/esnext/schemes/http.d.ts +3 -0
  36. package/node_modules/uri-js/dist/esnext/schemes/http.js +28 -0
  37. package/node_modules/uri-js/dist/esnext/schemes/http.js.map +1 -0
  38. package/node_modules/uri-js/dist/esnext/schemes/https.d.ts +3 -0
  39. package/node_modules/uri-js/dist/esnext/schemes/https.js +9 -0
  40. package/node_modules/uri-js/dist/esnext/schemes/https.js.map +1 -0
  41. package/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts +12 -0
  42. package/node_modules/uri-js/dist/esnext/schemes/mailto.js +148 -0
  43. package/node_modules/uri-js/dist/esnext/schemes/mailto.js.map +1 -0
  44. package/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts +7 -0
  45. package/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js +23 -0
  46. package/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map +1 -0
  47. package/node_modules/uri-js/dist/esnext/schemes/urn.d.ts +10 -0
  48. package/node_modules/uri-js/dist/esnext/schemes/urn.js +49 -0
  49. package/node_modules/uri-js/dist/esnext/schemes/urn.js.map +1 -0
  50. package/node_modules/uri-js/dist/esnext/schemes/ws.d.ts +7 -0
  51. package/node_modules/uri-js/dist/esnext/schemes/ws.js +41 -0
  52. package/node_modules/uri-js/dist/esnext/schemes/ws.js.map +1 -0
  53. package/node_modules/uri-js/dist/esnext/schemes/wss.d.ts +3 -0
  54. package/node_modules/uri-js/dist/esnext/schemes/wss.js +9 -0
  55. package/node_modules/uri-js/dist/esnext/schemes/wss.js.map +1 -0
  56. package/node_modules/uri-js/dist/esnext/uri.d.ts +59 -0
  57. package/node_modules/uri-js/dist/esnext/uri.js +480 -0
  58. package/node_modules/uri-js/dist/esnext/uri.js.map +1 -0
  59. package/node_modules/uri-js/dist/esnext/util.d.ts +6 -0
  60. package/node_modules/uri-js/dist/esnext/util.js +36 -0
  61. package/node_modules/uri-js/dist/esnext/util.js.map +1 -0
  62. package/node_modules/uri-js/package.json +77 -0
  63. package/package.json +1 -1
  64. package/node_modules/fast-uri/.gitattributes +0 -2
  65. package/node_modules/fast-uri/.github/.stale.yml +0 -21
  66. package/node_modules/fast-uri/.github/dependabot.yml +0 -13
  67. package/node_modules/fast-uri/.github/tests_checker.yml +0 -8
  68. package/node_modules/fast-uri/.github/workflows/ci.yml +0 -22
  69. package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +0 -20
  70. package/node_modules/fast-uri/LICENSE +0 -30
  71. package/node_modules/fast-uri/README.md +0 -125
  72. package/node_modules/fast-uri/benchmark.js +0 -105
  73. package/node_modules/fast-uri/index.js +0 -305
  74. package/node_modules/fast-uri/lib/schemes.js +0 -188
  75. package/node_modules/fast-uri/lib/scopedChars.js +0 -30
  76. package/node_modules/fast-uri/lib/utils.js +0 -236
  77. package/node_modules/fast-uri/package.json +0 -41
  78. package/node_modules/fast-uri/test/.gitkeep +0 -0
  79. package/node_modules/fast-uri/test/compatibility.test.js +0 -129
  80. package/node_modules/fast-uri/test/equal.test.js +0 -104
  81. package/node_modules/fast-uri/test/parse.test.js +0 -310
  82. package/node_modules/fast-uri/test/resolve.test.js +0 -76
  83. package/node_modules/fast-uri/test/serialize.test.js +0 -144
  84. package/node_modules/fast-uri/types/index.d.ts +0 -53
  85. package/node_modules/fast-uri/types/index.test-d.ts +0 -17
@@ -1,104 +0,0 @@
1
- 'use strict'
2
-
3
- const tap = require('tap')
4
- const test = tap.test
5
- const URI = require('../')
6
-
7
- const fn = URI.equal
8
- const runTest = (t, suite) => {
9
- suite.forEach(s => {
10
- const operator = s.result ? '==' : '!='
11
- t.equal(fn(s.pair[0], s.pair[1]), s.result, `${s.pair[0]} ${operator} ${s.pair[1]}`)
12
- t.equal(fn(s.pair[1], s.pair[0]), s.result, `${s.pair[1]} ${operator} ${s.pair[0]}`)
13
- })
14
- }
15
-
16
- test('URI Equals', (t) => {
17
- const suite = [
18
- { pair: ['example://a/b/c/%7Bfoo%7D', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d'], result: true }, // test from RFC 3986
19
- { pair: ['http://example.org/~user', 'http://example.org/%7euser'], result: true } // test from RFC 3987
20
- ]
21
- runTest(t, suite)
22
- t.end()
23
- })
24
-
25
- // test('IRI Equals', (t) => {
26
- // // example from RFC 3987
27
- // t.equal(URI.equal('example://a/b/c/%7Bfoo%7D/ros\xE9', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d/ros%C3%A9', IRI_OPTION), true)
28
- // t.end()
29
- // })
30
-
31
- test('HTTP Equals', (t) => {
32
- const suite = [
33
- // test from RFC 2616
34
- { pair: ['http://abc.com:80/~smith/home.html', 'http://abc.com/~smith/home.html'], result: true },
35
- { pair: [{ scheme: 'http', host: 'abc.com', port: 80, path: '/~smith/home.html' }, 'http://abc.com/~smith/home.html'], result: true },
36
- { pair: ['http://ABC.com/%7Esmith/home.html', 'http://abc.com/~smith/home.html'], result: true },
37
- { pair: ['http://ABC.com:/%7esmith/home.html', 'http://abc.com/~smith/home.html'], result: true },
38
- { pair: ['HTTP://ABC.COM', 'http://abc.com/'], result: true },
39
- // test from RFC 3986
40
- { pair: ['http://example.com:/', 'http://example.com:80/'], result: true }
41
- ]
42
- runTest(t, suite)
43
- t.end()
44
- })
45
-
46
- test('HTTPS Equals', (t) => {
47
- const suite = [
48
- { pair: ['https://example.com', 'https://example.com:443/'], result: true },
49
- { pair: ['https://example.com:/', 'https://example.com:443/'], result: true }
50
- ]
51
- runTest(t, suite)
52
- t.end()
53
- })
54
-
55
- test('URN Equals', (t) => {
56
- const suite = [
57
- // test from RFC 2141
58
- { pair: ['urn:foo:a123,456', 'urn:foo:a123,456'], result: true },
59
- { pair: ['urn:foo:a123,456', 'URN:foo:a123,456'], result: true },
60
- { pair: ['urn:foo:a123,456', 'urn:FOO:a123,456'], result: true }
61
- ]
62
-
63
- // Disabling for now as the whole equal logic might need
64
- // to be refactored
65
- // t.equal(URI.equal('urn:foo:a123,456', 'urn:foo:A123,456'), false)
66
- // t.equal(URI.equal('urn:foo:a123%2C456', 'URN:FOO:a123%2c456'), true)
67
-
68
- runTest(t, suite)
69
- t.end()
70
- })
71
-
72
- test('UUID Equals', (t) => {
73
- const suite = [
74
- { pair: ['URN:UUID:F81D4FAE-7DEC-11D0-A765-00A0C91E6BF6', 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6'], result: true }
75
- ]
76
-
77
- runTest(t, suite)
78
- t.end()
79
- })
80
-
81
- // test('Mailto Equals', (t) => {
82
- // // tests from RFC 6068
83
- // t.equal(URI.equal('mailto:addr1@an.example,addr2@an.example', 'mailto:?to=addr1@an.example,addr2@an.example'), true)
84
- // t.equal(URI.equal('mailto:?to=addr1@an.example,addr2@an.example', 'mailto:addr1@an.example?to=addr2@an.example'), true)
85
- // t.end()
86
- // })
87
-
88
- test('WS Equal', (t) => {
89
- const suite = [
90
- { pair: ['WS://ABC.COM:80/chat#one', 'ws://abc.com/chat'], result: true }
91
- ]
92
-
93
- runTest(t, suite)
94
- t.end()
95
- })
96
-
97
- test('WSS Equal', (t) => {
98
- const suite = [
99
- { pair: ['WSS://ABC.COM:443/chat#one', 'wss://abc.com/chat'], result: true }
100
- ]
101
-
102
- runTest(t, suite)
103
- t.end()
104
- })
@@ -1,310 +0,0 @@
1
- 'use strict'
2
-
3
- const tap = require('tap')
4
- const test = tap.test
5
- const URI = require('../')
6
-
7
- test('URI parse', (t) => {
8
- let components
9
-
10
- // scheme
11
- components = URI.parse('uri:')
12
- t.equal(components.error, undefined, 'scheme errors')
13
- t.equal(components.scheme, 'uri', 'scheme')
14
- // t.equal(components.authority, undefined, "authority");
15
- t.equal(components.userinfo, undefined, 'userinfo')
16
- t.equal(components.host, undefined, 'host')
17
- t.equal(components.port, undefined, 'port')
18
- t.equal(components.path, '', 'path')
19
- t.equal(components.query, undefined, 'query')
20
- t.equal(components.fragment, undefined, 'fragment')
21
-
22
- // userinfo
23
- components = URI.parse('//@')
24
- t.equal(components.error, undefined, 'userinfo errors')
25
- t.equal(components.scheme, undefined, 'scheme')
26
- // t.equal(components.authority, "@", "authority");
27
- t.equal(components.userinfo, '', 'userinfo')
28
- t.equal(components.host, '', 'host')
29
- t.equal(components.port, undefined, 'port')
30
- t.equal(components.path, '', 'path')
31
- t.equal(components.query, undefined, 'query')
32
- t.equal(components.fragment, undefined, 'fragment')
33
-
34
- // host
35
- components = URI.parse('//')
36
- t.equal(components.error, undefined, 'host errors')
37
- t.equal(components.scheme, undefined, 'scheme')
38
- // t.equal(components.authority, "", "authority");
39
- t.equal(components.userinfo, undefined, 'userinfo')
40
- t.equal(components.host, '', 'host')
41
- t.equal(components.port, undefined, 'port')
42
- t.equal(components.path, '', 'path')
43
- t.equal(components.query, undefined, 'query')
44
- t.equal(components.fragment, undefined, 'fragment')
45
-
46
- // port
47
- components = URI.parse('//:')
48
- t.equal(components.error, undefined, 'port errors')
49
- t.equal(components.scheme, undefined, 'scheme')
50
- // t.equal(components.authority, ":", "authority");
51
- t.equal(components.userinfo, undefined, 'userinfo')
52
- t.equal(components.host, '', 'host')
53
- t.equal(components.port, '', 'port')
54
- t.equal(components.path, '', 'path')
55
- t.equal(components.query, undefined, 'query')
56
- t.equal(components.fragment, undefined, 'fragment')
57
-
58
- // path
59
- components = URI.parse('')
60
- t.equal(components.error, undefined, 'path errors')
61
- t.equal(components.scheme, undefined, 'scheme')
62
- // t.equal(components.authority, undefined, "authority");
63
- t.equal(components.userinfo, undefined, 'userinfo')
64
- t.equal(components.host, undefined, 'host')
65
- t.equal(components.port, undefined, 'port')
66
- t.equal(components.path, '', 'path')
67
- t.equal(components.query, undefined, 'query')
68
- t.equal(components.fragment, undefined, 'fragment')
69
-
70
- // query
71
- components = URI.parse('?')
72
- t.equal(components.error, undefined, 'query errors')
73
- t.equal(components.scheme, undefined, 'scheme')
74
- // t.equal(components.authority, undefined, "authority");
75
- t.equal(components.userinfo, undefined, 'userinfo')
76
- t.equal(components.host, undefined, 'host')
77
- t.equal(components.port, undefined, 'port')
78
- t.equal(components.path, '', 'path')
79
- t.equal(components.query, '', 'query')
80
- t.equal(components.fragment, undefined, 'fragment')
81
-
82
- // fragment
83
- components = URI.parse('#')
84
- t.equal(components.error, undefined, 'fragment errors')
85
- t.equal(components.scheme, undefined, 'scheme')
86
- // t.equal(components.authority, undefined, "authority");
87
- t.equal(components.userinfo, undefined, 'userinfo')
88
- t.equal(components.host, undefined, 'host')
89
- t.equal(components.port, undefined, 'port')
90
- t.equal(components.path, '', 'path')
91
- t.equal(components.query, undefined, 'query')
92
- t.equal(components.fragment, '', 'fragment')
93
-
94
- // fragment with character tabulation
95
- components = URI.parse('#\t')
96
- t.equal(components.error, undefined, 'path errors')
97
- t.equal(components.scheme, undefined, 'scheme')
98
- // t.equal(components.authority, undefined, "authority");
99
- t.equal(components.userinfo, undefined, 'userinfo')
100
- t.equal(components.host, undefined, 'host')
101
- t.equal(components.port, undefined, 'port')
102
- t.equal(components.path, '', 'path')
103
- t.equal(components.query, undefined, 'query')
104
- t.equal(components.fragment, '%09', 'fragment')
105
-
106
- // fragment with line feed
107
- components = URI.parse('#\n')
108
- t.equal(components.error, undefined, 'path errors')
109
- t.equal(components.scheme, undefined, 'scheme')
110
- // t.equal(components.authority, undefined, "authority");
111
- t.equal(components.userinfo, undefined, 'userinfo')
112
- t.equal(components.host, undefined, 'host')
113
- t.equal(components.port, undefined, 'port')
114
- t.equal(components.path, '', 'path')
115
- t.equal(components.query, undefined, 'query')
116
- t.equal(components.fragment, '%0A', 'fragment')
117
-
118
- // fragment with line tabulation
119
- components = URI.parse('#\v')
120
- t.equal(components.error, undefined, 'path errors')
121
- t.equal(components.scheme, undefined, 'scheme')
122
- // t.equal(components.authority, undefined, "authority");
123
- t.equal(components.userinfo, undefined, 'userinfo')
124
- t.equal(components.host, undefined, 'host')
125
- t.equal(components.port, undefined, 'port')
126
- t.equal(components.path, '', 'path')
127
- t.equal(components.query, undefined, 'query')
128
- t.equal(components.fragment, '%0B', 'fragment')
129
-
130
- // fragment with form feed
131
- components = URI.parse('#\f')
132
- t.equal(components.error, undefined, 'path errors')
133
- t.equal(components.scheme, undefined, 'scheme')
134
- // t.equal(components.authority, undefined, "authority");
135
- t.equal(components.userinfo, undefined, 'userinfo')
136
- t.equal(components.host, undefined, 'host')
137
- t.equal(components.port, undefined, 'port')
138
- t.equal(components.path, '', 'path')
139
- t.equal(components.query, undefined, 'query')
140
- t.equal(components.fragment, '%0C', 'fragment')
141
-
142
- // fragment with carriage return
143
- components = URI.parse('#\r')
144
- t.equal(components.error, undefined, 'path errors')
145
- t.equal(components.scheme, undefined, 'scheme')
146
- // t.equal(components.authority, undefined, "authority");
147
- t.equal(components.userinfo, undefined, 'userinfo')
148
- t.equal(components.host, undefined, 'host')
149
- t.equal(components.port, undefined, 'port')
150
- t.equal(components.path, '', 'path')
151
- t.equal(components.query, undefined, 'query')
152
- t.equal(components.fragment, '%0D', 'fragment')
153
-
154
- // all
155
- components = URI.parse('uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body')
156
- t.equal(components.error, undefined, 'all errors')
157
- t.equal(components.scheme, 'uri', 'scheme')
158
- // t.equal(components.authority, "user:pass@example.com:123", "authority");
159
- t.equal(components.userinfo, 'user:pass', 'userinfo')
160
- t.equal(components.host, 'example.com', 'host')
161
- t.equal(components.port, 123, 'port')
162
- t.equal(components.path, '/one/two.three', 'path')
163
- t.equal(components.query, 'q1=a1&q2=a2', 'query')
164
- t.equal(components.fragment, 'body', 'fragment')
165
-
166
- // IPv4address
167
- components = URI.parse('//10.10.10.10')
168
- t.equal(components.error, undefined, 'IPv4address errors')
169
- t.equal(components.scheme, undefined, 'scheme')
170
- t.equal(components.userinfo, undefined, 'userinfo')
171
- t.equal(components.host, '10.10.10.10', 'host')
172
- t.equal(components.port, undefined, 'port')
173
- t.equal(components.path, '', 'path')
174
- t.equal(components.query, undefined, 'query')
175
- t.equal(components.fragment, undefined, 'fragment')
176
-
177
- // IPv4address with unformated 0
178
- components = URI.parse('//10.10.000.10')
179
- t.equal(components.error, undefined, 'IPv4address errors')
180
- t.equal(components.scheme, undefined, 'scheme')
181
- t.equal(components.userinfo, undefined, 'userinfo')
182
- t.equal(components.host, '10.10.0.10', 'host')
183
- t.equal(components.port, undefined, 'port')
184
- t.equal(components.path, '', 'path')
185
- t.equal(components.query, undefined, 'query')
186
- t.equal(components.fragment, undefined, 'fragment')
187
-
188
- // IPv6address
189
- components = URI.parse('//[2001:db8::7]')
190
- t.equal(components.error, undefined, 'IPv4address errors')
191
- t.equal(components.scheme, undefined, 'scheme')
192
- t.equal(components.userinfo, undefined, 'userinfo')
193
- t.equal(components.host, '2001:db8::7', 'host')
194
- t.equal(components.port, undefined, 'port')
195
- t.equal(components.path, '', 'path')
196
- t.equal(components.query, undefined, 'query')
197
- t.equal(components.fragment, undefined, 'fragment')
198
-
199
- // invalid IPv6
200
- components = URI.parse('//[2001:dbZ::7]')
201
- t.equal(components.host, '[2001:dbz::7]')
202
-
203
- // mixed IPv4address & IPv6address
204
- components = URI.parse('//[::ffff:129.144.52.38]')
205
- t.equal(components.error, undefined, 'IPv4address errors')
206
- t.equal(components.scheme, undefined, 'scheme')
207
- t.equal(components.userinfo, undefined, 'userinfo')
208
- t.equal(components.host, '::ffff:129.144.52.38', 'host')
209
- t.equal(components.port, undefined, 'port')
210
- t.equal(components.path, '', 'path')
211
- t.equal(components.query, undefined, 'query')
212
- t.equal(components.fragment, undefined, 'fragment')
213
-
214
- // mixed IPv4address & reg-name, example from terion-name (https://github.com/garycourt/uri-js/issues/4)
215
- components = URI.parse('uri://10.10.10.10.example.com/en/process')
216
- t.equal(components.error, undefined, 'mixed errors')
217
- t.equal(components.scheme, 'uri', 'scheme')
218
- t.equal(components.userinfo, undefined, 'userinfo')
219
- t.equal(components.host, '10.10.10.10.example.com', 'host')
220
- t.equal(components.port, undefined, 'port')
221
- t.equal(components.path, '/en/process', 'path')
222
- t.equal(components.query, undefined, 'query')
223
- t.equal(components.fragment, undefined, 'fragment')
224
-
225
- // IPv6address, example from bkw (https://github.com/garycourt/uri-js/pull/16)
226
- components = URI.parse('//[2606:2800:220:1:248:1893:25c8:1946]/test')
227
- t.equal(components.error, undefined, 'IPv6address errors')
228
- t.equal(components.scheme, undefined, 'scheme')
229
- t.equal(components.userinfo, undefined, 'userinfo')
230
- t.equal(components.host, '2606:2800:220:1:248:1893:25c8:1946', 'host')
231
- t.equal(components.port, undefined, 'port')
232
- t.equal(components.path, '/test', 'path')
233
- t.equal(components.query, undefined, 'query')
234
- t.equal(components.fragment, undefined, 'fragment')
235
-
236
- // IPv6address, example from RFC 5952
237
- components = URI.parse('//[2001:db8::1]:80')
238
- t.equal(components.error, undefined, 'IPv6address errors')
239
- t.equal(components.scheme, undefined, 'scheme')
240
- t.equal(components.userinfo, undefined, 'userinfo')
241
- t.equal(components.host, '2001:db8::1', 'host')
242
- t.equal(components.port, 80, 'port')
243
- t.equal(components.path, '', 'path')
244
- t.equal(components.query, undefined, 'query')
245
- t.equal(components.fragment, undefined, 'fragment')
246
-
247
- // IPv6address with zone identifier, RFC 6874
248
- components = URI.parse('//[fe80::a%25en1]')
249
- t.equal(components.error, undefined, 'IPv4address errors')
250
- t.equal(components.scheme, undefined, 'scheme')
251
- t.equal(components.userinfo, undefined, 'userinfo')
252
- t.equal(components.host, 'fe80::a%en1', 'host')
253
- t.equal(components.port, undefined, 'port')
254
- t.equal(components.path, '', 'path')
255
- t.equal(components.query, undefined, 'query')
256
- t.equal(components.fragment, undefined, 'fragment')
257
-
258
- // IPv6address with an unescaped interface specifier, example from pekkanikander (https://github.com/garycourt/uri-js/pull/22)
259
- components = URI.parse('//[2001:db8::7%en0]')
260
- t.equal(components.error, undefined, 'IPv6address interface errors')
261
- t.equal(components.scheme, undefined, 'scheme')
262
- t.equal(components.userinfo, undefined, 'userinfo')
263
- t.equal(components.host, '2001:db8::7%en0', 'host')
264
- t.equal(components.port, undefined, 'port')
265
- t.equal(components.path, '', 'path')
266
- t.equal(components.query, undefined, 'query')
267
- t.equal(components.fragment, undefined, 'fragment')
268
-
269
- // UUID V1
270
- components = URI.parse('urn:uuid:b571b0bc-4713-11ec-81d3-0242ac130003')
271
- t.equal(components.error, undefined, 'errors')
272
- t.equal(components.scheme, 'urn', 'scheme')
273
- // t.equal(components.authority, undefined, "authority");
274
- t.equal(components.userinfo, undefined, 'userinfo')
275
- t.equal(components.host, undefined, 'host')
276
- t.equal(components.port, undefined, 'port')
277
- t.equal(components.path, undefined, 'path')
278
- t.equal(components.query, undefined, 'query')
279
- t.equal(components.fragment, undefined, 'fragment')
280
- t.equal(components.nid, 'uuid', 'nid')
281
- t.equal(components.nss, undefined, 'nss')
282
- t.equal(components.uuid, 'b571b0bc-4713-11ec-81d3-0242ac130003', 'uuid')
283
-
284
- // UUID v4
285
- components = URI.parse('urn:uuid:97a32222-89b7-420e-8507-4360723e2c2a')
286
- t.equal(components.uuid, '97a32222-89b7-420e-8507-4360723e2c2a', 'uuid')
287
-
288
- components = URI.parse('urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6')
289
- t.notSame(components.error, undefined, 'errors')
290
-
291
- components = URI.parse('urn:foo:a123,456')
292
- t.equal(components.error, undefined, 'errors')
293
- t.equal(components.scheme, 'urn', 'scheme')
294
- // t.equal(components.authority, undefined, "authority");
295
- t.equal(components.userinfo, undefined, 'userinfo')
296
- t.equal(components.host, undefined, 'host')
297
- t.equal(components.port, undefined, 'port')
298
- t.equal(components.path, undefined, 'path')
299
- t.equal(components.query, undefined, 'query')
300
- t.equal(components.fragment, undefined, 'fragment')
301
- t.equal(components.nid, 'foo', 'nid')
302
- t.equal(components.nss, 'a123,456', 'nss')
303
-
304
- components = URI.parse('//[2606:2800:220:1:248:1893:25c8:1946:43209]')
305
- t.equal(components.host, '[2606:2800:220:1:248:1893:25c8:1946:43209]')
306
-
307
- components = URI.parse('urn:foo:|\\24fpl')
308
- t.equal(components.error, 'URN can not be parsed.')
309
- t.end()
310
- })
@@ -1,76 +0,0 @@
1
- 'use strict'
2
-
3
- const tap = require('tap')
4
- const test = tap.test
5
- const URI = require('../')
6
-
7
- test('URI Resolving', (t) => {
8
- // normal examples from RFC 3986
9
- const base = 'uri://a/b/c/d;p?q'
10
- t.equal(URI.resolve(base, 'g:h'), 'g:h', 'g:h')
11
- t.equal(URI.resolve(base, 'g:h'), 'g:h', 'g:h')
12
- t.equal(URI.resolve(base, 'g'), 'uri://a/b/c/g', 'g')
13
- t.equal(URI.resolve(base, './g'), 'uri://a/b/c/g', './g')
14
- t.equal(URI.resolve(base, 'g/'), 'uri://a/b/c/g/', 'g/')
15
- t.equal(URI.resolve(base, '/g'), 'uri://a/g', '/g')
16
- t.equal(URI.resolve(base, '//g'), 'uri://g', '//g')
17
- t.equal(URI.resolve(base, '?y'), 'uri://a/b/c/d;p?y', '?y')
18
- t.equal(URI.resolve(base, 'g?y'), 'uri://a/b/c/g?y', 'g?y')
19
- t.equal(URI.resolve(base, '#s'), 'uri://a/b/c/d;p?q#s', '#s')
20
- t.equal(URI.resolve(base, 'g#s'), 'uri://a/b/c/g#s', 'g#s')
21
- t.equal(URI.resolve(base, 'g?y#s'), 'uri://a/b/c/g?y#s', 'g?y#s')
22
- t.equal(URI.resolve(base, ';x'), 'uri://a/b/c/;x', ';x')
23
- t.equal(URI.resolve(base, 'g;x'), 'uri://a/b/c/g;x', 'g;x')
24
- t.equal(URI.resolve(base, 'g;x?y#s'), 'uri://a/b/c/g;x?y#s', 'g;x?y#s')
25
- t.equal(URI.resolve(base, ''), 'uri://a/b/c/d;p?q', '')
26
- t.equal(URI.resolve(base, '.'), 'uri://a/b/c/', '.')
27
- t.equal(URI.resolve(base, './'), 'uri://a/b/c/', './')
28
- t.equal(URI.resolve(base, '..'), 'uri://a/b/', '..')
29
- t.equal(URI.resolve(base, '../'), 'uri://a/b/', '../')
30
- t.equal(URI.resolve(base, '../g'), 'uri://a/b/g', '../g')
31
- t.equal(URI.resolve(base, '../..'), 'uri://a/', '../..')
32
- t.equal(URI.resolve(base, '../../'), 'uri://a/', '../../')
33
- t.equal(URI.resolve(base, '../../g'), 'uri://a/g', '../../g')
34
-
35
- // abnormal examples from RFC 3986
36
- t.equal(URI.resolve(base, '../../../g'), 'uri://a/g', '../../../g')
37
- t.equal(URI.resolve(base, '../../../../g'), 'uri://a/g', '../../../../g')
38
-
39
- t.equal(URI.resolve(base, '/./g'), 'uri://a/g', '/./g')
40
- t.equal(URI.resolve(base, '/../g'), 'uri://a/g', '/../g')
41
- t.equal(URI.resolve(base, 'g.'), 'uri://a/b/c/g.', 'g.')
42
- t.equal(URI.resolve(base, '.g'), 'uri://a/b/c/.g', '.g')
43
- t.equal(URI.resolve(base, 'g..'), 'uri://a/b/c/g..', 'g..')
44
- t.equal(URI.resolve(base, '..g'), 'uri://a/b/c/..g', '..g')
45
-
46
- t.equal(URI.resolve(base, './../g'), 'uri://a/b/g', './../g')
47
- t.equal(URI.resolve(base, './g/.'), 'uri://a/b/c/g/', './g/.')
48
- t.equal(URI.resolve(base, 'g/./h'), 'uri://a/b/c/g/h', 'g/./h')
49
- t.equal(URI.resolve(base, 'g/../h'), 'uri://a/b/c/h', 'g/../h')
50
- t.equal(URI.resolve(base, 'g;x=1/./y'), 'uri://a/b/c/g;x=1/y', 'g;x=1/./y')
51
- t.equal(URI.resolve(base, 'g;x=1/../y'), 'uri://a/b/c/y', 'g;x=1/../y')
52
-
53
- t.equal(URI.resolve(base, 'g?y/./x'), 'uri://a/b/c/g?y/./x', 'g?y/./x')
54
- t.equal(URI.resolve(base, 'g?y/../x'), 'uri://a/b/c/g?y/../x', 'g?y/../x')
55
- t.equal(URI.resolve(base, 'g#s/./x'), 'uri://a/b/c/g#s/./x', 'g#s/./x')
56
- t.equal(URI.resolve(base, 'g#s/../x'), 'uri://a/b/c/g#s/../x', 'g#s/../x')
57
-
58
- t.equal(URI.resolve(base, 'uri:g'), 'uri:g', 'uri:g')
59
- t.equal(URI.resolve(base, 'uri:g', { tolerant: true }), 'uri://a/b/c/g', 'uri:g')
60
-
61
- // examples by PAEz
62
- // example was provided to avoid infinite loop within regex
63
- // this is not the case anymore
64
- // t.equal(URI.resolve('//www.g.com/', '/adf\ngf'), '//www.g.com/adf%0Agf', '/adf\\ngf')
65
- // t.equal(URI.resolve('//www.g.com/error\n/bleh/bleh', '..'), '//www.g.com/error%0A/', '//www.g.com/error\\n/bleh/bleh')
66
- t.end()
67
- })
68
-
69
- test('URN Resolving', (t) => {
70
- // example from epoberezkin
71
- t.equal(URI.resolve('', 'urn:some:ip:prop'), 'urn:some:ip:prop', 'urn:some:ip:prop')
72
- t.equal(URI.resolve('#', 'urn:some:ip:prop'), 'urn:some:ip:prop', 'urn:some:ip:prop')
73
- t.equal(URI.resolve('urn:some:ip:prop', 'urn:some:ip:prop'), 'urn:some:ip:prop', 'urn:some:ip:prop')
74
- t.equal(URI.resolve('urn:some:other:prop', 'urn:some:ip:prop'), 'urn:some:ip:prop', 'urn:some:ip:prop')
75
- t.end()
76
- })
@@ -1,144 +0,0 @@
1
- 'use strict'
2
-
3
- const tap = require('tap')
4
- const test = tap.test
5
- const URI = require('../')
6
-
7
- test('URI Serialize', (t) => {
8
- let components = {
9
- scheme: undefined,
10
- userinfo: undefined,
11
- host: undefined,
12
- port: undefined,
13
- path: undefined,
14
- query: undefined,
15
- fragment: undefined
16
- }
17
- t.equal(URI.serialize(components), '', 'Undefined Components')
18
-
19
- components = {
20
- scheme: '',
21
- userinfo: '',
22
- host: '',
23
- port: 0,
24
- path: '',
25
- query: '',
26
- fragment: ''
27
- }
28
- t.equal(URI.serialize(components), '//@:0?#', 'Empty Components')
29
-
30
- components = {
31
- scheme: 'uri',
32
- userinfo: 'foo:bar',
33
- host: 'example.com',
34
- port: 1,
35
- path: 'path',
36
- query: 'query',
37
- fragment: 'fragment'
38
- }
39
- t.equal(URI.serialize(components), 'uri://foo:bar@example.com:1/path?query#fragment', 'All Components')
40
-
41
- components = {
42
- scheme: 'uri',
43
- host: 'example.com',
44
- port: '9000'
45
- }
46
- t.equal(URI.serialize(components), 'uri://example.com:9000', 'String port')
47
-
48
- t.equal(URI.serialize({ path: '//path' }), '/%2Fpath', 'Double slash path')
49
- t.equal(URI.serialize({ path: 'foo:bar' }), 'foo%3Abar', 'Colon path')
50
- t.equal(URI.serialize({ path: '?query' }), '%3Fquery', 'Query path')
51
-
52
- t.equal(URI.serialize({ host: '10.10.10.10' }), '//10.10.10.10', 'IPv4address')
53
-
54
- // mixed IPv4address & reg-name, example from terion-name (https://github.com/garycourt/uri-js/issues/4)
55
- t.equal(URI.serialize({ host: '10.10.10.10.example.com' }), '//10.10.10.10.example.com', 'Mixed IPv4address & reg-name')
56
-
57
- // IPv6address
58
- t.equal(URI.serialize({ host: '2001:db8::7' }), '//[2001:db8::7]', 'IPv6 Host')
59
- t.equal(URI.serialize({ host: '::ffff:129.144.52.38' }), '//[::ffff:129.144.52.38]', 'IPv6 Mixed Host')
60
- t.equal(URI.serialize({ host: '2606:2800:220:1:248:1893:25c8:1946' }), '//[2606:2800:220:1:248:1893:25c8:1946]', 'IPv6 Full Host')
61
-
62
- // IPv6address with zone identifier, RFC 6874
63
- t.equal(URI.serialize({ host: 'fe80::a%en1' }), '//[fe80::a%25en1]', 'IPv6 Zone Unescaped Host')
64
- t.equal(URI.serialize({ host: 'fe80::a%25en1' }), '//[fe80::a%25en1]', 'IPv6 Zone Escaped Host')
65
-
66
- t.end()
67
- })
68
-
69
- test('WS serialize', (t) => {
70
- t.equal(URI.serialize({ scheme: 'ws' }), 'ws:')
71
- t.equal(URI.serialize({ scheme: 'ws', host: 'example.com' }), 'ws://example.com')
72
- t.equal(URI.serialize({ scheme: 'ws', resourceName: '/' }), 'ws:')
73
- t.equal(URI.serialize({ scheme: 'ws', resourceName: '/foo' }), 'ws:/foo')
74
- t.equal(URI.serialize({ scheme: 'ws', resourceName: '/foo?bar' }), 'ws:/foo?bar')
75
- t.equal(URI.serialize({ scheme: 'ws', secure: false }), 'ws:')
76
- t.equal(URI.serialize({ scheme: 'ws', secure: true }), 'wss:')
77
- t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo' }), 'ws://example.com/foo')
78
- t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar' }), 'ws://example.com/foo?bar')
79
- t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', secure: false }), 'ws://example.com')
80
- t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', secure: true }), 'wss://example.com')
81
- t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: false }), 'ws://example.com/foo?bar')
82
- t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: true }), 'wss://example.com/foo?bar')
83
- t.end()
84
- })
85
-
86
- test('WSS serialize', (t) => {
87
- t.equal(URI.serialize({ scheme: 'wss' }), 'wss:')
88
- t.equal(URI.serialize({ scheme: 'wss', host: 'example.com' }), 'wss://example.com')
89
- t.equal(URI.serialize({ scheme: 'wss', resourceName: '/' }), 'wss:')
90
- t.equal(URI.serialize({ scheme: 'wss', resourceName: '/foo' }), 'wss:/foo')
91
- t.equal(URI.serialize({ scheme: 'wss', resourceName: '/foo?bar' }), 'wss:/foo?bar')
92
- t.equal(URI.serialize({ scheme: 'wss', secure: false }), 'ws:')
93
- t.equal(URI.serialize({ scheme: 'wss', secure: true }), 'wss:')
94
- t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo' }), 'wss://example.com/foo')
95
- t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar' }), 'wss://example.com/foo?bar')
96
- t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', secure: false }), 'ws://example.com')
97
- t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', secure: true }), 'wss://example.com')
98
- t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar', secure: false }), 'ws://example.com/foo?bar')
99
- t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar', secure: true }), 'wss://example.com/foo?bar')
100
-
101
- t.end()
102
- })
103
-
104
- test('URN serialize', (t) => {
105
- // example from RFC 2141
106
- const components = {
107
- scheme: 'urn',
108
- nid: 'foo',
109
- nss: 'a123,456'
110
- }
111
- t.equal(URI.serialize(components), 'urn:foo:a123,456')
112
- // example from RFC 4122
113
- let uuidcomponents = {
114
- scheme: 'urn',
115
- nid: 'uuid',
116
- uuid: 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
117
- }
118
- t.equal(URI.serialize(uuidcomponents), 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
119
-
120
- uuidcomponents = {
121
- scheme: 'urn',
122
- nid: 'uuid',
123
- uuid: 'notauuid-7dec-11d0-a765-00a0c91e6bf6'
124
- }
125
- t.equal(URI.serialize(uuidcomponents), 'urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6')
126
- t.end()
127
- })
128
- test('URN NID Override', (t) => {
129
- let components = URI.parse('urn:foo:f81d4fae-7dec-11d0-a765-00a0c91e6bf6', { nid: 'uuid' })
130
- t.equal(components.error, undefined, 'errors')
131
- t.equal(components.scheme, 'urn', 'scheme')
132
- t.equal(components.path, undefined, 'path')
133
- t.equal(components.nid, 'foo', 'nid')
134
- t.equal(components.nss, undefined, 'nss')
135
- t.equal(components.uuid, 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6', 'uuid')
136
-
137
- components = {
138
- scheme: 'urn',
139
- nid: 'foo',
140
- uuid: 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
141
- }
142
- t.equal(URI.serialize(components, { nid: 'uuid' }), 'urn:foo:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
143
- t.end()
144
- })