mirror of
https://github.com/drawdb-io/drawdb.git
synced 2026-02-12 02:00:40 +08:00
Declutter utils
This commit is contained in:
12
src/utils/validateSchema.js
Normal file
12
src/utils/validateSchema.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Validator } from "jsonschema";
|
||||
import { ddbSchema, jsonSchema } from "../data/schemas";
|
||||
|
||||
function jsonDiagramIsValid(obj) {
|
||||
return new Validator().validate(obj, jsonSchema).valid;
|
||||
}
|
||||
|
||||
function ddbDiagramIsValid(obj) {
|
||||
return new Validator().validate(obj, ddbSchema).valid;
|
||||
}
|
||||
|
||||
export { jsonDiagramIsValid, ddbDiagramIsValid };
|
||||
Reference in New Issue
Block a user