UNPKG

simple-body-validator

Version:

This package is inspired by Laravel validation, and aims to make body validation easier for Javascript developers

31 lines (30 loc) 821 B
'use strict'; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const baseRule_1 = __importDefault(require("./baseRule")); class NotIn extends baseRule_1.default { /** * Create a new NotIn rule instance. */ constructor(values) { super(); /** * The name of the rule. */ this.rule = 'not_in'; /** * The accepted values. */ this.values = []; this.values = values; } /** * Convert the rule to a validation string. */ toString() { return `${this.rule}:${this.values.join(',')}`; } } exports.default = NotIn;