"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NonEmptyValidator = void 0;
/** Disallows undefined or whitespace */
class NonEmptyValidator {
    constructor(whyInvalid) {
        this.whyInvalid = whyInvalid;
    }
    isValid(candidate) {
        var _a;
        let result = { isValid: false };
        result.isValid = Boolean(candidate !== undefined && candidate.replace(/\s+/, "") !== "");
        if (!result.isValid) {
            result.reason = (_a = this.whyInvalid) !== null && _a !== void 0 ? _a : "Value must not be null or whitespace";
        }
        return result;
    }
}
exports.NonEmptyValidator = NonEmptyValidator;
//# sourceMappingURL=non-empty-validator.js.map