@toa.io/userland 0.22.0 → 0.23.0-dev.0

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,14 +1,15 @@
1
1
  'use strict'
2
2
 
3
- const { Nope } = require('nopeable')
4
-
5
3
  async function computation (_, context) {
6
4
  const response = await context.http.dev.path.to.resource.get()
7
5
  const type = response.headers.get('content-type')
8
6
 
9
- if (type !== 'application/json') return new Nope(0, 'Unsupported media type ' + type)
7
+ if (type !== 'application/json')
8
+ return ERR_UNSUPPORTED_MEDIA_TYPE
10
9
 
11
10
  return await response.json()
12
11
  }
13
12
 
13
+ const ERR_UNSUPPORTED_MEDIA_TYPE = new Error('UNSUPPORTED_MEDIA_TYPE')
14
+
14
15
  exports.computation = computation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/userland",
3
- "version": "0.22.0",
3
+ "version": "0.23.0-dev.0",
4
4
  "description": "Toa development kit",
5
5
  "homepage": "https://toa.io",
6
6
  "author": {
@@ -16,7 +16,7 @@
16
16
  "url": "https://github.com/toa-io/toa/issues"
17
17
  },
18
18
  "engines": {
19
- "node": ">= 12.0.0"
19
+ "node": ">= 18.0.0"
20
20
  },
21
21
  "publishConfig": {
22
22
  "access": "public"
@@ -24,15 +24,15 @@
24
24
  "main": "src/index.js",
25
25
  "types": "types/index.d.ts",
26
26
  "dependencies": {
27
- "@toa.io/boot": "0.22.0",
28
- "@toa.io/core": "0.22.0",
29
- "@toa.io/filesystem": "0.22.0",
30
- "@toa.io/generic": "0.22.0",
31
- "@toa.io/norm": "0.22.0",
32
- "@toa.io/schemas": "0.22.0",
27
+ "@toa.io/boot": "0.23.0-dev.0",
28
+ "@toa.io/core": "0.23.0-dev.0",
29
+ "@toa.io/filesystem": "0.23.0-dev.0",
30
+ "@toa.io/generic": "0.23.0-dev.0",
31
+ "@toa.io/norm": "0.23.0-dev.0",
32
+ "@toa.io/schemas": "0.23.0-dev.0",
33
33
  "@toa.io/storages.null": "0.22.0",
34
- "@toa.io/yaml": "0.22.0",
34
+ "@toa.io/yaml": "0.23.0-dev.0",
35
35
  "tap": "16.3.4"
36
36
  },
37
- "gitHead": "c463348c8eb54a43f7755ec8aeba9acafb56d53b"
37
+ "gitHead": "19d4af8ff3b8a1a8f191644f44113c88de4bb404"
38
38
  }