sensai
Version:
Because even AI needs a master
18 lines (17 loc) • 436 B
JavaScript
/**
* Validate data agains JSONSchema7 schema and coerce data types.
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "validateAndCoerce", {
enumerable: true,
get: function() {
return validateAndCoerce;
}
});
const validateAndCoerce = async (data, schema)=>{
if (!schema) return data;
// TODO should validate and coerce
return data;
};