UNPKG

simple-body-validator

Version:

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

26 lines (25 loc) 550 B
import BaseRule from './baseRule'; class In extends BaseRule { /** * Create a new In rule instance. */ constructor(values) { super(); /** * The name of the rule. */ this.rule = '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 In;