@toreda/strong-types
Version:
Better TypeScript code in fewer lines.
74 lines (72 loc) • 3.41 kB
JavaScript
"use strict";
/**
* MIT License
*
* Copyright (c) 2019 - 2021 Toreda, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.RuleBe = void 0;
const date_1 = require("../is/date");
const time_1 = require("../is/date/time");
const email_1 = require("../is/email");
const empty_1 = require("../is/empty");
const equal_1 = require("../is/equal");
const gt_1 = require("../is/gt");
const gte_1 = require("../is/gte");
const hex_color_code_1 = require("../is/hex-color-code");
const lt_1 = require("../is/lt");
const lte_1 = require("../is/lte");
const null_1 = require("../is/null");
const port_1 = require("../is/port");
const port_2 = require("../is/system/port");
const time_2 = require("../is/time");
const undefined_1 = require("../is/undefined");
const url_1 = require("../is/url");
const make_1 = require("../is/ipv4/addr/make");
const make_2 = require("../is/ipv6/addr/make");
/**
* Rule chain matcher node with equality and type validation operations
*
* @category Rules
*/
class RuleBe {
constructor(rule, mods) {
this.greaterThan = (0, gt_1.isGTMake)(this, rule, mods);
this.greaterThanOrEqual = (0, gte_1.isGTEMake)(this, rule, mods);
this.lessThan = (0, lt_1.isLTMake)(this, rule, mods);
this.lessThanOrEqual = (0, lte_1.isLTEMake)(this, rule, mods);
this.equalTo = (0, equal_1.isEqualMake)(this, rule, mods);
this.undefined = (0, undefined_1.isUndefinedMake)(this, rule, mods);
this.null = (0, null_1.isNullMake)(this, rule, mods);
this.empty = (0, empty_1.isEmptyMake)(this, rule, mods);
this.date = (0, date_1.isDateMake)(this, rule, mods);
this.time = (0, time_2.isTimeMake)(this, rule, mods);
this.hexColorCode = (0, hex_color_code_1.isHexColorCodeMake)(this, rule, mods);
this.email = (0, email_1.isEmailMake)(this, rule, mods);
this.url = (0, url_1.isUrlMake)(this, rule, mods);
this.dateTime = (0, time_1.isDateTimeMake)(this, rule, mods);
this.portNumber = (0, port_1.isPortMake)(this, rule, mods);
this.systemPortNumber = (0, port_2.isSystemPortMake)(this, rule, mods);
this.ipv4Addr = (0, make_1.isIpv4AddrMake)(this, rule, mods);
this.ipv6Addr = (0, make_2.isIpv6AddrMake)(this, rule, mods);
}
}
exports.RuleBe = RuleBe;