obj-valid
Version:
This package can check is your object has correct structure without using typescript. As you know after transpilation interfaces disappear. If you want to check object structure on production or in clean javascript you can use this package.
20 lines • 674 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Schema = void 0;
var createSchema_1 = require("./createSchema");
var checkSchema_1 = require("./checkSchema");
var Schema = /** @class */ (function () {
function Schema(baseObj, ownSchema) {
if (ownSchema === void 0) { ownSchema = false; }
if (ownSchema)
this.schema = baseObj;
else
this.schema = createSchema_1.createSchema(baseObj);
}
Schema.prototype.check = function (obj) {
return checkSchema_1.checkSchema(this.schema, obj);
};
return Schema;
}());
exports.Schema = Schema;
//# sourceMappingURL=class.js.map