identifier-js 0.0.10 → 0.0.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "identifier-js",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "A RFC3986 / RFC3987 compliant fast parser/validator/resolver/composer for NodeJS and browser.",
5
5
  "keywords": [
6
6
  "IRI",
@@ -6,6 +6,22 @@ describe('toAbsoluteReference', () => {
6
6
  expect(id.toAbsoluteReference('http://examplé.org/rosé#dasd')).to.equal('http://examplé.org/rosé');
7
7
  });
8
8
 
9
+ test('Base with empty path', () => {
10
+ expect(id.toAbsoluteReference('http://examplé.org')).to.equal('http://examplé.org');
11
+ });
12
+
13
+ test('Base witout authority', () => {
14
+ expect(id.toAbsoluteReference('http:/foo?bar#baz')).to.equal('http:/foo?bar');
15
+ });
16
+
17
+ test('Base witout authority and empty path', () => {
18
+ expect(id.toAbsoluteReference('http:?bar#baz')).to.equal('http:?bar');
19
+ });
20
+
21
+ test('Base witout authority or query and empty path', () => {
22
+ expect(id.toAbsoluteReference('http:#baz')).to.equal('http:');
23
+ });
24
+
9
25
  test('Scheme is required', () => {
10
26
  expect(() => id.toAbsoluteReference('//example.com/foo?bar#baz')).to.throw(Error, 'Invalid IRI: //example.com/foo?bar#baz');
11
27
  });
@@ -46,6 +46,10 @@ describe('isUri with hostnames', () => {
46
46
  expect(id.isUri('uri://exa=mple')).to.equal(true);
47
47
  });
48
48
 
49
+ test('Valid character - (unreserved) anywhere in uri reg_name', () => {
50
+ expect(id.isUri('iri://-exa-mple-')).to.equal(true);
51
+ });
52
+
49
53
  test('Valid character . multiple times (unreserved) in uri reg_name', () => {
50
54
  expect(id.isUri('uri://exa..mple')).to.equal(true);
51
55
  });
@@ -337,6 +341,10 @@ describe('isIri with hostnames', () => {
337
341
  expect(id.isIri('iri://exa=mple')).to.equal(true);
338
342
  });
339
343
 
344
+ test('Valid character - (unreserved) anywhere in iri reg_name', () => {
345
+ expect(id.isIri('iri://-exa-mple-')).to.equal(true);
346
+ });
347
+
340
348
  test('Valid character . multiple times (unreserved) in iri reg_name', () => {
341
349
  expect(id.isIri('iri://exa..mple')).to.equal(true);
342
350
  });