@toa.io/pointer 0.9.0-canary.2 → 0.20.0-dev.10
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 +6 -6
- package/source/uris/construct.js +1 -1
- package/source/uris/schema.yaml +0 -1
- package/test/uris.test.js +8 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/pointer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0-dev.10",
|
|
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.
|
|
27
|
-
"@toa.io/generic": "0.
|
|
28
|
-
"@toa.io/schemas": "0.
|
|
29
|
-
"@toa.io/yaml": "0.
|
|
26
|
+
"@toa.io/console": "0.20.0-dev.10",
|
|
27
|
+
"@toa.io/generic": "0.20.0-dev.10",
|
|
28
|
+
"@toa.io/schemas": "0.20.0-dev.10",
|
|
29
|
+
"@toa.io/yaml": "0.20.0-dev.10"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "cd3ffb1ae1af014f13a62ef9fc8ada58d8688e4a"
|
|
32
32
|
}
|
package/source/uris/construct.js
CHANGED
|
@@ -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) => {
|
package/source/uris/schema.yaml
CHANGED
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
|
|