shinkansen-transmission 2.1.15 → 2.2.2

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.
Files changed (82) hide show
  1. package/.husky/pre-commit +4 -0
  2. package/babel.config.js +1 -1
  3. package/index.js +6 -1
  4. package/lib/index.js +1 -1
  5. package/lib/transmission/common/index.js +1 -1
  6. package/lib/transmission/from-document-to-hash/index.js +1 -1
  7. package/lib/transmission/from-hash-to-document/index.js +1 -1
  8. package/lib/transmission/index.js +1 -1
  9. package/lib/transmission/to-zashiki/index.js +1 -1
  10. package/lib/transmission/to-zashiki/transform-root-schema.js +1 -1
  11. package/lib/transmission/to-zashiki/transform-schema.js +1 -1
  12. package/package.json +23 -30
  13. package/src/transmission/from-document-to-hash/index.js +75 -29
  14. package/src/transmission/from-hash-to-document/index.js +13 -10
  15. package/src/transmission/to-zashiki/transform-root-schema.js +143 -136
  16. package/src/transmission/to-zashiki/transform-schema.js +3256 -1952
  17. package/.github/dependabot.yml +0 -9
  18. package/test/transmission/common/index.spec.js +0 -1348
  19. package/test/transmission/from-document-to-hash/index.spec.js +0 -1866
  20. package/test/transmission/from-hash-to-document/index.spec.js +0 -1523
  21. package/test/transmission/to-zashiki/transform-root-schema/transforming-array-type-schemas.spec.js +0 -1784
  22. package/test/transmission/to-zashiki/transform-root-schema/transforming-boolean-type-schemas.spec.js +0 -334
  23. package/test/transmission/to-zashiki/transform-root-schema/transforming-null-type-schemas.spec.js +0 -253
  24. package/test/transmission/to-zashiki/transform-root-schema/transforming-number-type-schemas.spec.js +0 -565
  25. package/test/transmission/to-zashiki/transform-root-schema/transforming-object-type-schemas.spec.js +0 -1715
  26. package/test/transmission/to-zashiki/transform-root-schema/transforming-string-type-schemas.spec.js +0 -496
  27. package/test/transmission/to-zashiki/transform-root-schema/with-values/with-params/transforming-array-type-schemas.spec.js +0 -31633
  28. package/test/transmission/to-zashiki/transform-root-schema/with-values/with-params/transforming-boolean-type-schemas.spec.js +0 -359
  29. package/test/transmission/to-zashiki/transform-root-schema/with-values/with-params/transforming-null-type-schemas.spec.js +0 -359
  30. package/test/transmission/to-zashiki/transform-root-schema/with-values/with-params/transforming-number-type-schemas.spec.js +0 -446
  31. package/test/transmission/to-zashiki/transform-root-schema/with-values/with-params/transforming-object-type-schemas.spec.js +0 -8348
  32. package/test/transmission/to-zashiki/transform-root-schema/with-values/with-params/transforming-string-type-schemas.spec.js +0 -446
  33. package/test/transmission/to-zashiki/transform-root-schema/with-values/without-params/transforming-array-type-schemas.spec.js +0 -30373
  34. package/test/transmission/to-zashiki/transform-root-schema/with-values/without-params/transforming-boolean-type-schemas.spec.js +0 -334
  35. package/test/transmission/to-zashiki/transform-root-schema/with-values/without-params/transforming-null-type-schemas.spec.js +0 -253
  36. package/test/transmission/to-zashiki/transform-root-schema/with-values/without-params/transforming-number-type-schemas.spec.js +0 -421
  37. package/test/transmission/to-zashiki/transform-root-schema/with-values/without-params/transforming-object-type-schemas.spec.js +0 -7826
  38. package/test/transmission/to-zashiki/transform-root-schema/with-values/without-params/transforming-string-type-schemas.spec.js +0 -421
  39. package/test/transmission/to-zashiki/transform-root-schema/without-values/with-params/transforming-array-type-schemas.spec.js +0 -31111
  40. package/test/transmission/to-zashiki/transform-root-schema/without-values/with-params/transforming-boolean-type-schemas.spec.js +0 -347
  41. package/test/transmission/to-zashiki/transform-root-schema/without-values/with-params/transforming-null-type-schemas.spec.js +0 -344
  42. package/test/transmission/to-zashiki/transform-root-schema/without-values/with-params/transforming-number-type-schemas.spec.js +0 -434
  43. package/test/transmission/to-zashiki/transform-root-schema/without-values/with-params/transforming-object-type-schemas.spec.js +0 -8222
  44. package/test/transmission/to-zashiki/transform-root-schema/without-values/with-params/transforming-string-type-schemas.spec.js +0 -434
  45. package/test/transmission/to-zashiki/transform-root-schema/without-values/without-params/transforming-array-type-schemas.spec.js +0 -29494
  46. package/test/transmission/to-zashiki/transform-root-schema/without-values/without-params/transforming-boolean-type-schemas.spec.js +0 -312
  47. package/test/transmission/to-zashiki/transform-root-schema/without-values/without-params/transforming-null-type-schemas.spec.js +0 -309
  48. package/test/transmission/to-zashiki/transform-root-schema/without-values/without-params/transforming-number-type-schemas.spec.js +0 -399
  49. package/test/transmission/to-zashiki/transform-root-schema/without-values/without-params/transforming-object-type-schemas.spec.js +0 -7584
  50. package/test/transmission/to-zashiki/transform-root-schema/without-values/without-params/transforming-string-type-schemas.spec.js +0 -398
  51. package/test/transmission/to-zashiki/transform-root-schema.spec.js +0 -22
  52. package/test/transmission/to-zashiki/transform-schema/transforming-array-type-schemas.spec.js +0 -1806
  53. package/test/transmission/to-zashiki/transform-schema/transforming-boolean-type-schemas.spec.js +0 -340
  54. package/test/transmission/to-zashiki/transform-schema/transforming-null-type-schemas.spec.js +0 -259
  55. package/test/transmission/to-zashiki/transform-schema/transforming-number-type-schemas.spec.js +0 -571
  56. package/test/transmission/to-zashiki/transform-schema/transforming-object-type-schemas.spec.js +0 -1737
  57. package/test/transmission/to-zashiki/transform-schema/transforming-string-type-schemas.spec.js +0 -502
  58. package/test/transmission/to-zashiki/transform-schema/with-values/with-params/transforming-array-type-schemas.spec.js +0 -32173
  59. package/test/transmission/to-zashiki/transform-schema/with-values/with-params/transforming-boolean-type-schemas.spec.js +0 -377
  60. package/test/transmission/to-zashiki/transform-schema/with-values/with-params/transforming-null-type-schemas.spec.js +0 -377
  61. package/test/transmission/to-zashiki/transform-schema/with-values/with-params/transforming-number-type-schemas.spec.js +0 -464
  62. package/test/transmission/to-zashiki/transform-schema/with-values/with-params/transforming-object-type-schemas.spec.js +0 -8525
  63. package/test/transmission/to-zashiki/transform-schema/with-values/with-params/transforming-string-type-schemas.spec.js +0 -464
  64. package/test/transmission/to-zashiki/transform-schema/with-values/without-params/transforming-array-type-schemas.spec.js +0 -30910
  65. package/test/transmission/to-zashiki/transform-schema/with-values/without-params/transforming-boolean-type-schemas.spec.js +0 -352
  66. package/test/transmission/to-zashiki/transform-schema/with-values/without-params/transforming-null-type-schemas.spec.js +0 -271
  67. package/test/transmission/to-zashiki/transform-schema/with-values/without-params/transforming-number-type-schemas.spec.js +0 -439
  68. package/test/transmission/to-zashiki/transform-schema/with-values/without-params/transforming-object-type-schemas.spec.js +0 -8003
  69. package/test/transmission/to-zashiki/transform-schema/with-values/without-params/transforming-string-type-schemas.spec.js +0 -439
  70. package/test/transmission/to-zashiki/transform-schema/without-values/with-params/transforming-array-type-schemas.spec.js +0 -31654
  71. package/test/transmission/to-zashiki/transform-schema/without-values/with-params/transforming-boolean-type-schemas.spec.js +0 -365
  72. package/test/transmission/to-zashiki/transform-schema/without-values/with-params/transforming-null-type-schemas.spec.js +0 -362
  73. package/test/transmission/to-zashiki/transform-schema/without-values/with-params/transforming-number-type-schemas.spec.js +0 -452
  74. package/test/transmission/to-zashiki/transform-schema/without-values/with-params/transforming-object-type-schemas.spec.js +0 -8399
  75. package/test/transmission/to-zashiki/transform-schema/without-values/with-params/transforming-string-type-schemas.spec.js +0 -452
  76. package/test/transmission/to-zashiki/transform-schema/without-values/without-params/transforming-array-type-schemas.spec.js +0 -29671
  77. package/test/transmission/to-zashiki/transform-schema/without-values/without-params/transforming-boolean-type-schemas.spec.js +0 -320
  78. package/test/transmission/to-zashiki/transform-schema/without-values/without-params/transforming-null-type-schemas.spec.js +0 -317
  79. package/test/transmission/to-zashiki/transform-schema/without-values/without-params/transforming-number-type-schemas.spec.js +0 -407
  80. package/test/transmission/to-zashiki/transform-schema/without-values/without-params/transforming-object-type-schemas.spec.js +0 -7645
  81. package/test/transmission/to-zashiki/transform-schema/without-values/without-params/transforming-string-type-schemas.spec.js +0 -406
  82. package/test/transmission/to-zashiki/transform-schema.spec.js +0 -777
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shinkansen-transmission",
3
- "version": "2.1.15",
3
+ "version": "2.2.2",
4
4
  "description": "Shinkansen Transmission",
