UNPKG

simple-body-validator

Version:

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

27 lines (26 loc) 578 B
'use strict'; import BaseRule from './baseRule'; class NotIn extends BaseRule { /** * 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(',')}`; } } export default NotIn;