js-formdata-validator
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -117,2 +117,4 @@ var g = Object.defineProperty; | ||
min({ value: t, fieldName: e, customValidatorErrorMessage: r }, a) { | ||
if (a === void 0) | ||
return "Please define the min value. Example min:26"; | ||
if (Number.isFinite(Number(t))) { | ||
@@ -137,2 +139,4 @@ const s = parseInt(t); | ||
max({ value: t, fieldName: e, customValidatorErrorMessage: r }, a) { | ||
if (a === void 0) | ||
return "Please define the max value. Example: max:26"; | ||
if (Number.isFinite(Number(t))) { | ||
@@ -162,3 +166,5 @@ const s = parseInt(t); | ||
const a = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}"; | ||
if (!new RegExp(`^${a}$`).test(t.toString())) | ||
if (!new RegExp(`^${a}$`).test( | ||
t && t.toString() | ||
)) | ||
return l({ | ||
@@ -176,3 +182,5 @@ fieldName: e, | ||
const a = "((([0-9a-fA-F]){1,4}):){7}([0-9a-fA-F]){1,4}"; | ||
if (!new RegExp(`^${a}$`).test(t.toString())) | ||
if (!new RegExp(`^${a}$`).test( | ||
t && t.toString() | ||
)) | ||
return l({ | ||
@@ -179,0 +187,0 @@ fieldName: e, |
@@ -7,3 +7,4 @@ import { BaseValidatorRule, CustomValidatorErrorMessage } from "./type"; | ||
}; | ||
export declare const baseValidatorErrorMessage: Record<keyof BaseValidatorRule, string>; | ||
export declare const validatorErrorMessage: (param: ValidatorErrorMessageParameter) => string; | ||
export {}; |
{ | ||
"name": "js-formdata-validator", | ||
"private": false, | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"type": "module", | ||
@@ -38,3 +38,3 @@ "main": "./dist/js-formdata-validator.umd.cjs", | ||
"eslint-config-prettier": "^8.5.0", | ||
"prettier": "2.8.2", | ||
"prettier": "2.8.3", | ||
"typescript": "^4.9.4", | ||
@@ -41,0 +41,0 @@ "vite": "^4.0.0", |
Sorry, the diff of this file is not supported yet
38770
800