5
5
  "keywords": [
6
6
  "Shinkansen",
@@ -22,50 +22,43 @@
22
22
  "scripts": {
23
23
  "prepublishOnly": "cross-env NODE_ENV=production npm run build",
24
24
  "prebuild": "npm run clean",
25
- "build": "npm run babel",
25
+ "build": "cross-env DEBUG=shinkansen-transmission npm run babel",
26
26
  "build:watch": "npm run babel:watch",
27
27
  "clean": "rimraf lib",
28
28
  "babel": "babel src -d lib",
29
29
  "babel:watch": "npm run babel -- -w",
30
30
  "lint": "eslint .",
31
31
  "lint:fix": "npm run lint -- --fix",
32
- "test": "NODE_ENV=test mocha -r @babel/register -r @babel/polyfill test --recursive --verbose",
32
+ "test": "NODE_ENV=test mocha -r @babel/register test --recursive --verbose",
33
33
  "coverage": "nyc --reporter=lcov npm run test",
34
34
  "pre-commit": "npm run lint && npm run coverage && npm run build && git add lib"
35
35
  },
36
36
  "dependencies": {
37
- "debug": "^4.2.0",
37
+ "debug": "^4.3.2",
38
38
  "fast-deep-equal": "^3.1.3"
39
39
  },
40
40
  "devDependencies": {
41
- "@babel/cli": "^7.12.1",
42
- "@babel/core": "^7.12.3",
43
- "@babel/eslint-parser": "^7.12.1",
44
- "@babel/plugin-proposal-export-default-from": "^7.12.1",
45
- "@babel/plugin-proposal-export-namespace-from": "^7.12.1",
46
- "@babel/polyfill": "^7.12.1",
47
- "@babel/preset-env": "^7.12.1",
48
- "@babel/register": "^7.12.1",
49
- "babel-loader": "^8.1.0",
50
- "babel-plugin-module-resolver": "^4.0.0",
51
- "chai": "^4.2.0",
52
- "core-js": "^3.6.5",
53
- "cross-env": "^7.0.2",
54
- "eslint": "^7.11.0",
55
- "eslint-config-standard": "^14.1.1",
56
- "eslint-import-resolver-babel-module": "^5.2.0",
57
- "eslint-plugin-import": "^2.22.1",
41
+ "@babel/cli": "^7.15.4",
42
+ "@babel/core": "^7.15.5",
43
+ "@babel/eslint-parser": "^7.15.4",
44
+ "@babel/plugin-proposal-export-default-from": "^7.14.5",
45
+ "@babel/plugin-proposal-export-namespace-from": "^7.14.5",
46
+ "@babel/preset-env": "^7.15.6",
47
+ "@babel/register": "^7.15.3",
48
+ "babel-loader": "^8.2.2",
49
+ "babel-plugin-module-resolver": "^4.1.0",
50
+ "chai": "^4.3.4",
51
+ "core-js": "^3.17.3",
52
+ "cross-env": "^7.0.3",
53
+ "eslint": "^7.32.0",
54
+ "eslint-config-standard": "^16.0.3",
55
+ "eslint-import-resolver-babel-module": "^5.3.1",
56
+ "eslint-plugin-import": "^2.24.2",
58
57
  "eslint-plugin-node": "^11.1.0",
59
- "eslint-plugin-promise": "^4.2.1",
60
- "eslint-plugin-standard": "^4.0.1",
61
- "husky": "^4.3.0",
62
- "mocha": "^8.2.0",
58
+ "eslint-plugin-promise": "^5.1.0",
59
+ "husky": "^7.0.2",
60
+ "mocha": "^9.1.1",
63
61
  "nyc": "^15.1.0",
64
62
  "rimraf": "^3.0.2"
65
- },
66
- "husky": {
67
- "hooks": {
68
- "pre-commit": "npm run pre-commit"
69
- }
70
63
  }
71
64
  }
