fast-uri 1.0.0 → 1.0.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.
@@ -1,16 +1,13 @@
1
1
  version: 2
2
2
  updates:
3
- - package-ecosystem: github-actions
4
- directory: '/'
5
- ignore:
6
- - dependency-name: "actions/*"
7
- update-types:
8
- ["version-update:semver-minor", "version-update:semver-patch"]
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
9
5
  schedule:
10
- interval: daily
6
+ interval: "monthly"
11
7
  open-pull-requests-limit: 10
12
- - package-ecosystem: npm
13
- directory: '/'
8
+
9
+ - package-ecosystem: "npm"
10
+ directory: "/"
14
11
  schedule:
15
- interval: daily
12
+ interval: "weekly"
16
13
  open-pull-requests-limit: 10
package/benchmark.js CHANGED
@@ -4,48 +4,55 @@ const fasturi = require('./')
4
4
  const urijs = require('uri-js')
5
5
 
6
6
  const base = 'uri://a/b/c/d;p?q'
7
+
8
+ const domain = 'https://example.com/foo#bar$fiz'
9
+ const ipv4 = '//10.10.10.10'
10
+ const ipv6 = '//[2001:db8::7]'
11
+ const urn = 'urn:foo:a123,456'
12
+ const urnuuid = 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
13
+
7
14
  // Initialization as there is a lot to parse at first
8
15
  // eg: regexes
9
- fasturi.parse('https://example.com')
10
- urijs.parse('https://example.com')
16
+ fasturi.parse(domain)
17
+ urijs.parse(domain)
11
18
 
12
19
  suite.add('fast-uri: parse domain', function () {
13
- fasturi.parse('https://example.com')
20
+ fasturi.parse(domain)
14
21
  })
15
22
  suite.add('urijs: parse domain', function () {
16
- urijs.parse('https://example.com')
23
+ urijs.parse(domain)
17
24
  })
18
25
  suite.add('WHATWG URL: parse domain', function () {
19
26
  // eslint-disable-next-line
20
- new URL('https://example.com')
27
+ new URL(domain)
21
28
  })
22
29
  suite.add('fast-uri: parse IPv4', function () {
23
- fasturi.parse('//10.10.10.10')
30
+ fasturi.parse(ipv4)
24
31
  })
25
32
  suite.add('urijs: parse IPv4', function () {
26
- urijs.parse('//10.10.10.10')
33
+ urijs.parse(ipv4)
27
34
  })
28
35
  suite.add('fast-uri: parse IPv6', function () {
29
- fasturi.parse('//[2001:db8::7]')
36
+ fasturi.parse(ipv6)
30
37
  })
31
38
  suite.add('urijs: parse IPv6', function () {
32
- urijs.parse('//[2001:db8::7]')
39
+ urijs.parse(ipv6)
33
40
  })
34
41
  suite.add('fast-uri: parse URN', function () {
35
- fasturi.parse('urn:foo:a123,456')
42
+ fasturi.parse(urn)
36
43
  })
37
44
  suite.add('urijs: parse URN', function () {
38
- urijs.parse('urn:foo:a123,456')
45
+ urijs.parse(urn)
39
46
  })
40
47
  suite.add('WHATWG URL: parse URN', function () {
41
48
  // eslint-disable-next-line
42
- new URL('urn:foo:a123,456')
49
+ new URL(urn)
43
50
  })
44
51
  suite.add('fast-uri: parse URN uuid', function () {
45
- fasturi.parse('urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
52
+ fasturi.parse(urnuuid)
46
53
  })
47
54
  suite.add('urijs: parse URN uuid', function () {
48
- urijs.parse('urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
55
+ urijs.parse(urnuuid)
49
56
  })
50
57
  suite.add('fast-uri: serialize uri', function () {
51
58
  fasturi.serialize({
package/index.js CHANGED
@@ -274,10 +274,10 @@ function parse (uri, opts) {
274
274
  parsed.host = unescape(parsed.host)
275
275
  }
276
276
  if (parsed.path !== undefined && parsed.path.length) {
277
- parsed.path = escape(parsed.path)
277
+ parsed.path = encodeURI(parsed.path)
278
278
  }
279
279
  if (parsed.fragment !== undefined && parsed.fragment.length) {
280
- parsed.fragment = escape(parsed.fragment)
280
+ parsed.fragment = encodeURI(decodeURI(parsed.fragment))
281
281
  }
282
282
  }
283
283
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fast-uri",
3
3
  "description": "Dependency free RFC 3986 URI toolbox",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
7
7
  "types": "index.d.ts",
@@ -32,6 +32,9 @@ test('compatibility Parse', (t) => {
32
32
  '//[2606:2800:220:1:248:1893:25c8:1946:43209]',
33
33
  'http://foo.bar',
34
34
  'http://',
35
+ '#/$defs/stringMap',
36
+ '#/$defs/string%20Map',
37
+ '#/$defs/string Map',
35
38
  '//?json=%7B%22foo%22%3A%22bar%22%7D'
36
39
  // 'mailto:chris@example.com'-203845,
37
40
  // 'mailto:infobot@example.com?subject=current-issue',