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,188 +0,0 @@
1
- 'use strict'
2
-
3
- const UUID_REG = /^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu
4
- const URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu
5
-
6
- function isSecure (wsComponents) {
7
- return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === 'wss'
8
- }
9
-
10
- function httpParse (components) {
11
- if (!components.host) {
12
- components.error = components.error || 'HTTP URIs must have a host.'
13
- }
14
-
15
- return components
16
- }
17
-
18
- function httpSerialize (components) {
19
- const secure = String(components.scheme).toLowerCase() === 'https'
20
-
21
- // normalize the default port
22
- if (components.port === (secure ? 443 : 80) || components.port === '') {
23
- components.port = undefined
24
- }
25
-
26
- // normalize the empty path
27
- if (!components.path) {
28
- components.path = '/'
29
- }
30
-
31
- // NOTE: We do not parse query strings for HTTP URIs
32
- // as WWW Form Url Encoded query strings are part of the HTML4+ spec,
33
- // and not the HTTP spec.
34
-
35
- return components
36
- }
37
-
38
- function wsParse (wsComponents) {
39
- // indicate if the secure flag is set
40
- wsComponents.secure = isSecure(wsComponents)
41
-
42
- // construct resouce name
43
- wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '')
44
- wsComponents.path = undefined
45
- wsComponents.query = undefined
46
-
47
- return wsComponents
48
- }
49
-
50
- function wsSerialize (wsComponents) {
51
- // normalize the default port
52
- if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === '') {
53
- wsComponents.port = undefined
54
- }
55
-
56
- // ensure scheme matches secure flag
57
- if (typeof wsComponents.secure === 'boolean') {
58
- wsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws')
59
- wsComponents.secure = undefined
60
- }
61
-
62
- // reconstruct path from resource name
63
- if (wsComponents.resourceName) {
64
- const [path, query] = wsComponents.resourceName.split('?')
65
- wsComponents.path = (path && path !== '/' ? path : undefined)
66
- wsComponents.query = query
67
- wsComponents.resourceName = undefined
68
- }
69
-
70
- // forbid fragment component
71
- wsComponents.fragment = undefined
72
-
73
- return wsComponents
74
- }
75
-
76
- function urnParse (urnComponents, options) {
77
- if (!urnComponents.path) {
78
- urnComponents.error = 'URN can not be parsed'
79
- return urnComponents
80
- }
81
- const matches = urnComponents.path.match(URN_REG)
82
- if (matches) {
83
- const scheme = options.scheme || urnComponents.scheme || 'urn'
84
- urnComponents.nid = matches[1].toLowerCase()
85
- urnComponents.nss = matches[2]
86
- const urnScheme = `${scheme}:${options.nid || urnComponents.nid}`
87
- const schemeHandler = SCHEMES[urnScheme]
88
- urnComponents.path = undefined
89
-
90
- if (schemeHandler) {
91
- urnComponents = schemeHandler.parse(urnComponents, options)
92
- }
93
- } else {
94
- urnComponents.error = urnComponents.error || 'URN can not be parsed.'
95
- }
96
-
97
- return urnComponents
98
- }
99
-
100
- function urnSerialize (urnComponents, options) {
101
- const scheme = options.scheme || urnComponents.scheme || 'urn'
102
- const nid = urnComponents.nid.toLowerCase()
103
- const urnScheme = `${scheme}:${options.nid || nid}`
104
- const schemeHandler = SCHEMES[urnScheme]
105
-
106
- if (schemeHandler) {
107
- urnComponents = schemeHandler.serialize(urnComponents, options)
108
- }
109
-
110
- const uriComponents = urnComponents
111
- const nss = urnComponents.nss
112
- uriComponents.path = `${nid || options.nid}:${nss}`
113
-
114
- options.skipEscape = true
115
- return uriComponents
116
- }
117
-
118
- function urnuuidParse (urnComponents, options) {
119
- const uuidComponents = urnComponents
120
- uuidComponents.uuid = uuidComponents.nss
121
- uuidComponents.nss = undefined
122
-
123
- if (!options.tolerant && (!uuidComponents.uuid || !UUID_REG.test(uuidComponents.uuid))) {
124
- uuidComponents.error = uuidComponents.error || 'UUID is not valid.'
125
- }
126
-
127
- return uuidComponents
128
- }
129
-
130
- function urnuuidSerialize (uuidComponents) {
131
- const urnComponents = uuidComponents
132
- // normalize UUID
133
- urnComponents.nss = (uuidComponents.uuid || '').toLowerCase()
134
- return urnComponents
135
- }
136
-
137
- const http = {
138
- scheme: 'http',
139
- domainHost: true,
140
- parse: httpParse,
141
- serialize: httpSerialize
142
- }
143
-
144
- const https = {
145
- scheme: 'https',
146
- domainHost: http.domainHost,
147
- parse: httpParse,
148
- serialize: httpSerialize
149
- }
150
-
151
- const ws = {
152
- scheme: 'ws',
153
- domainHost: true,
154
- parse: wsParse,
155
- serialize: wsSerialize
156
- }
157
-
158
- const wss = {
159
- scheme: 'wss',
160
- domainHost: ws.domainHost,
161
- parse: ws.parse,
162
- serialize: ws.serialize
163
- }
164
-
165
- const urn = {
166
- scheme: 'urn',
167
- parse: urnParse,
168
- serialize: urnSerialize,
169
- skipNormalize: true
170
- }
171
-
172
- const urnuuid = {
173
- scheme: 'urn:uuid',
174
- parse: urnuuidParse,
175
- serialize: urnuuidSerialize,
176
- skipNormalize: true
177
- }
178
-
179
- const SCHEMES = {
180
- http,
181
- https,
182
- ws,
183
- wss,
184
- urn,
185
- 'urn:uuid': urnuuid
186
- }
187
-
188
- module.exports = SCHEMES
@@ -1,30 +0,0 @@
1
- 'use strict'
2
-
3
- const HEX = {
4
- 0: 0,
5
- 1: 1,
6
- 2: 2,
7
- 3: 3,
8
- 4: 4,
9
- 5: 5,
10
- 6: 6,
11
- 7: 7,
12
- 8: 8,
13
- 9: 9,
14
- a: 10,
15
- A: 10,
16
- b: 11,
17
- B: 11,
18
- c: 12,
19
- C: 12,
20
- d: 13,
21
- D: 13,
22
- e: 14,
23
- E: 14,
24
- f: 15,
25
- F: 15
26
- }
27
-
28
- module.exports = {
29
- HEX
30
- }
@@ -1,236 +0,0 @@
1
- 'use strict'
2
-
3
- const { HEX } = require('./scopedChars')
4
-
5
- function normalizeIPv4 (host) {
6
- if (findToken(host, '.') < 3) { return { host, isIPV4: false } }
7
- const matches = host.match(/^(\b[01]?\d{1,2}|\b2[0-4]\d|\b25[0-5])(\.([01]?\d{1,2}|2[0-4]\d|25[0-5])){3}$/u) || []
8
- const [address] = matches
9
- if (address) {
10
- return { host: stripLeadingZeros(address, '.'), isIPV4: true }
11
- } else {
12
- return { host, isIPV4: false }
13
- }
14
- }
15
-
16
- function stringToHexStripped (input) {
17
- let acc = ''
18
- let strip = true
19
- for (const c of input) {
20
- if (c !== '0' && strip === true) strip = false
21
- if (HEX[c] === undefined) return undefined
22
- if (!strip) acc += c
23
- }
24
- return acc
25
- }
26
-
27
- function getIPV6 (input) {
28
- let tokenCount = 0
29
- const output = { error: false, address: '', zone: '' }
30
- const address = []
31
- const buffer = []
32
- let isZone = false
33
- let endipv6Encountered = false
34
- let endIpv6 = false
35
-
36
- function consume () {
37
- if (buffer.length) {
38
- if (isZone === false) {
39
- const hex = stringToHexStripped(buffer.join(''))
40
- if (hex !== undefined) {
41
- address.push(hex)
42
- } else {
43
- output.error = true
44
- return false
45
- }
46
- }
47
- buffer.length = 0
48
- }
49
- return true
50
- }
51
-
52
- for (let i = 0; i < input.length; i++) {
53
- const cursor = input[i]
54
- if (cursor === '[' || cursor === ']') { continue }
55
- if (cursor === ':') {
56
- if (endipv6Encountered === true) {
57
- endIpv6 = true
58
- }
59
- if (!consume()) { break }
60
- tokenCount++
61
- address.push(':')
62
- if (tokenCount > 7) {
63
- // not valid
64
- output.error = true
65
- break
66
- }
67
- if (i - 1 >= 0 && input[i - 1] === ':') {
68
- endipv6Encountered = true
69
- }
70
- continue
71
- } else if (cursor === '%') {
72
- if (!consume()) { break }
73
- // switch to zone detection
74
- isZone = true
75
- } else {
76
- buffer.push(cursor)
77
- continue
78
- }
79
- }
80
- if (buffer.length) {
81
- if (isZone) {
82
- output.zone = buffer.join('')
83
- } else if (endIpv6) {
84
- address.push(buffer.join(''))
85
- } else {
86
- address.push(stringToHexStripped(buffer.join('')))
87
- }
88
- }
89
- output.address = address.join('')
90
- return output
91
- }
92
-
93
- function normalizeIPv6 (host, opts = {}) {
94
- if (findToken(host, ':') < 2) { return { host, isIPV6: false } }
95
- const ipv6 = getIPV6(host)
96
-
97
- if (!ipv6.error) {
98
- let newHost = ipv6.address
99
- let escapedHost = ipv6.address
100
- if (ipv6.zone) {
101
- newHost += '%' + ipv6.zone
102
- escapedHost += '%25' + ipv6.zone
103
- }
104
- return { host: newHost, escapedHost, isIPV6: true }
105
- } else {
106
- return { host, isIPV6: false }
107
- }
108
- }
109
-
110
- function stripLeadingZeros (str, token) {
111
- let out = ''
112
- let skip = true
113
- const l = str.length
114
- for (let i = 0; i < l; i++) {
115
- const c = str[i]
116
- if (c === '0' && skip) {
117
- if ((i + 1 <= l && str[i + 1] === token) || i + 1 === l) {
118
- out += c
119
- skip = false
120
- }
121
- } else {
122
- if (c === token) {
123
- skip = true
124
- } else {
125
- skip = false
126
- }
127
- out += c
128
- }
129
- }
130
- return out
131
- }
132
-
133
- function findToken (str, token) {
134
- let ind = 0
135
- for (let i = 0; i < str.length; i++) {
136
- if (str[i] === token) ind++
137
- }
138
- return ind
139
- }
140
-
141
- const RDS1 = /^\.\.?\//u
142
- const RDS2 = /^\/\.(?:\/|$)/u
143
- const RDS3 = /^\/\.\.(?:\/|$)/u
144
- const RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/u
145
-
146
- function removeDotSegments (input) {
147
- const output = []
148
-
149
- while (input.length) {
150
- if (input.match(RDS1)) {
151
- input = input.replace(RDS1, '')
152
- } else if (input.match(RDS2)) {
153
- input = input.replace(RDS2, '/')
154
- } else if (input.match(RDS3)) {
155
- input = input.replace(RDS3, '/')
156
- output.pop()
157
- } else if (input === '.' || input === '..') {
158
- input = ''
159
- } else {
160
- const im = input.match(RDS5)
161
- if (im) {
162
- const s = im[0]
163
- input = input.slice(s.length)
164
- output.push(s)
165
- } else {
166
- throw new Error('Unexpected dot segment condition')
167
- }
168
- }
169
- }
170
- return output.join('')
171
- }
172
-
173
- function normalizeComponentEncoding (components, esc) {
174
- const func = esc !== true ? escape : unescape
175
- if (components.scheme !== undefined) {
176
- components.scheme = func(components.scheme)
177
- }
178
- if (components.userinfo !== undefined) {
179
- components.userinfo = func(components.userinfo)
180
- }
181
- if (components.host !== undefined) {
182
- components.host = func(components.host)
183
- }
184
- if (components.path !== undefined) {
185
- components.path = func(components.path)
186
- }
187
- if (components.query !== undefined) {
188
- components.query = func(components.query)
189
- }
190
- if (components.fragment !== undefined) {
191
- components.fragment = func(components.fragment)
192
- }
193
- return components
194
- }
195
-
196
- function recomposeAuthority (components, options) {
197
- const uriTokens = []
198
-
199
- if (components.userinfo !== undefined) {
200
- uriTokens.push(components.userinfo)
201
- uriTokens.push('@')
202
- }
203
-
204
- if (components.host !== undefined) {
205
- let host = unescape(components.host)
206
- const ipV4res = normalizeIPv4(host)
207
-
208
- if (ipV4res.isIPV4) {
209
- host = ipV4res.host
210
- } else {
211
- const ipV6res = normalizeIPv6(ipV4res.host, { isIPV4: false })
212
- if (ipV6res.isIPV6 === true) {
213
- host = `[${ipV6res.escapedHost}]`
214
- } else {
215
- host = components.host
216
- }
217
- }
218
- uriTokens.push(host)
219
- }
220
-
221
- if (typeof components.port === 'number' || typeof components.port === 'string') {
222
- uriTokens.push(':')
223
- uriTokens.push(String(components.port))
224
- }
225
-
226
- return uriTokens.length ? uriTokens.join('') : undefined
227
- };
228
-
229
- module.exports = {
230
- recomposeAuthority,
231
- normalizeComponentEncoding,
232
- removeDotSegments,
233
- normalizeIPv4,
234
- normalizeIPv6,
235
- stringToHexStripped
236
- }
@@ -1,41 +0,0 @@
1
- {
2
- "name": "fast-uri",
3
- "description": "Dependency free RFC 3986 URI toolbox",
4
- "version": "2.3.0",
5
- "main": "index.js",
6
- "type": "commonjs",
7
- "types": "types/index.d.ts",
8
- "license": "MIT",
9
- "author": "Vincent Le Goff <vince.legoff@gmail.com> (https://github.com/zekth)",
10
- "repository": {
11
- "type": "git",
12
- "url": "https://github.com/fastify/fast-uri"
13
- },
14
- "bugs": {
15
- "url": "https://github.com/fastify/fast-uri/issues"
16
- },
17
- "homepage": "https://github.com/fastify/fast-uri",
18
- "scripts": {
19
- "bench": "node benchmark.js",
20
- "lint:fix": "standard --fix",
21
- "test:lint": "standard | snazzy",
22
- "test:typescript": "tsd",
23
- "test:unit": "tap -J test/*.test.js",
24
- "test:unit:dev": "tap -J test/*.test.js --coverage-report=html",
25
- "test": "npm run test:lint && npm run test:unit && npm run test:typescript",
26
- "test:ci": "npm run test:lint && npm run test:unit -- --cov --coverage-report=lcovonly && npm run test:typescript"
27
- },
28
- "devDependencies": {
29
- "benchmark": "^2.1.4",
30
- "coveralls": "^3.1.1",
31
- "snazzy": "^9.0.0",
32
- "standard": "^17.0.0",
33
- "tap": "^16.0.0",
34
- "tsd": "^0.29.0",
35
- "uri-js": "^4.4.1"
36
- },
37
- "dependencies": {},
38
- "tap": {
39
- "check-coverage": false
40
- }
41
- }
File without changes
@@ -1,129 +0,0 @@
1
- 'use strict'
2
-
3
- const tap = require('tap')
4
- const test = tap.test
5
- const fastifyURI = require('../')
6
- const urijs = require('uri-js')
7
-
8
- test('compatibility Parse', (t) => {
9
- const toParse = [
10
- '//www.g.com/error\n/bleh/bleh',
11
- 'https://fastify.org',
12
- '//10.10.10.10',
13
- '//10.10.000.10',
14
- '//[2001:db8::7%en0]',
15
- '//[2001:dbZ::1]:80',
16
- '//[2001:db8::1]:80',
17
- '//[2001:db8::001]:80',
18
- 'uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body',
19
- 'http://user:pass@example.com:123/one/space in.url?q1=a1&q2=a2#body',
20
- '//[::ffff:129.144.52.38]',
21
- 'uri://10.10.10.10.example.com/en/process',
22
- '//[2606:2800:220:1:248:1893:25c8:1946]/test',
23
- 'ws://example.com/chat',
24
- 'ws://example.com/foo?bar=baz',
25
- 'wss://example.com/?bar=baz',
26
- 'wss://example.com/chat',
27
- 'wss://example.com/foo?bar=baz',
28
- 'wss://example.com/?bar=baz',
29
- 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6',
30
- 'urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6',
31
- 'urn:example:%D0%B0123,z456',
32
- '//[2606:2800:220:1:248:1893:25c8:1946:43209]',
33
- 'http://foo.bar',
34
- 'http://',
35
- '#/$defs/stringMap',
36
- '#/$defs/string%20Map',
37
- '#/$defs/string Map',
38
- '//?json=%7B%22foo%22%3A%22bar%22%7D'
39
- // 'mailto:chris@example.com'-203845,
40
- // 'mailto:infobot@example.com?subject=current-issue',
41
- // 'mailto:infobot@example.com?body=send%20current-issue',
42
- // 'mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index',
43
- // 'mailto:list@example.org?In-Reply-To=%3C3469A91.D10AF4C@example.com%3E',
44
- // 'mailto:majordomo@example.com?body=subscribe%20bamboo-l',
45
- // 'mailto:joe@example.com?cc=bob@example.com&body=hello',
46
- // 'mailto:gorby%25kremvax@example.com',
47
- // 'mailto:unlikely%3Faddress@example.com?blat=foop',
48
- // 'mailto:Mike%26family@example.org',
49
- // 'mailto:%22not%40me%22@example.org',
50
- // 'mailto:%22oh%5C%5Cno%22@example.org',
51
- // 'mailto:%22%5C%5C%5C%22it\'s%5C%20ugly%5C%5C%5C%22%22@example.org',
52
- // 'mailto:user@example.org?subject=caf%C3%A9',
53
- // 'mailto:user@example.org?subject=%3D%3Futf-8%3FQ%3Fcaf%3DC3%3DA9%3F%3D',
54
- // 'mailto:user@example.org?subject=%3D%3Fiso-8859-1%3FQ%3Fcaf%3DE9%3F%3D',
55
- // 'mailto:user@example.org?subject=caf%C3%A9&body=caf%C3%A9',
56
- // 'mailto:user@%E7%B4%8D%E8%B1%86.example.org?subject=Test&body=NATTO'
57
- ]
58
- toParse.forEach((x) => {
59
- t.same(fastifyURI.parse(x), urijs.parse(x), 'Compatibility parse: ' + x)
60
- })
61
- t.end()
62
- })
63
-
64
- test('compatibility serialize', (t) => {
65
- const toSerialize = [
66
- { host: '10.10.10.10.example.com' },
67
- { host: '2001:db8::7' },
68
- { host: '::ffff:129.144.52.38' },
69
- { host: '2606:2800:220:1:248:1893:25c8:1946' },
70
- { host: '10.10.10.10.example.com' },
71
- { host: '10.10.10.10' },
72
- { path: '?query' },
73
- { path: 'foo:bar' },
74
- { path: '//path' },
75
- {
76
- scheme: 'uri',
77
- host: 'example.com',
78
- port: '9000'
79
- },
80
- {
81
- scheme: 'uri',
82
- userinfo: 'foo:bar',
83
- host: 'example.com',
84
- port: 1,
85
- path: 'path',
86
- query: 'query',
87
- fragment: 'fragment'
88
- },
89
- {
90
- scheme: '',
91
- userinfo: '',
92
- host: '',
93
- port: 0,
94
- path: '',
95
- query: '',
96
- fragment: ''
97
- },
98
- {
99
- scheme: undefined,
100
- userinfo: undefined,
101
- host: undefined,
102
- port: undefined,
103
- path: undefined,
104
- query: undefined,
105
- fragment: undefined
106
- },
107
- { host: 'fe80::a%en1' },
108
- { host: 'fe80::a%25en1' },
109
- {
110
- scheme: 'ws',
111
- host: 'example.com',
112
- resourceName: '/foo?bar',
113
- secure: true
114
- },
115
- {
116
- scheme: 'scheme',
117
- path: 'with:colon'
118
- }
119
- ]
120
- toSerialize.forEach((x) => {
121
- const r = JSON.stringify(x)
122
- t.same(
123
- fastifyURI.serialize(x),
124
- urijs.serialize(x),
125
- 'Compatibility serialize: ' + JSON.stringify(r)
126
- )
127
- })
128
- t.end()
129
- })