UNPKG

fluent-ts-validator

Version:
27 lines 740 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const _1 = require("../shared/"); class WhenNotEmptyCondition { constructor(expression) { this.expression = expression; } shouldDoValidation(input) { const result = this.lambdaExprResultFor(input); if (_1.isIterable(result)) { return !_1.isIterableEmtpy(result); } else { return result ? true : false; } } lambdaExprResultFor(input) { try { return this.expression(input); } catch (e) { return void 0; } } } exports.WhenNotEmptyCondition = WhenNotEmptyCondition; //# sourceMappingURL=WhenNotEmptyCondition.js.map