UNPKG

aurelia-validatejs

Version:

This is a plugin that will allow using validate.js in your Aurelia application for expressive validation.

51 lines (38 loc) 1.72 kB
import {ValidationRule} from './validation-rule'; import {base} from './base-decorator'; export function length(targetOrConfig, key, descriptor) { return base(targetOrConfig, key, descriptor, ValidationRule.lengthRule); } export function presence(targetOrConfig, key, descriptor) { return base(targetOrConfig, key, descriptor, ValidationRule.presence, true); } export function required(targetOrConfig, key, descriptor) { return base(targetOrConfig, key, descriptor, ValidationRule.presence, true); } export function date(targetOrConfig, key, descriptor) { return base(targetOrConfig, key, descriptor, ValidationRule.date); } export function datetime(targetOrConfig, key, descriptor) { return base(targetOrConfig, key, descriptor, ValidationRule.datetime); } export function email(targetOrConfig, key, descriptor) { return base(targetOrConfig, key, descriptor, ValidationRule.email); } export function equality(targetOrConfig, key, descriptor) { return base(targetOrConfig, key, descriptor, ValidationRule.equality); } export function exclusion(targetOrConfig, key, descriptor) { return base(targetOrConfig, key, descriptor, ValidationRule.exclusion); } export function inclusion(targetOrConfig, key, descriptor) { return base(targetOrConfig, key, descriptor, ValidationRule.inclusion); } export function format(targetOrConfig, key, descriptor) { return base(targetOrConfig, key, descriptor, ValidationRule.format); } export function url(targetOrConfig, key, descriptor) { return base(targetOrConfig, key, descriptor, ValidationRule.url); } export function numericality(targetOrConfig, key, descriptor) { return base(targetOrConfig, key, descriptor, ValidationRule.numericality); }