@@ -20,22 +20,30 @@ import {
20
20
 
21
21
  const log = debug('shinkansen-transmission:from-document-to-hash')
22
22
 
23
+ log('`shinkansen-transmission` is awake')
24
+
23
25
  function findByKey (parentUri, uri) {
26
+ /*
27
+ * log('findByKey')
28
+ */
24
29
  return function find (key) {
25
- return uri === getUri(parentUri, key)
30
+ /*
31
+ * log('find')
32
+ */
33
+ return getUri(parentUri, key) === uri
26
34
  }
27
35
  }
28
36
 
29
37
  function findByIndex (parentUri, uri) {
38
+ /*
39
+ * log('findByIndex')
40
+ */
30
41
  return function find (schema, index) {
31
42
  /*
32
- * log('findByIndex')
43
+ * log('find')
33
44
  */
34
-
35
45
  if (hasEnum(schema)) {
36
- // const array = getEnum(schema)
37
-
38
- // return array.find(findByIndex(parentUri, uri))
46
+ return getUri(parentUri, index) === uri
39
47
  } else {
40
48
  if (hasAnyOf(schema)) {
41
49
  const array = getAnyOf(schema)
@@ -55,30 +63,40 @@ function findByIndex (parentUri, uri) {
55
63
  }
56
64
 
57
65
  function findByValue (value) {
66
+ /*
67
+ * log('findByValue')
68
+ */
58
69
  return function find (schema) {
59
70
  /*
60
- * log('findByValue')
71
+ * log('find')
61
72
  */
62
-
63
73
  return value === transformValue(schema)
64
74
  }
65
75
  }
66
76
 
67
77
  function findByEqual (value) {
78
+ /*
79
+ * log('findByEqual')
80
+ */
68
81
  return function find (schema) {
82
+ /*
83
+ * log('find')
84
+ */
69
85
  return equal(value, transformValue(schema))
70
86
  }
71
87
  }
72
88
 
73
89
  function toString (value) {
90
+ /*
91
+ * log('toString')
92
+ */
74
93
  return (value !== undefined) ? String(value) : ''
75
94
  }
76
95
 
77
- export function getObject ({ properties = {} /* object */ } = {}, parentUri, uri) {
96
+ export function getObject ({ properties = {} /* object */ } = {}, parentUri = '', uri = '') {
78
97
  /*
79
98
  * log('getObject')
80
99
  */
81
-
82
100
  return (
83
101
  Reflect.get(properties, (
84
102
  Object.keys(properties)
@@ -87,21 +105,19 @@ export function getObject ({ properties = {} /* object */ } = {}, parentUri, uri
87
105
  )
88
106
  }
89
107
 
90
- export function getArray ({ items = {} /* array or object */ } = {}, parentUri, uri) {
108
+ export function getArray ({ items = {} /* array or object */ } = {}, parentUri = '', uri = '') {
91
109
  /*
92
110
  * log('getArray')
93
111
  */
94
-
95
112
  return (isArray(items))
96
113
  ? items.find(findByIndex(parentUri, uri))
97
114
  : items
98
115
  }
99
116
 
100
- export function getSchema (schema = {}, parentUri, uri) {
117
+ export function getSchema (schema = {}, parentUri = '', uri = '') {
101
118
  /*
102
119
  * log('getSchema')
103
120
  */
104
-
105
121
  const { type } = schema
106
122
 
107
123
  switch (type) {
@@ -127,6 +143,9 @@ export const transformValue = (schema) => (
127
143
  )
128
144
 
129
145
  export function transformValueIndexFor (array, value) {
146
+ /*
147
+ * log('transformValueIndexFor')
148
+ */
130
149
  const find = findByValue(value)
131
150
 
132
151
  if (array.some(find)) {
@@ -145,6 +164,9 @@ export function transformValueIndexFor (array, value) {
145
164
  }
146
165
 
147
166
  export function transformEqualIndexFor (array, value) {
167
+ /*
168
+ * log('transformEqualIndexFor')
169
+ */
148
170
  const find = findByEqual(value)
149
171
 
150
172
  if (array.some(find)) {
@@ -166,7 +188,6 @@ export function transformArrayFor (document, schema, values, params, parentUri,
166
188
  /*
167
189
  * log('transformArrayFor')
168
190
  */
169
-
170
191
  return (
171
192
  document
172
193
  .reduce((values, value, index) => {
@@ -181,7 +202,6 @@ export function transformObjectFor (document, schema, values, params, parentUri,
181
202
  /*
182
203
  * log('transformObjectFor')
183
204
  */
184
-
185
205
  return (
186
206
  Object.entries(document)
187
207
  .reduce((values, [key, value]) => {
@@ -200,17 +220,23 @@ export function transformArray (document, schema, values, params, parentUri, uri
200
220
  if (hasEnum(schema)) {
201
221
  const array = getEnum(schema)
202
222
 
203
- return { ...values, [uri]: document.map((value) => transformValueIndexFor(array, value)) }
223
+ values[uri] = document.map((value) => transformValueIndexFor(array, value))
224
+
225
+ return values
204
226
  } else {
205
227
  if (hasAnyOf(schema)) {
206
228
  const array = getAnyOf(schema)
207
229
 
208
- return { ...values, [uri]: document.map((value) => transformValueIndexFor(array, value)) }
230
+ values[uri] = document.map((value) => transformValueIndexFor(array, value))
231
+
232
+ return values
209
233
  } else {
210
234
  if (hasOneOf(schema)) {
211
235
  const array = getOneOf(schema)
212
236
 
213
- return { ...values, [uri]: document.map((value) => transformValueIndexFor(array, value)) }
237
+ values[uri] = document.map((value) => transformValueIndexFor(array, value))
238
+
239
+ return values
214
240
  } else {
215
241
  const { items = {} } = schema
216
242
 
@@ -227,17 +253,23 @@ export function transformArray (document, schema, values, params, parentUri, uri
227
253
  if (hasEnum(items)) {
228
254
  const array = getEnum(items)
229
255
 
230
- return { ...values, [uri]: document.map((value) => transformValueIndexFor(array, value)) }
256
+ values[uri] = document.map((value) => transformValueIndexFor(array, value))
257
+
258
+ return values
231
259
  } else {
232
260
  if (hasAnyOf(items)) {
233
261
  const array = getAnyOf(items)
234
262
 
235
- return { ...values, [uri]: document.map((value) => transformValueIndexFor(array, value)) }
263
+ values[uri] = document.map((value) => transformValueIndexFor(array, value))
264
+
265
+ return values
236
266
  } else {
237
267
  if (hasOneOf(items)) {
238
268
  const array = getOneOf(items)
239
269
 
240
- return { ...values, [uri]: document.map((value) => transformValueIndexFor(array, value)) }
270
+ values[uri] = document.map((value) => transformValueIndexFor(array, value))
271
+
272
+ return values
241
273
  }
242
274
  }
243
275
  }
@@ -261,17 +293,23 @@ export function transformObject (document, schema, values, params, parentUri, ur
261
293
  if (hasEnum(schema)) {
262
294
  const array = getEnum(schema)
263
295
 
264
- return { ...values, [uri]: transformEqualIndexFor(array, document) }
296
+ values[uri] = transformEqualIndexFor(array, document)
297
+
298
+ return values
265
299
  } else {
266
300
  if (hasAnyOf(schema)) {
267
301
  const array = getAnyOf(schema)
268
302
 
269
- return { ...values, [uri]: transformEqualIndexFor(array, document) }
303
+ values[uri] = transformEqualIndexFor(array, document)
304
+
305
+ return values
270
306
  } else {
271
307
  if (hasOneOf(schema)) {
272
308
  const array = getOneOf(schema)
273
309
 
274
- return { ...values, [uri]: transformEqualIndexFor(array, document) }
310
+ values[uri] = transformEqualIndexFor(array, document)
311
+
312
+ return values
275
313
  }
276
314
  }
277
315
  }
@@ -306,17 +344,23 @@ export default function transform (document, schema = {}, values = {}, params =
306
344
  if (hasEnum(schema)) {
307
345
  const items = getEnum(schema)
308
346
 
309
- return { ...values, [uri]: transformValueIndexFor(items, document) }
347
+ values[uri] = transformValueIndexFor(items, document)
348
+
349
+ return values
310
350
  } else {
311
351
  if (hasAnyOf(schema)) {
312
352
  const items = getAnyOf(schema)
313
353
 
314
- return { ...values, [uri]: transformValueIndexFor(items, document) }
354
+ values[uri] = transformValueIndexFor(items, document)
355
+
356
+ return values
315
357
  } else {
316
358
  if (hasOneOf(schema)) {
317
359
  const items = getOneOf(schema)
318
360
 
319
- return { ...values, [uri]: transformValueIndexFor(items, document) }
361
+ values[uri] = transformValueIndexFor(items, document)
362
+
363
+ return values
320
364
  }
321
365
  }
322
366
  }
@@ -326,5 +370,7 @@ export default function transform (document, schema = {}, values = {}, params =
326
370
  /*
327
371
  * The hash should contain only strings
328
372
  */
329
- return { ...values, [uri]: toString(document) }
373
+ values[uri] = toString(document)
374
+
375
+ return values
330
376
  }
@@ -16,8 +16,9 @@ import {
16
16
  getUri
17
17
  } from 'shinkansen-transmission/transmission/common'
18
18
 
19
- const log = debug('shinkansen-transmission:from-hash-to-document:log')
20
- const error = debug('shinkansen-transmission:from-hash-to-document:error')
19
+ const log = debug('shinkansen-transmission:from-hash-to-document')
20
+
21
+ log('`shinkansen-transmission` is awake')
21
22
 
22
23
  export function toNull (v) {
23
24
  if (v === null || v === 'null') return null
@@ -78,7 +79,7 @@ export function transformValueFor (value, array) {
78
79
  return transformValue(v)
79
80
  }
80
81
  } catch ({ message = 'No error message defined' }) {
81
- error(message)
82
+ log(message)
82
83
  }
83
84
 
84
85
  /*
@@ -87,7 +88,7 @@ export function transformValueFor (value, array) {
87
88
  return value
88
89
  }
89
90
 
90
- export function getArrayFor (values, array = [], uri) {
91
+ export function getArrayFor (values, array = [], uri = '#') {
91
92
  /*
92
93
  * log('getArrayFor')
93
94
  */
@@ -102,7 +103,7 @@ export function getArrayFor (values, array = [], uri) {
102
103
  return []
103
104
  }
104
105
 
105
- export function transformArrayFor (values, { items = null }, parentUri, uri) {
106
+ export function transformArrayFor (values, { items = null } = {}, parentUri = '#', uri = getUri(parentUri)) {
106
107
  /*
107
108
  * log('transformArrayFor')
108
109
  */
@@ -118,7 +119,7 @@ export function transformArrayFor (values, { items = null }, parentUri, uri) {
118
119
  return []
119
120
  }
120
121
 
121
- export function transformObjectFor (values, { properties = null }, parentUri, uri) {
122
+ export function transformObjectFor (values, { properties = null } = {}, parentUri = '#', uri = getUri(parentUri)) {
122
123
  /*
123
124
  * log('transformObjectFor')
124
125
  */
@@ -130,7 +131,9 @@ export function transformObjectFor (values, { properties = null }, parentUri, ur
130
131
  .reduce((accumulator, [key, schema]) => {
131
132
  const schemaUri = getUri(parentUri, key)
132
133
 
133
- return ({ ...accumulator, [key]: transform(values, schema, schemaUri, schemaUri) })
134
+ accumulator[key] = transform(values, schema, schemaUri, schemaUri)
135
+
136
+ return accumulator
134
137
  }, {})
135
138
  )
136
139
  }
@@ -138,7 +141,7 @@ export function transformObjectFor (values, { properties = null }, parentUri, ur
138
141
  return {}
139
142
  }
140
143
 
141
- export function transformItemsArrayFor (values, items = [], parentUri, uri) {
144
+ export function transformItemsArrayFor (values, items = [], parentUri = '#', uri = getUri(parentUri)) {
142
145
  /*
143
146
  * log('transformItemsArrayFor')
144
147
  */
@@ -170,7 +173,7 @@ export function transformItemsArrayFor (values, items = [], parentUri, uri) {
170
173
  )
171
174
  }
172
175
 
173
- export function transformItemsObjectFor (values, items = {}, parentUri, uri) {
176
+ export function transformItemsObjectFor (values, items = {}, parentUri = '#', uri = getUri(parentUri)) {
174
177
  /*
175
178
  * log('transformItemsObjectFor')
176
179
  */
@@ -202,7 +205,7 @@ export function transformItemsObjectFor (values, items = {}, parentUri, uri) {
202
205
  )
203
206
  }
204
207
 
205
- const handleError = ({ message = 'No error message defined' }) => error(message)
208
+ const handleError = ({ message = 'No error message defined' }) => log(message)
206
209
 
207
210
  // https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6
208
211
  export function transformObjectSchemaNull (values, schema, { uri: parentUri, key: fieldKey }, uri = getUri(parentUri, fieldKey)) {