@emulsify/cli 1.11.4 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/dist/node_modules/.package-lock.json +34 -24
  2. package/dist/node_modules/@types/node/README.md +2 -2
  3. package/dist/node_modules/@types/node/assert.d.ts +23 -1
  4. package/dist/node_modules/@types/node/async_hooks.d.ts +64 -0
  5. package/dist/node_modules/@types/node/buffer.buffer.d.ts +124 -38
  6. package/dist/node_modules/@types/node/buffer.d.ts +19 -17
  7. package/dist/node_modules/@types/node/child_process.d.ts +88 -161
  8. package/dist/node_modules/@types/node/cluster.d.ts +5 -6
  9. package/dist/node_modules/@types/node/constants.d.ts +14 -12
  10. package/dist/node_modules/@types/node/crypto.d.ts +237 -166
  11. package/dist/node_modules/@types/node/dgram.d.ts +15 -14
  12. package/dist/node_modules/@types/node/diagnostics_channel.d.ts +39 -15
  13. package/dist/node_modules/@types/node/dns/promises.d.ts +11 -9
  14. package/dist/node_modules/@types/node/dns.d.ts +28 -21
  15. package/dist/node_modules/@types/node/events.d.ts +81 -35
  16. package/dist/node_modules/@types/node/fs/promises.d.ts +61 -36
  17. package/dist/node_modules/@types/node/fs.d.ts +251 -193
  18. package/dist/node_modules/@types/node/globals.d.ts +146 -442
  19. package/dist/node_modules/@types/node/globals.typedarray.d.ts +17 -0
  20. package/dist/node_modules/@types/node/http.d.ts +136 -31
  21. package/dist/node_modules/@types/node/http2.d.ts +102 -26
  22. package/dist/node_modules/@types/node/https.d.ts +94 -60
  23. package/dist/node_modules/@types/node/index.d.ts +5 -3
  24. package/dist/node_modules/@types/node/{inspector.d.ts → inspector.generated.d.ts} +272 -2
  25. package/dist/node_modules/@types/node/module.d.ts +362 -138
  26. package/dist/node_modules/@types/node/net.d.ts +27 -20
  27. package/dist/node_modules/@types/node/os.d.ts +14 -3
  28. package/dist/node_modules/@types/node/package.json +4 -89
  29. package/dist/node_modules/@types/node/perf_hooks.d.ts +37 -10
  30. package/dist/node_modules/@types/node/process.d.ts +108 -35
  31. package/dist/node_modules/@types/node/querystring.d.ts +2 -3
  32. package/dist/node_modules/@types/node/readline/promises.d.ts +1 -1
  33. package/dist/node_modules/@types/node/stream/consumers.d.ts +33 -7
  34. package/dist/node_modules/@types/node/stream/web.d.ts +13 -4
  35. package/dist/node_modules/@types/node/stream.d.ts +963 -1014
  36. package/dist/node_modules/@types/node/string_decoder.d.ts +2 -2
  37. package/dist/node_modules/@types/node/test.d.ts +1504 -1655
  38. package/dist/node_modules/@types/node/timers/promises.d.ts +28 -17
  39. package/dist/node_modules/@types/node/timers.d.ts +157 -111
  40. package/dist/node_modules/@types/node/tls.d.ts +105 -67
  41. package/dist/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +120 -37
  42. package/dist/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +15 -0
  43. package/dist/node_modules/@types/node/ts5.6/index.d.ts +5 -3
  44. package/dist/node_modules/@types/node/url.d.ts +10 -1
  45. package/dist/node_modules/@types/node/util.d.ts +28 -3
  46. package/dist/node_modules/@types/node/v8.d.ts +6 -5
  47. package/dist/node_modules/@types/node/vm.d.ts +147 -68
  48. package/dist/node_modules/@types/node/wasi.d.ts +1 -1
  49. package/dist/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  50. package/dist/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  51. package/dist/node_modules/@types/node/web-globals/events.d.ts +97 -0
  52. package/dist/node_modules/@types/node/web-globals/fetch.d.ts +46 -0
  53. package/dist/node_modules/@types/node/worker_threads.d.ts +60 -39
  54. package/dist/node_modules/@types/node/zlib.d.ts +21 -20
  55. package/dist/node_modules/debug/package.json +7 -3
  56. package/dist/node_modules/debug/src/browser.js +2 -1
  57. package/dist/node_modules/debug/src/common.js +57 -39
  58. package/dist/node_modules/fast-uri/.github/dependabot.yml +1 -1
  59. package/dist/node_modules/fast-uri/.github/workflows/ci.yml +81 -3
  60. package/dist/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +6 -2
  61. package/dist/node_modules/fast-uri/LICENSE +3 -1
  62. package/dist/node_modules/fast-uri/README.md +55 -37
  63. package/dist/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
  64. package/dist/node_modules/fast-uri/benchmark/equal.mjs +51 -0
  65. package/dist/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
  66. package/dist/node_modules/fast-uri/benchmark/package.json +17 -0
  67. package/dist/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
  68. package/dist/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
  69. package/dist/node_modules/fast-uri/eslint.config.js +6 -0
  70. package/dist/node_modules/fast-uri/index.js +98 -61
  71. package/dist/node_modules/fast-uri/lib/schemes.js +160 -81
  72. package/dist/node_modules/fast-uri/lib/utils.js +217 -123
  73. package/dist/node_modules/fast-uri/package.json +44 -14
  74. package/dist/node_modules/fast-uri/test/ajv.test.js +7 -3
  75. package/dist/node_modules/fast-uri/test/equal.test.js +7 -2
  76. package/dist/node_modules/fast-uri/test/fixtures/uri-js-parse.json +501 -0
  77. package/dist/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
  78. package/dist/node_modules/fast-uri/test/parse.test.js +31 -31
  79. package/dist/node_modules/fast-uri/test/resolve.test.js +52 -49
  80. package/dist/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
  81. package/dist/node_modules/fast-uri/test/serialize.test.js +55 -47
  82. package/dist/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
  83. package/dist/node_modules/fast-uri/test/uri-js.test.js +230 -230
  84. package/dist/node_modules/fast-uri/test/util.test.js +23 -8
  85. package/dist/node_modules/fast-uri/tsconfig.json +9 -0
  86. package/dist/node_modules/fast-uri/types/index.d.ts +16 -9
  87. package/dist/node_modules/fast-uri/types/index.test-d.ts +9 -9
  88. package/dist/node_modules/fs-extra/LICENSE +1 -1
  89. package/dist/node_modules/fs-extra/README.md +3 -1
  90. package/dist/node_modules/fs-extra/lib/copy/copy-sync.js +11 -1
  91. package/dist/node_modules/fs-extra/lib/copy/copy.js +13 -15
  92. package/dist/node_modules/fs-extra/lib/fs/index.js +6 -0
  93. package/dist/node_modules/fs-extra/lib/util/async.js +29 -0
  94. package/dist/node_modules/fs-extra/lib/util/stat.js +2 -1
  95. package/dist/node_modules/fs-extra/package.json +1 -1
  96. package/dist/node_modules/jsonfile/README.md +1 -1
  97. package/dist/node_modules/jsonfile/index.js +3 -3
  98. package/dist/node_modules/jsonfile/package.json +1 -1
  99. package/dist/node_modules/simple-git/dist/cjs/index.js +235 -235
  100. package/dist/node_modules/simple-git/dist/cjs/index.js.map +3 -3
  101. package/dist/node_modules/simple-git/dist/esm/index.js +229 -233
  102. package/dist/node_modules/simple-git/dist/esm/index.js.map +3 -3
  103. package/dist/node_modules/simple-git/dist/src/lib/git-logger.d.ts +1 -1
  104. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-branch.d.ts +1 -1
  105. package/dist/node_modules/simple-git/dist/src/lib/plugins/error-detection.plugin.d.ts +2 -3
  106. package/dist/node_modules/simple-git/dist/src/lib/plugins/simple-git-plugin.d.ts +2 -3
  107. package/dist/node_modules/simple-git/dist/src/lib/plugins/spawn-options-plugin.d.ts +0 -1
  108. package/dist/node_modules/simple-git/dist/src/lib/runners/scheduler.d.ts +1 -1
  109. package/dist/node_modules/simple-git/dist/src/lib/runners/tasks-pending-queue.d.ts +2 -2
  110. package/dist/node_modules/simple-git/dist/src/lib/tasks/apply-patch.d.ts +1 -1
  111. package/dist/node_modules/simple-git/dist/src/lib/tasks/clean.d.ts +1 -1
  112. package/dist/node_modules/simple-git/dist/src/lib/tasks/clone.d.ts +1 -1
  113. package/dist/node_modules/simple-git/dist/src/lib/tasks/log.d.ts +3 -3
  114. package/dist/node_modules/simple-git/dist/src/lib/tasks/push.d.ts +1 -1
  115. package/dist/node_modules/simple-git/dist/src/lib/tasks/remote.d.ts +4 -2
  116. package/dist/node_modules/simple-git/dist/src/lib/tasks/reset.d.ts +3 -3
  117. package/dist/node_modules/simple-git/dist/src/lib/tasks/stash-list.d.ts +1 -1
  118. package/dist/node_modules/simple-git/dist/src/lib/tasks/task.d.ts +2 -2
  119. package/dist/node_modules/simple-git/dist/src/lib/types/handlers.d.ts +1 -1
  120. package/dist/node_modules/simple-git/dist/src/lib/types/index.d.ts +9 -13
  121. package/dist/node_modules/simple-git/dist/src/lib/types/tasks.d.ts +5 -6
  122. package/dist/node_modules/simple-git/dist/src/lib/utils/argument-filters.d.ts +5 -7
  123. package/dist/node_modules/simple-git/dist/src/lib/utils/git-output-streams.d.ts +0 -1
  124. package/dist/node_modules/simple-git/dist/src/lib/utils/line-parser.d.ts +1 -1
  125. package/dist/node_modules/simple-git/dist/src/lib/utils/task-options.d.ts +1 -1
  126. package/dist/node_modules/simple-git/dist/src/lib/utils/util.d.ts +11 -10
  127. package/dist/node_modules/simple-git/package.json +6 -6
  128. package/dist/node_modules/simple-git/readme.md +8 -0
  129. package/dist/node_modules/undici-types/dispatcher.d.ts +1 -0
  130. package/dist/node_modules/undici-types/eventsource.d.ts +0 -2
  131. package/dist/node_modules/undici-types/filereader.d.ts +1 -1
  132. package/dist/node_modules/undici-types/interceptors.d.ts +3 -1
  133. package/dist/node_modules/undici-types/package.json +1 -1
  134. package/dist/node_modules/undici-types/patch.d.ts +0 -38
  135. package/dist/node_modules/undici-types/readable.d.ts +5 -0
  136. package/dist/node_modules/undici-types/webidl.d.ts +6 -0
  137. package/dist/node_modules/undici-types/websocket.d.ts +0 -2
  138. package/dist/package-lock.json +911 -812
  139. package/dist/package.json +1 -1
  140. package/dist/util/getAvailableStarters.js +2 -2
  141. package/package.json +1 -1
  142. package/dist/node_modules/@types/node/dom-events.d.ts +0 -124
  143. package/dist/node_modules/fast-uri/benchmark.js +0 -105
  144. package/dist/node_modules/fast-uri/lib/scopedChars.js +0 -30
  145. package/dist/node_modules/fast-uri/test/.gitkeep +0 -0
  146. package/dist/node_modules/fast-uri/test/compatibility.test.js +0 -131
  147. package/dist/node_modules/jsonfile/CHANGELOG.md +0 -171
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  const test = require('tape')
4
- const URI = require('../')
4
+ const fastURI = require('..')
5
5
 
