variable-type
Version:
Runtime type checking for variable and similar objects.
28 lines • 803 B
JavaScript
;
/**
* Created by hustcc on 17/08/01.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var optional_1 = __importDefault(require("./types/optional"));
var Type = /** @class */ (function () {
function Type(type) {
var _this = this;
this.check = function (variable) {
try {
return _this.type(variable);
}
catch (_a) { }
return false;
};
this.optional = function () {
return optional_1.default(_this);
};
this.type = type;
}
return Type;
}());
exports.default = Type;
//# sourceMappingURL=Type.js.map