@toa.io/pointer 0.20.0-dev.1 → 0.20.0-dev.11

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": "@toa.io/pointer",
3
- "version": "0.20.0-dev.1",
3
+ "version": "0.20.0-dev.11",
4
4
  "description": "Toa Pointer",
5
5
  "homepage": "https://toa.io",
6
6
  "author": {
@@ -23,10 +23,10 @@
23
23
  },
24
24
  "main": "source/index.js",
25
25
  "dependencies": {
26
- "@toa.io/console": "0.6.0",
27
- "@toa.io/generic": "0.11.0-dev.3",
28
- "@toa.io/schemas": "0.20.0-dev.1",
29
- "@toa.io/yaml": "0.20.0-dev.1"
26
+ "@toa.io/console": "0.20.0-dev.11",
27
+ "@toa.io/generic": "0.20.0-dev.11",
28
+ "@toa.io/schemas": "0.20.0-dev.11",
29
+ "@toa.io/yaml": "0.20.0-dev.11"
30
30
  },
31
- "gitHead": "23a9b4399af908101aac4ae03f22f7b948dfe55f"
31
+ "gitHead": "8ccc0289a7af2dfb7fabf615f0a71bc8adf41b1c"
32
32
  }
@@ -4,7 +4,7 @@ const { normalize } = require('./normalize')
4
4
  const { validate } = require('./validate')
5
5
 
6
6
  /**
7
- * @param {toa.pointer.URIs} declaration
7
+ * @param {toa.pointer.URIs | string} declaration
8
8
  * @returns {toa.pointer.URIs}
9
9
  */
10
10
  const construct = (declaration) => {
@@ -10,7 +10,6 @@ definitions:
10
10
  $ref: '#/definitions/node'
11
11
  locator:
12
12
  type: string
13
- format: uri
14
13
 
15
14
  type: object
16
15
  patternProperties:
package/test/uris.test.js CHANGED
@@ -42,6 +42,14 @@ describe('construct', () => {
42
42
  expect(annotations['foo.bar']).toStrictEqual(url)
43
43
  })
44
44
 
45
+ it('should allow shards', () => {
46
+ const annotations = 'schema://host{1-2}-' + generate().toLowerCase()
47
+
48
+ construct(annotations)
49
+
50
+ expect(annotations).toStrictEqual(annotations)
51
+ })
52
+
45
53
  it('should allow dot notation with namespace value', () => {
46
54
  annotations.foo = gen()
47
55
  annotations['foo.bar'] = gen()
@@ -56,12 +64,6 @@ describe('construct', () => {
56
64
  expect(() => construct(1)).toThrow(TypeError)
57
65
  expect(() => construct(null)).toThrow(TypeError)
58
66
  })
59
-
60
- it('should throw if property is not url', () => {
61
- annotations.foo = 'not url'
62
-
63
- expect(() => construct(annotations)).toThrow(TypeError)
64
- })
65
67
  })
66
68
  })
67
69