@silviejs/validator
Advanced tools
Comparing version 1.0.1 to 1.1.0
{ | ||
"name": "@silviejs/validator", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Silvie JS Validator", | ||
@@ -5,0 +5,0 @@ "typings": "bootstrap/index.d.ts", |
var _dec, _class; | ||
import { rule } from '../rule'; | ||
import { after } from 'validator'; | ||
import { isAfter } from 'validator'; | ||
let AfterRule = (_dec = rule('after'), _dec(_class = class AfterRule { | ||
validate(validator, name, value, key) { | ||
return after(value, key); | ||
return isAfter(value, key); | ||
} | ||
}) || _class); | ||
export { AfterRule as default }; |
var _dec, _class; | ||
import { rule } from '../rule'; | ||
import { before } from 'validator'; | ||
import { isBefore } from 'validator'; | ||
let BeforeRule = (_dec = rule('before'), _dec(_class = class BeforeRule { | ||
validate(validator, name, value, key) { | ||
return before(value, key); | ||
return isBefore(value, key); | ||
} | ||
}) || _class); | ||
export { BeforeRule as default }; |
import IValidationRule from '../rule'; | ||
import Validator from '../index'; | ||
export default class ConfirmedRule implements IValidationRule { | ||
validate(validator: Validator, name: string, value: any, confirmationName?: string): boolean; | ||
validate(validator: Validator, name: string, value: any, confirmationName: string): boolean; | ||
} |
import IValidationRule from '../rule'; | ||
import Validator from '../index'; | ||
export default class CreditCardRule implements IValidationRule { | ||
validate(validator: Validator, name: string, value: any, locale?: string): boolean; | ||
validate(validator: Validator, name: string, value: any, locale: string): boolean; | ||
} |
import IValidationRule from '../rule'; | ||
import Validator from '../index'; | ||
export default class DateRule implements IValidationRule { | ||
validate(validator: Validator, name: string, value: any, format?: string): boolean; | ||
validate(validator: Validator, name: string, value: any, format: string): boolean; | ||
} |
import IValidationRule from '../rule'; | ||
import Validator from '../index'; | ||
export default class DecimalRule implements IValidationRule { | ||
validate(validator: Validator, name: string, value: any, locale?: string): boolean; | ||
validate(validator: Validator, name: string, value: any, locale?: any): boolean; | ||
} |
@@ -6,5 +6,5 @@ var _dec, _class; | ||
validate(validator, name, value, divider) { | ||
return isDivisibleBy(value, divider); | ||
return isDivisibleBy(value, Number(divider)); | ||
} | ||
}) || _class); | ||
export { DivisibleByRule as default }; |
import IValidationRule from '../rule'; | ||
import Validator from '../index'; | ||
export default class HashRule implements IValidationRule { | ||
validate(validator: Validator, name: string, value: any, algorithm: string): boolean; | ||
validate(validator: Validator, name: string, value: any, algorithm: any): boolean; | ||
} |
import IValidationRule from '../rule'; | ||
import Validator from '../index'; | ||
export default class IdentityCardRule implements IValidationRule { | ||
validate(validator: Validator, name: string, value: any, locale: string): boolean; | ||
validate(validator: Validator, name: string, value: any, locale: any): boolean; | ||
} |
@@ -6,3 +6,3 @@ var _dec, _class; | ||
validate(validator, name, value, locale) { | ||
if (locale === 'fa_IR') { | ||
if (locale === 'fa-IR') { | ||
if (!/^\d{10}$/.test(value)) { | ||
@@ -9,0 +9,0 @@ return false; |
import IValidationRule from '../rule'; | ||
import Validator from '../index'; | ||
export default class IPRule implements IValidationRule { | ||
validate(validator: Validator, name: string, value: any, version?: string): boolean; | ||
validate(validator: Validator, name: string, value: any, version?: any): boolean; | ||
} |
import IValidationRule from '../rule'; | ||
import Validator from '../index'; | ||
export default class ISBNRule implements IValidationRule { | ||
validate(validator: Validator, name: string, value: any, version?: string): boolean; | ||
validate(validator: Validator, name: string, value: any, version?: any): boolean; | ||
} |
import IValidationRule from '../rule'; | ||
import Validator from '../index'; | ||
export default class JSONRule implements IValidationRule { | ||
validate(validator: Validator, name: string, value: any, allowPrimitives?: string): boolean; | ||
validate(validator: Validator, name: string, value: any): boolean; | ||
} |
@@ -5,8 +5,6 @@ var _dec, _class; | ||
let JSONRule = (_dec = rule('json'), _dec(_class = class JSONRule { | ||
validate(validator, name, value, allowPrimitives = 'false') { | ||
return isJSON(value, { | ||
allow_primitives: allowPrimitives && ['yes', 'true', '1'].includes(allowPrimitives) | ||
}); | ||
validate(validator, name, value) { | ||
return isJSON(value); | ||
} | ||
}) || _class); | ||
export { JSONRule as default }; |
import IValidationRule from '../rule'; | ||
import Validator from '../index'; | ||
export default class LatLngRule implements IValidationRule { | ||
validate(validator: Validator, name: string, value: any, checkDMS?: string): boolean; | ||
validate(validator: Validator, name: string, value: any): boolean; | ||
} |
@@ -5,8 +5,6 @@ var _dec, _class; | ||
let LatLngRule = (_dec = rule('latlng'), _dec(_class = class LatLngRule { | ||
validate(validator, name, value, checkDMS = 'false') { | ||
return isLatLong(value, { | ||
checkDMS: checkDMS && ['yes', 'true', '1'].includes(checkDMS) | ||
}); | ||
validate(validator, name, value) { | ||
return isLatLong(value); | ||
} | ||
}) || _class); | ||
export { LatLngRule as default }; |
import IValidationRule from '../rule'; | ||
import Validator from '../index'; | ||
export default class MobileRule implements IValidationRule { | ||
validate(validator: Validator, name: string, value: any, locale: string): boolean; | ||
validate(validator: Validator, name: string, value: any, locale: any): boolean; | ||
} |
import IValidationRule from '../rule'; | ||
import Validator from '../index'; | ||
export default class NumericRule implements IValidationRule { | ||
validate(validator: Validator, name: string, value: any, locale?: string, noSymbols?: string): boolean; | ||
validate(validator: Validator, name: string, value: any, locale: any, noSymbols?: string): boolean; | ||
} |
import IValidationRule from '../rule'; | ||
import Validator from '../index'; | ||
export default class PostalCodeRule implements IValidationRule { | ||
validate(validator: Validator, name: string, value: any, locale: string): boolean; | ||
validate(validator: Validator, name: string, value: any, locale: any): boolean; | ||
} |
import IValidationRule from '../rule'; | ||
import Validator from '../index'; | ||
export default class UUIDRule implements IValidationRule { | ||
validate(validator: Validator, name: string, value: any, version?: string): boolean; | ||
validate(validator: Validator, name: string, value: any, version: any): boolean; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61734
165
1651