@cloudflare/cabidela 0.2.3 → 0.2.4
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/CHANGELOG.md +6 -0
- package/dist/index.js +8 -1
- package/dist/index.mjs +8 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
@@ -55,6 +55,7 @@ var traverseSchema = (options, definitions, obj) => {
|
|
55
55
|
if (cb) {
|
56
56
|
cb(merge);
|
57
57
|
} else {
|
58
|
+
hits++;
|
58
59
|
Object.assign(obj2, merge);
|
59
60
|
delete obj2[key];
|
60
61
|
}
|
@@ -64,7 +65,13 @@ var traverseSchema = (options, definitions, obj) => {
|
|
64
65
|
const { $id, $path } = parse$ref(obj2[key]);
|
65
66
|
const { resolvedObject } = resolvePayload($path, definitions[$id]);
|
66
67
|
if (resolvedObject) {
|
67
|
-
cb
|
68
|
+
if (cb) {
|
69
|
+
cb(resolvedObject);
|
70
|
+
} else {
|
71
|
+
hits++;
|
72
|
+
Object.assign(obj2, resolvedObject);
|
73
|
+
delete obj2[key];
|
74
|
+
}
|
68
75
|
} else {
|
69
76
|
throw new Error(`Could not resolve '${obj2[key]}' $ref`);
|
70
77
|
}
|
package/dist/index.mjs
CHANGED
@@ -29,6 +29,7 @@ var traverseSchema = (options, definitions, obj) => {
|
|
29
29
|
if (cb) {
|
30
30
|
cb(merge);
|
31
31
|
} else {
|
32
|
+
hits++;
|
32
33
|
Object.assign(obj2, merge);
|
33
34
|
delete obj2[key];
|
34
35
|
}
|
@@ -38,7 +39,13 @@ var traverseSchema = (options, definitions, obj) => {
|
|
38
39
|
const { $id, $path } = parse$ref(obj2[key]);
|
39
40
|
const { resolvedObject } = resolvePayload($path, definitions[$id]);
|
40
41
|
if (resolvedObject) {
|
41
|
-
cb
|
42
|
+
if (cb) {
|
43
|
+
cb(resolvedObject);
|
44
|
+
} else {
|
45
|
+
hits++;
|
46
|
+
Object.assign(obj2, resolvedObject);
|
47
|
+
delete obj2[key];
|
48
|
+
}
|
42
49
|
} else {
|
43
50
|
throw new Error(`Could not resolve '${obj2[key]}' $ref`);
|
44
51
|
}
|
package/package.json
CHANGED