@teamkeel/wasm 0.102.9 → 0.102.12
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/dist/index.d.ts +1 -0
- package/dist/index.js +10 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -7829,9 +7829,17 @@ var keel = () => {
|
|
|
7829
7829
|
const validate = (schemaString, opts) => __async(void 0, null, function* () {
|
|
7830
7830
|
const api = yield instantiate();
|
|
7831
7831
|
const result = api.validate(schemaString, opts);
|
|
7832
|
+
if (result.error) {
|
|
7833
|
+
return {
|
|
7834
|
+
errors: [result.error],
|
|
7835
|
+
type: result.type,
|
|
7836
|
+
ast: null
|
|
7837
|
+
};
|
|
7838
|
+
}
|
|
7832
7839
|
if (!result || !result.validationErrors) {
|
|
7833
7840
|
return {
|
|
7834
|
-
errors: [],
|
|
7841
|
+
errors: [result.error],
|
|
7842
|
+
type: result.type,
|
|
7835
7843
|
ast: null
|
|
7836
7844
|
};
|
|
7837
7845
|
}
|
|
@@ -7839,6 +7847,7 @@ var keel = () => {
|
|
|
7839
7847
|
const transformedErrors = (errors || []).map((err) => transformKeys_default(err));
|
|
7840
7848
|
return {
|
|
7841
7849
|
errors: transformedErrors,
|
|
7850
|
+
type: result.type,
|
|
7842
7851
|
ast
|
|
7843
7852
|
};
|
|
7844
7853
|
});
|