6
6
  test('URI Serialize', (t) => {
7
7
  let components = {
@@ -13,7 +13,7 @@ test('URI Serialize', (t) => {
13
13
  query: undefined,
14
14
  fragment: undefined
15
15
  }
16
- t.equal(URI.serialize(components), '', 'Undefined Components')
16
+ t.equal(fastURI.serialize(components), '', 'Undefined Components')
17
17
 
18
18
  components = {
19
19
  scheme: '',
@@ -24,7 +24,7 @@ test('URI Serialize', (t) => {
24
24
  query: '',
25
25
  fragment: ''
26
26
  }
27
- t.equal(URI.serialize(components), '//@:0?#', 'Empty Components')
27
+ t.equal(fastURI.serialize(components), '//@:0?#', 'Empty Components')
28
28
 
29
29
  components = {
30
30
  scheme: 'uri',
@@ -35,97 +35,105 @@ test('URI Serialize', (t) => {
35
35
  query: 'query',
36
36
  fragment: 'fragment'
37
37
  }
38
- t.equal(URI.serialize(components), 'uri://foo:bar@example.com:1/path?query#fragment', 'All Components')
38
+ t.equal(fastURI.serialize(components), 'uri://foo:bar@example.com:1/path?query#fragment', 'All Components')
39
39
 
40
40
  components = {
41
41
  scheme: 'uri',
42
42
  host: 'example.com',
43
43
  port: '9000'
44
44
  }
45
- t.equal(URI.serialize(components), 'uri://example.com:9000', 'String port')
45
+ t.equal(fastURI.serialize(components), 'uri://example.com:9000', 'String port')
46
46
 
47
- t.equal(URI.serialize({ path: '//path' }), '/%2Fpath', 'Double slash path')
48
- t.equal(URI.serialize({ path: 'foo:bar' }), 'foo%3Abar', 'Colon path')
49
- t.equal(URI.serialize({ path: '?query' }), '%3Fquery', 'Query path')
47
+ t.equal(fastURI.serialize({ path: '//path' }), '/%2Fpath', 'Double slash path')
48
+ t.equal(fastURI.serialize({ path: 'foo:bar' }), 'foo%3Abar', 'Colon path')
49
+ t.equal(fastURI.serialize({ path: '?query' }), '%3Fquery', 'Query path')
50
50
 
51
- t.equal(URI.serialize({ host: '10.10.10.10' }), '//10.10.10.10', 'IPv4address')
51
+ t.equal(fastURI.serialize({ host: '10.10.10.10' }), '//10.10.10.10', 'IPv4address')
52
52
 
53
53
  // mixed IPv4address & reg-name, example from terion-name (https://github.com/garycourt/uri-js/issues/4)
54
- t.equal(URI.serialize({ host: '10.10.10.10.example.com' }), '//10.10.10.10.example.com', 'Mixed IPv4address & reg-name')
54
+ t.equal(fastURI.serialize({ host: '10.10.10.10.example.com' }), '//10.10.10.10.example.com', 'Mixed IPv4address & reg-name')
55
55
 
56
56
  // IPv6address
57
- t.equal(URI.serialize({ host: '2001:db8::7' }), '//[2001:db8::7]', 'IPv6 Host')
58
- t.equal(URI.serialize({ host: '::ffff:129.144.52.38' }), '//[::ffff:129.144.52.38]', 'IPv6 Mixed Host')
59
- t.equal(URI.serialize({ host: '2606:2800:220:1:248:1893:25c8:1946' }), '//[2606:2800:220:1:248:1893:25c8:1946]', 'IPv6 Full Host')
57
+ t.equal(fastURI.serialize({ host: '2001:db8::7' }), '//[2001:db8::7]', 'IPv6 Host')
58
+ t.equal(fastURI.serialize({ host: '::ffff:129.144.52.38' }), '//[::ffff:129.144.52.38]', 'IPv6 Mixed Host')
59
+ t.equal(fastURI.serialize({ host: '2606:2800:220:1:248:1893:25c8:1946' }), '//[2606:2800:220:1:248:1893:25c8:1946]', 'IPv6 Full Host')
60
60
 
61
61
  // IPv6address with zone identifier, RFC 6874
62
- t.equal(URI.serialize({ host: 'fe80::a%en1' }), '//[fe80::a%25en1]', 'IPv6 Zone Unescaped Host')
63
- t.equal(URI.serialize({ host: 'fe80::a%25en1' }), '//[fe80::a%25en1]', 'IPv6 Zone Escaped Host')
62
+ t.equal(fastURI.serialize({ host: 'fe80::a%en1' }), '//[fe80::a%25en1]', 'IPv6 Zone Unescaped Host')
63
+ t.equal(fastURI.serialize({ host: 'fe80::a%25en1' }), '//[fe80::a%25en1]', 'IPv6 Zone Escaped Host')
64
64
 
65
65
  t.end()
66
66
  })
67
67
 
68
68
  test('WS serialize', (t) => {
69
- t.equal(URI.serialize({ scheme: 'ws' }), 'ws:')
70
- t.equal(URI.serialize({ scheme: 'ws', host: 'example.com' }), 'ws://example.com')
71
- t.equal(URI.serialize({ scheme: 'ws', resourceName: '/' }), 'ws:')
72
- t.equal(URI.serialize({ scheme: 'ws', resourceName: '/foo' }), 'ws:/foo')
73
- t.equal(URI.serialize({ scheme: 'ws', resourceName: '/foo?bar' }), 'ws:/foo?bar')
74
- t.equal(URI.serialize({ scheme: 'ws', secure: false }), 'ws:')
75
- t.equal(URI.serialize({ scheme: 'ws', secure: true }), 'wss:')
76
- t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo' }), 'ws://example.com/foo')
77
- t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar' }), 'ws://example.com/foo?bar')
78
- t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', secure: false }), 'ws://example.com')
79
- t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', secure: true }), 'wss://example.com')
80
- t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: false }), 'ws://example.com/foo?bar')
81
- t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: true }), 'wss://example.com/foo?bar')
69
+ t.equal(fastURI.serialize({ scheme: 'ws' }), 'ws:')
70
+ t.equal(fastURI.serialize({ scheme: 'ws', host: 'example.com' }), 'ws://example.com')
71
+ t.equal(fastURI.serialize({ scheme: 'ws', resourceName: '/' }), 'ws:')
72
+ t.equal(fastURI.serialize({ scheme: 'ws', resourceName: '/foo' }), 'ws:/foo')
73
+ t.equal(fastURI.serialize({ scheme: 'ws', resourceName: '/foo?bar' }), 'ws:/foo?bar')
74
+ t.equal(fastURI.serialize({ scheme: 'ws', secure: false }), 'ws:')
75
+ t.equal(fastURI.serialize({ scheme: 'ws', secure: true }), 'wss:')
76
+ t.equal(fastURI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo' }), 'ws://example.com/foo')
77
+ t.equal(fastURI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar' }), 'ws://example.com/foo?bar')
78
+ t.equal(fastURI.serialize({ scheme: 'ws', host: 'example.com', secure: false }), 'ws://example.com')
79
+ t.equal(fastURI.serialize({ scheme: 'ws', host: 'example.com', secure: true }), 'wss://example.com')
80
+ t.equal(fastURI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: false }), 'ws://example.com/foo?bar')
81
+ t.equal(fastURI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: true }), 'wss://example.com/foo?bar')
82
82
  t.end()
