UNPKG

@hv-kit/hexpress

Version:

facilitates typescript backend development with express

27 lines 1 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetValidFormException = exports.GetValidForm = exports.ValidForm = void 0; const jon_1 = __importDefault(require("@hivi/jon/jon")); function ValidForm(schema, element) { return jon_1.default.Validator.isValid(schema, element); } exports.ValidForm = ValidForm; function GetValidForm(schema, element) { const result = jon_1.default.Validator.sanitize(schema, element); return result; } exports.GetValidForm = GetValidForm; function GetValidFormException(schema, element) { const result = jon_1.default.Validator.validate(schema, element); return result.error; } exports.GetValidFormException = GetValidFormException; exports.default = { ValidForm, GetValidForm, GetValidFormException, }; //# sourceMappingURL=forms.js.map