@toa.io/extensions.origins 0.20.0-dev.17 → 0.20.0-dev.19

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/extensions.origins",
3
- "version": "0.20.0-dev.17",
3
+ "version": "0.20.0-dev.19",
4
4
  "description": "Toa Origins",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -19,15 +19,15 @@
19
19
  "test": "echo \"Error: run tests from root\" && exit 1"
20
20
  },
21
21
  "dependencies": {
22
- "@toa.io/core": "0.20.0-dev.17",
23
- "@toa.io/generic": "0.20.0-dev.17",
24
- "@toa.io/schemas": "0.20.0-dev.17",
25
- "@toa.io/yaml": "0.20.0-dev.17",
22
+ "@toa.io/core": "0.20.0-dev.19",
23
+ "@toa.io/generic": "0.20.0-dev.19",
24
+ "@toa.io/schemas": "0.20.0-dev.19",
25
+ "@toa.io/yaml": "0.20.0-dev.19",
26
26
  "comq": "0.8.0",
27
27
  "node-fetch": "2.6.7"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node-fetch": "2.6.2"
31
31
  },
32
- "gitHead": "cafb719d8e80d3e78a00904dc6ab6d6b0d5b568b"
32
+ "gitHead": "e10214f746cf4fc699af42dba90e099487177a43"
33
33
  }
@@ -5,9 +5,14 @@
5
5
  */
6
6
  function check (reference) {
7
7
  if (typeof reference !== 'string') return // aspect properties object
8
- if (!URL.canParse(reference)) return
9
8
 
10
- const url = new URL(reference)
9
+ let url
10
+
11
+ try {
12
+ url = new URL(reference)
13
+ } catch {
14
+ return
15
+ }
11
16
 
12
17
  if (url.username !== '' || url.password !== '') throw new Error('Origins must not contain credentials. Please use environment secrets instead.')
13
18
  }
package/source/factory.js CHANGED
@@ -32,8 +32,6 @@ class Factory {
32
32
  continue
33
33
  }
34
34
 
35
- if (!URL.canParse(reference)) throw new Error(`${reference} is invalid URL`)
36
-
37
35
  const url = new URL(reference)
38
36
 
39
37
  if (protocol.protocols.includes(url.protocol)) protocolManifest[origin] = reference