83
83
  })
84
84
 
85
85
  test('WSS serialize', (t) => {
86
- t.equal(URI.serialize({ scheme: 'wss' }), 'wss:')
87
- t.equal(URI.serialize({ scheme: 'wss', host: 'example.com' }), 'wss://example.com')
88
- t.equal(URI.serialize({ scheme: 'wss', resourceName: '/' }), 'wss:')
89
- t.equal(URI.serialize({ scheme: 'wss', resourceName: '/foo' }), 'wss:/foo')
90
- t.equal(URI.serialize({ scheme: 'wss', resourceName: '/foo?bar' }), 'wss:/foo?bar')
91
- t.equal(URI.serialize({ scheme: 'wss', secure: false }), 'ws:')
92
- t.equal(URI.serialize({ scheme: 'wss', secure: true }), 'wss:')
93
- t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo' }), 'wss://example.com/foo')
94
- t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar' }), 'wss://example.com/foo?bar')
95
- t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', secure: false }), 'ws://example.com')
96
- t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', secure: true }), 'wss://example.com')
97
- t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar', secure: false }), 'ws://example.com/foo?bar')
98
- t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar', secure: true }), 'wss://example.com/foo?bar')
86
+ t.equal(fastURI.serialize({ scheme: 'wss' }), 'wss:')
87
+ t.equal(fastURI.serialize({ scheme: 'wss', host: 'example.com' }), 'wss://example.com')
88
+ t.equal(fastURI.serialize({ scheme: 'wss', resourceName: '/' }), 'wss:')
89
+ t.equal(fastURI.serialize({ scheme: 'wss', resourceName: '/foo' }), 'wss:/foo')
90
+ t.equal(fastURI.serialize({ scheme: 'wss', resourceName: '/foo?bar' }), 'wss:/foo?bar')
91
+ t.equal(fastURI.serialize({ scheme: 'wss', secure: false }), 'ws:')
92
+ t.equal(fastURI.serialize({ scheme: 'wss', secure: true }), 'wss:')
93
+ t.equal(fastURI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo' }), 'wss://example.com/foo')
94
+ t.equal(fastURI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar' }), 'wss://example.com/foo?bar')
95
+ t.equal(fastURI.serialize({ scheme: 'wss', host: 'example.com', secure: false }), 'ws://example.com')
96
+ t.equal(fastURI.serialize({ scheme: 'wss', host: 'example.com', secure: true }), 'wss://example.com')
97
+ t.equal(fastURI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar', secure: false }), 'ws://example.com/foo?bar')
98
+ t.equal(fastURI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar', secure: true }), 'wss://example.com/foo?bar')
99
99
 
100
100
  t.end()
101
101
  })
102
102
 
103
103
  test('URN serialize', (t) => {
104
- // example from RFC 2141
104
+ // example from RFC 2141
105
105
  const components = {
106
106
  scheme: 'urn',
107
107
  nid: 'foo',
108
108
  nss: 'a123,456'
109
109
  }
110
- t.equal(URI.serialize(components), 'urn:foo:a123,456')
110
+ t.equal(fastURI.serialize(components), 'urn:foo:a123,456')
111
111
  // example from RFC 4122
112
112
  let uuidcomponents = {
113
113
  scheme: 'urn',
114
114
  nid: 'uuid',
115
115
  uuid: 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
116
116
  }
117
- t.equal(URI.serialize(uuidcomponents), 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
117
+ t.equal(fastURI.serialize(uuidcomponents), 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
118
118
 
119
119
  uuidcomponents = {
120
120
  scheme: 'urn',
121
121
  nid: 'uuid',
122
122
  uuid: 'notauuid-7dec-11d0-a765-00a0c91e6bf6'
123
123
  }
124
- t.equal(URI.serialize(uuidcomponents), 'urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6')
124
+ t.equal(fastURI.serialize(uuidcomponents), 'urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6')
125
+
126
+ uuidcomponents = {
127
+ scheme: 'urn',
128
+ nid: undefined,
129
+ uuid: 'notauuid-7dec-11d0-a765-00a0c91e6bf6'
130
+ }
131
+ t.throws(() => { fastURI.serialize(uuidcomponents) }, 'URN without nid cannot be serialized')
132
+
125
133
  t.end()
126
134
  })
127
135
  test('URN NID Override', (t) => {
128
- let components = URI.parse('urn:foo:f81d4fae-7dec-11d0-a765-00a0c91e6bf6', { nid: 'uuid' })
136
+ let components = fastURI.parse('urn:foo:f81d4fae-7dec-11d0-a765-00a0c91e6bf6', { nid: 'uuid' })
129
137
  t.equal(components.error, undefined, 'errors')
130
138
  t.equal(components.scheme, 'urn', 'scheme')
131
139
  t.equal(components.path, undefined, 'path')
@@ -138,6 +146,6 @@ test('URN NID Override', (t) => {
138
146
  nid: 'foo',
139
147
  uuid: 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
140
148
  }
141
- t.equal(URI.serialize(components, { nid: 'uuid' }), 'urn:foo:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
149
+ t.equal(fastURI.serialize(components, { nid: 'uuid' }), 'urn:foo:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
142
150
  t.end()
143
151
  })
@@ -0,0 +1,33 @@
1
+ 'use strict'
2
+
3
+ const test = require('tape')
4
+ const fastURI = require('../')
5
+
6
+ const uriJsParseFixtures = require('./fixtures/uri-js-parse.json')
7
+ const uriJsSerializeFixtures = require('./fixtures/uri-js-serialize.json')
8
+
9
+ test('uri-js compatibility Parse', (t) => {
10
+ uriJsParseFixtures.forEach((
11
+ [value, expected]
12
+ ) => {
13
+ if (value === '//10.10.000.10') {
14
+ return t.skip('Skipping //10.10.000.10 as it is not a valid URI per URI spec: https://datatracker.ietf.org/doc/html/rfc5954#section-4.1')
15
+ }
16
+ if (value.slice(0, 6) === 'mailto') {
17
+ return t.skip('Skipping mailto schema test as it is not supported by fastifyURI')
18
+ }
19
+ t.same(JSON.parse(JSON.stringify(fastURI.parse(value))), expected, 'Compatibility parse: ' + value)
20
+ })
21
+ t.end()
22
+ })
23
+
24
+ test('uri-js compatibility serialize', (t) => {
25
+ uriJsSerializeFixtures.forEach(([value, expected]) => {
26
+ t.same(
27
+ fastURI.serialize(value),
28
+ expected,
29
+ 'Compatibility serialize: ' + JSON.stringify(value)
30
+ )
31
+ })
32
+ t.end()
33
+ })