Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vee-validate/rules

Package Overview
Dependencies
Maintainers
1
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vee-validate/rules - npm Package Compare versions

Comparing version 4.1.20 to 4.2.0

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

# [4.2.0](https://github.com/logaretm/vee-validate/compare/v4.1.20...v4.2.0) (2021-02-24)
**Note:** Version bump only for package @vee-validate/rules
## [4.1.20](https://github.com/logaretm/vee-validate/compare/v4.1.19...v4.1.20) (2021-02-24)

@@ -8,0 +16,0 @@

95

dist/vee-validate-rules.esm.js
/**
* vee-validate v4.1.20
* vee-validate v4.2.0
* (c) 2021 Abdelrahman Awad

@@ -106,3 +106,19 @@ * @license MIT

function getSingleParam(params, paramName) {
return Array.isArray(params) ? params[0] : params[paramName];
}
function isEmpty(value) {
if (value === null || value === undefined || value === '') {
return true;
}
if (Array.isArray(value) && value.length === 0) {
return true;
}
return false;
}
const alphaValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const locale = getLocale(params);

@@ -121,2 +137,5 @@ if (Array.isArray(value)) {

const alphaDashValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const locale = getLocale(params);

@@ -135,2 +154,5 @@ if (Array.isArray(value)) {

const alphaNumValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const locale = getLocale(params);

@@ -149,2 +171,5 @@ if (Array.isArray(value)) {

const alphaSpacesValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const locale = getLocale(params);

@@ -175,2 +200,5 @@ if (Array.isArray(value)) {

const betweenValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const { min, max } = getParams(params);

@@ -184,6 +212,2 @@ if (Array.isArray(value)) {

function getSingleParam(params, paramName) {
return Array.isArray(params) ? params[0] : params[paramName];
}
const confirmedValidator = (value, params) => {

@@ -195,2 +219,5 @@ const target = getSingleParam(params, 'target');

const digitsValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const length = getSingleParam(params, 'length');

@@ -227,3 +254,3 @@ if (Array.isArray(value)) {

const dimensionsValidator = (files, params) => {
if (!files) {
if (isEmpty(files)) {
return true;

@@ -247,2 +274,5 @@ }

const emailValidator = (value) => {
if (isEmpty(value)) {
return true;
}
// eslint-disable-next-line

@@ -257,8 +287,8 @@ const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;

const extValidator = (files, extensions) => {
if (isEmpty(files)) {
return true;
}
if (!extensions) {
extensions = [];
}
if (!files) {
return true;
}
const regex = new RegExp(`.(${extensions.join('|')})$`, 'i');

@@ -272,6 +302,6 @@ if (Array.isArray(files)) {

const imageValidator = (files) => {
const regex = /\.(jpg|svg|jpeg|png|bmp|gif|webp)$/i;
if (!files) {
if (isEmpty(files)) {
return true;
}
const regex = /\.(jpg|svg|jpeg|png|bmp|gif|webp)$/i;
if (Array.isArray(files)) {

@@ -284,2 +314,5 @@ return files.every(file => regex.test(file.name));

const integerValidator = (value) => {
if (isEmpty(value)) {
return true;
}
if (Array.isArray(value)) {

@@ -324,6 +357,6 @@ return value.every(val => /^-?[0-9]+$/.test(String(val)));

const maxLengthValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const length = getSingleParam(params, 'length');
if (isNullOrUndefined(value)) {
return length >= 0;
}
if (Array.isArray(value)) {

@@ -336,6 +369,6 @@ return value.every(val => maxLengthValidator(val, { length }));

const maxValueValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const max = getSingleParam(params, 'max');
if (isNullOrUndefined(value) || value === '') {
return false;
}
if (Array.isArray(value)) {

@@ -348,3 +381,3 @@ return value.length > 0 && value.every(val => maxValueValidator(val, { max }));

const mimesValidator = (files, mimes) => {
if (!files) {
if (isEmpty(files)) {
return true;

@@ -363,6 +396,6 @@ }

const minValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const length = getSingleParam(params, 'length');
if (isNullOrUndefined(value)) {
return false;
}
if (Array.isArray(value)) {

@@ -375,6 +408,6 @@ return value.every(val => minValidator(val, { length }));

const minValueValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const min = getSingleParam(params, 'min');
if (isNullOrUndefined(value) || value === '') {
return false;
}
if (Array.isArray(value)) {

@@ -387,2 +420,5 @@ return value.length > 0 && value.every(val => minValueValidator(val, { min }));

const oneOfValidator = (value, list) => {
if (isEmpty(value)) {
return true;
}
if (Array.isArray(value)) {

@@ -398,2 +434,5 @@ return value.every(val => oneOfValidator(val, list));

const excludedValidator = (value, list) => {
if (isEmpty(value)) {
return true;
}
return !oneOfValidator(value, list);

@@ -405,2 +444,5 @@ };

const numericValidator = (value) => {
if (isEmpty(value)) {
return true;
}
const testValue = (val) => {

@@ -417,2 +459,5 @@ const strValue = String(val);

const regexValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
let regex = getSingleParam(params, 'regex');

@@ -436,3 +481,3 @@ if (typeof regex === 'string') {

const sizeValidator = (files, params) => {
if (!files) {
if (isEmpty(files)) {
return true;

@@ -439,0 +484,0 @@ }

/**
* vee-validate v4.1.20
* vee-validate v4.2.0
* (c) 2021 Abdelrahman Awad

@@ -112,3 +112,19 @@ * @license MIT

function getSingleParam(params, paramName) {
return Array.isArray(params) ? params[0] : params[paramName];
}
function isEmpty(value) {
if (value === null || value === undefined || value === '') {
return true;
}
if (Array.isArray(value) && value.length === 0) {
return true;
}
return false;
}
const alphaValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const locale = getLocale(params);

@@ -127,2 +143,5 @@ if (Array.isArray(value)) {

const alphaDashValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const locale = getLocale(params);

@@ -141,2 +160,5 @@ if (Array.isArray(value)) {

const alphaNumValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const locale = getLocale(params);

@@ -155,2 +177,5 @@ if (Array.isArray(value)) {

const alphaSpacesValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const locale = getLocale(params);

@@ -181,2 +206,5 @@ if (Array.isArray(value)) {

const betweenValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const { min, max } = getParams(params);

@@ -190,6 +218,2 @@ if (Array.isArray(value)) {

function getSingleParam(params, paramName) {
return Array.isArray(params) ? params[0] : params[paramName];
}
const confirmedValidator = (value, params) => {

@@ -201,2 +225,5 @@ const target = getSingleParam(params, 'target');

const digitsValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const length = getSingleParam(params, 'length');

@@ -233,3 +260,3 @@ if (Array.isArray(value)) {

const dimensionsValidator = (files, params) => {
if (!files) {
if (isEmpty(files)) {
return true;

@@ -253,2 +280,5 @@ }

const emailValidator = (value) => {
if (isEmpty(value)) {
return true;
}
// eslint-disable-next-line

@@ -263,8 +293,8 @@ const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;

const extValidator = (files, extensions) => {
if (isEmpty(files)) {
return true;
}
if (!extensions) {
extensions = [];
}
if (!files) {
return true;
}
const regex = new RegExp(`.(${extensions.join('|')})$`, 'i');

@@ -278,6 +308,6 @@ if (Array.isArray(files)) {

const imageValidator = (files) => {
const regex = /\.(jpg|svg|jpeg|png|bmp|gif|webp)$/i;
if (!files) {
if (isEmpty(files)) {
return true;
}
const regex = /\.(jpg|svg|jpeg|png|bmp|gif|webp)$/i;
if (Array.isArray(files)) {

@@ -290,2 +320,5 @@ return files.every(file => regex.test(file.name));

const integerValidator = (value) => {
if (isEmpty(value)) {
return true;
}
if (Array.isArray(value)) {

@@ -330,6 +363,6 @@ return value.every(val => /^-?[0-9]+$/.test(String(val)));

const maxLengthValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const length = getSingleParam(params, 'length');
if (isNullOrUndefined(value)) {
return length >= 0;
}
if (Array.isArray(value)) {

@@ -342,6 +375,6 @@ return value.every(val => maxLengthValidator(val, { length }));

const maxValueValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const max = getSingleParam(params, 'max');
if (isNullOrUndefined(value) || value === '') {
return false;
}
if (Array.isArray(value)) {

@@ -354,3 +387,3 @@ return value.length > 0 && value.every(val => maxValueValidator(val, { max }));

const mimesValidator = (files, mimes) => {
if (!files) {
if (isEmpty(files)) {
return true;

@@ -369,6 +402,6 @@ }

const minValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const length = getSingleParam(params, 'length');
if (isNullOrUndefined(value)) {
return false;
}
if (Array.isArray(value)) {

@@ -381,6 +414,6 @@ return value.every(val => minValidator(val, { length }));

const minValueValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
const min = getSingleParam(params, 'min');
if (isNullOrUndefined(value) || value === '') {
return false;
}
if (Array.isArray(value)) {

@@ -393,2 +426,5 @@ return value.length > 0 && value.every(val => minValueValidator(val, { min }));

const oneOfValidator = (value, list) => {
if (isEmpty(value)) {
return true;
}
if (Array.isArray(value)) {

@@ -404,2 +440,5 @@ return value.every(val => oneOfValidator(val, list));

const excludedValidator = (value, list) => {
if (isEmpty(value)) {
return true;
}
return !oneOfValidator(value, list);

@@ -411,2 +450,5 @@ };

const numericValidator = (value) => {
if (isEmpty(value)) {
return true;
}
const testValue = (val) => {

@@ -423,2 +465,5 @@ const strValue = String(val);

const regexValidator = (value, params) => {
if (isEmpty(value)) {
return true;
}
let regex = getSingleParam(params, 'regex');

@@ -442,3 +487,3 @@ if (typeof regex === 'string') {

const sizeValidator = (files, params) => {
if (!files) {
if (isEmpty(files)) {
return true;

@@ -445,0 +490,0 @@ }

/**
* vee-validate v4.1.20
* vee-validate v4.2.0
* (c) 2021 Abdelrahman Awad
* @license MIT
*/
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).VeeValidateRules={})}(this,(function(e){"use strict";const r={en:/^[A-Z]*$/i,cs:/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]*$/i,da:/^[A-ZÆØÅ]*$/i,de:/^[A-ZÄÖÜß]*$/i,es:/^[A-ZÁÉÍÑÓÚÜ]*$/i,fr:/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]*$/i,it:/^[A-Z\xC0-\xFF]*$/i,lt:/^[A-ZĄČĘĖĮŠŲŪŽ]*$/i,nl:/^[A-ZÉËÏÓÖÜ]*$/i,hu:/^[A-ZÁÉÍÓÖŐÚÜŰ]*$/i,pl:/^[A-ZĄĆĘŚŁŃÓŻŹ]*$/i,pt:/^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]*$/i,ru:/^[А-ЯЁ]*$/i,sk:/^[A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ]*$/i,sr:/^[A-ZČĆŽŠĐ]*$/i,sv:/^[A-ZÅÄÖ]*$/i,tr:/^[A-ZÇĞİıÖŞÜ]*$/i,uk:/^[А-ЩЬЮЯЄІЇҐ]*$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]*$/,az:/^[A-ZÇƏĞİıÖŞÜ]*$/i},t={en:/^[A-Z\s]*$/i,cs:/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ\s]*$/i,da:/^[A-ZÆØÅ\s]*$/i,de:/^[A-ZÄÖÜß\s]*$/i,es:/^[A-ZÁÉÍÑÓÚÜ\s]*$/i,fr:/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ\s]*$/i,it:/^[A-Z\xC0-\xFF\s]*$/i,lt:/^[A-ZĄČĘĖĮŠŲŪŽ\s]*$/i,nl:/^[A-ZÉËÏÓÖÜ\s]*$/i,hu:/^[A-ZÁÉÍÓÖŐÚÜŰ\s]*$/i,pl:/^[A-ZĄĆĘŚŁŃÓŻŹ\s]*$/i,pt:/^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ\s]*$/i,ru:/^[А-ЯЁ\s]*$/i,sk:/^[A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ\s]*$/i,sr:/^[A-ZČĆŽŠĐ\s]*$/i,sv:/^[A-ZÅÄÖ\s]*$/i,tr:/^[A-ZÇĞİıÖŞÜ\s]*$/i,uk:/^[А-ЩЬЮЯЄІЇҐ\s]*$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ\s]*$/,az:/^[A-ZÇƏĞİıÖŞÜ\s]*$/i},i={en:/^[0-9A-Z]*$/i,cs:/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]*$/i,da:/^[0-9A-ZÆØÅ]$/i,de:/^[0-9A-ZÄÖÜß]*$/i,es:/^[0-9A-ZÁÉÍÑÓÚÜ]*$/i,fr:/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]*$/i,it:/^[0-9A-Z\xC0-\xFF]*$/i,lt:/^[0-9A-ZĄČĘĖĮŠŲŪŽ]*$/i,hu:/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]*$/i,nl:/^[0-9A-ZÉËÏÓÖÜ]*$/i,pl:/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]*$/i,pt:/^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]*$/i,ru:/^[0-9А-ЯЁ]*$/i,sk:/^[0-9A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ]*$/i,sr:/^[0-9A-ZČĆŽŠĐ]*$/i,sv:/^[0-9A-ZÅÄÖ]*$/i,tr:/^[0-9A-ZÇĞİıÖŞÜ]*$/i,uk:/^[0-9А-ЩЬЮЯЄІЇҐ]*$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]*$/,az:/^[0-9A-ZÇƏĞİıÖŞÜ]*$/i},n={en:/^[0-9A-Z_-]*$/i,cs:/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ_-]*$/i,da:/^[0-9A-ZÆØÅ_-]*$/i,de:/^[0-9A-ZÄÖÜß_-]*$/i,es:/^[0-9A-ZÁÉÍÑÓÚÜ_-]*$/i,fr:/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ_-]*$/i,it:/^[0-9A-Z\xC0-\xFF_-]*$/i,lt:/^[0-9A-ZĄČĘĖĮŠŲŪŽ_-]*$/i,nl:/^[0-9A-ZÉËÏÓÖÜ_-]*$/i,hu:/^[0-9A-ZÁÉÍÓÖŐÚÜŰ_-]*$/i,pl:/^[0-9A-ZĄĆĘŚŁŃÓŻŹ_-]*$/i,pt:/^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ_-]*$/i,ru:/^[0-9А-ЯЁ_-]*$/i,sk:/^[0-9A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ_-]*$/i,sr:/^[0-9A-ZČĆŽŠĐ_-]*$/i,sv:/^[0-9A-ZÅÄÖ_-]*$/i,tr:/^[0-9A-ZÇĞİıÖŞÜ_-]*$/i,uk:/^[0-9А-ЩЬЮЯЄІЇҐ_-]*$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ_-]*$/,az:/^[0-9A-ZÇƏĞİıÖŞÜ_-]*$/i},s=e=>{if(e)return Array.isArray(e)?e[0]:e.locale},a=(e,t)=>{const i=s(t);if(Array.isArray(e))return e.every((e=>a(e,{locale:i})));const n=String(e);return i?(r[i]||r.en).test(n):Object.keys(r).some((e=>r[e].test(n)))},A=(e,r)=>{const t=s(r);if(Array.isArray(e))return e.every((e=>A(e,{locale:t})));const i=String(e);return t?(n[t]||n.en).test(i):Object.keys(n).some((e=>n[e].test(i)))},o=(e,r)=>{const t=s(r);if(Array.isArray(e))return e.every((e=>o(e,{locale:t})));const n=String(e);return t?(i[t]||i.en).test(n):Object.keys(i).some((e=>i[e].test(n)))},u=(e,r)=>{const i=s(r);if(Array.isArray(e))return e.every((e=>u(e,{locale:i})));const n=String(e);return i?(t[i]||t.en).test(n):Object.keys(t).some((e=>t[e].test(n)))};const $=(e,r)=>{const{min:t,max:i}=function(e){return e?Array.isArray(e)?{min:e[0],max:e[1]}:e:{min:0,max:0}}(r);if(Array.isArray(e))return e.every((e=>!!$(e,{min:t,max:i})));const n=Number(e);return Number(t)<=n&&Number(i)>=n};function y(e,r){return Array.isArray(e)?e[0]:e[r]}const l=(e,r)=>{const t=y(r,"target");return String(e)===String(t)},m=(e,r)=>{const t=y(r,"length");if(Array.isArray(e))return e.every((e=>m(e,{length:t})));const i=String(e);return/^[0-9]*$/.test(i)&&i.length===Number(t)};const g=(e,r)=>{if(!e)return!0;const{width:t,height:i}=function(e){return e?Array.isArray(e)?{width:Number(e[0]),height:Number(e[1])}:{width:Number(e.width),height:Number(e.height)}:{width:0,height:0}}(r),n=[],s=Array.isArray(e)?e:[e];for(let e=0;e<s.length;e++){if(!/\.(jpg|svg|jpeg|png|bmp|gif)$/i.test(s[e].name))return Promise.resolve(!1);n.push(s[e])}return Promise.all(n.map((e=>((e,r,t)=>{const i=window.URL||window.webkitURL;return new Promise((n=>{const s=new Image;s.onerror=()=>n(!1),s.onload=()=>n(s.width===r&&s.height===t),s.src=i.createObjectURL(e)}))})(e,t,i)))).then((e=>e.every((e=>e))))},Z=e=>{const r=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return Array.isArray(e)?e.every((e=>r.test(String(e)))):r.test(String(e))},c=(e,r)=>{if(r||(r=[]),!e)return!0;const t=new RegExp(`.(${r.join("|")})$`,"i");return Array.isArray(e)?e.every((e=>t.test(e.name))):t.test(e.name)},h=e=>{const r=/\.(jpg|svg|jpeg|png|bmp|gif|webp)$/i;return!e||(Array.isArray(e)?e.every((e=>r.test(e.name))):r.test(e.name))},f=e=>Array.isArray(e)?e.every((e=>/^-?[0-9]+$/.test(String(e)))):/^-?[0-9]+$/.test(String(e)),p=(e,r)=>e===y(r,"other"),d=(e,r)=>e!==y(r,"other");function _(e){return null==e}const b=(e,r)=>{const t=y(r,"length");return!_(e)&&("number"==typeof e&&(e=String(e)),e.length||(e=Array.from(e)),e.length===Number(t))},v=(e,r)=>{const t=y(r,"length");return _(e)?t>=0:Array.isArray(e)?e.every((e=>v(e,{length:t}))):String(e).length<=Number(t)},x=(e,r)=>{const t=y(r,"max");return!_(e)&&""!==e&&(Array.isArray(e)?e.length>0&&e.every((e=>x(e,{max:t}))):Number(e)<=Number(t))},w=(e,r)=>{if(!e)return!0;r||(r=[]);const t=new RegExp(`${r.join("|").replace("*",".+")}$`,"i");return Array.isArray(e)?e.every((e=>t.test(e.type))):t.test(e.type)},N=(e,r)=>{const t=y(r,"length");return!_(e)&&(Array.isArray(e)?e.every((e=>N(e,{length:t}))):String(e).length>=Number(t))},S=(e,r)=>{const t=y(r,"min");return!_(e)&&""!==e&&(Array.isArray(e)?e.length>0&&e.every((e=>S(e,{min:t}))):Number(e)>=Number(t))},j=(e,r)=>Array.isArray(e)?e.every((e=>j(e,r))):Array.from(r).some((r=>r==e)),k=(e,r)=>!j(e,r),z=/^[٠١٢٣٤٥٦٧٨٩]+$/,F=/^[0-9]+$/,R=e=>{const r=e=>{const r=String(e);return F.test(r)||z.test(r)};return Array.isArray(e)?e.every(r):r(e)},O=(e,r)=>{let t=y(r,"regex");return"string"==typeof t&&(t=new RegExp(t)),Array.isArray(e)?e.every((e=>O(e,{regex:t}))):t.test(String(e))},C=e=>{return!_(e)&&(r=e,!Array.isArray(r)||0!==r.length)&&!1!==e&&!!String(e).trim().length;var r},P=(e,r)=>{if(!e)return!0;let t=y(r,"size");if(t=Number(t),isNaN(t))return!1;const i=1024*t;if(!Array.isArray(e))return e.size<=i;for(let r=0;r<e.length;r++)if(e[r].size>i)return!1;return!0},E={alpha_dash:A,alpha_num:o,alpha_spaces:u,alpha:a,between:$,confirmed:l,digits:m,dimensions:g,email:Z,ext:c,image:h,integer:f,is_not:d,is:p,length:b,max_value:x,max:v,mimes:w,min_value:S,min:N,not_one_of:k,numeric:R,one_of:j,regex:O,required:C,size:P};e.alpha=a,e.alpha_dash=A,e.alpha_num=o,e.alpha_spaces=u,e.between=$,e.confirmed=l,e.default=E,e.digits=m,e.dimensions=g,e.email=Z,e.ext=c,e.image=h,e.integer=f,e.is=p,e.is_not=d,e.length=b,e.max=v,e.max_value=x,e.mimes=w,e.min=N,e.min_value=S,e.not_one_of=k,e.numeric=R,e.one_of=j,e.regex=O,e.required=C,e.size=P,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((r="undefined"!=typeof globalThis?globalThis:r||self).VeeValidateRules={})}(this,(function(r){"use strict";const e={en:/^[A-Z]*$/i,cs:/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]*$/i,da:/^[A-ZÆØÅ]*$/i,de:/^[A-ZÄÖÜß]*$/i,es:/^[A-ZÁÉÍÑÓÚÜ]*$/i,fr:/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]*$/i,it:/^[A-Z\xC0-\xFF]*$/i,lt:/^[A-ZĄČĘĖĮŠŲŪŽ]*$/i,nl:/^[A-ZÉËÏÓÖÜ]*$/i,hu:/^[A-ZÁÉÍÓÖŐÚÜŰ]*$/i,pl:/^[A-ZĄĆĘŚŁŃÓŻŹ]*$/i,pt:/^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]*$/i,ru:/^[А-ЯЁ]*$/i,sk:/^[A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ]*$/i,sr:/^[A-ZČĆŽŠĐ]*$/i,sv:/^[A-ZÅÄÖ]*$/i,tr:/^[A-ZÇĞİıÖŞÜ]*$/i,uk:/^[А-ЩЬЮЯЄІЇҐ]*$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]*$/,az:/^[A-ZÇƏĞİıÖŞÜ]*$/i},t={en:/^[A-Z\s]*$/i,cs:/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ\s]*$/i,da:/^[A-ZÆØÅ\s]*$/i,de:/^[A-ZÄÖÜß\s]*$/i,es:/^[A-ZÁÉÍÑÓÚÜ\s]*$/i,fr:/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ\s]*$/i,it:/^[A-Z\xC0-\xFF\s]*$/i,lt:/^[A-ZĄČĘĖĮŠŲŪŽ\s]*$/i,nl:/^[A-ZÉËÏÓÖÜ\s]*$/i,hu:/^[A-ZÁÉÍÓÖŐÚÜŰ\s]*$/i,pl:/^[A-ZĄĆĘŚŁŃÓŻŹ\s]*$/i,pt:/^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ\s]*$/i,ru:/^[А-ЯЁ\s]*$/i,sk:/^[A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ\s]*$/i,sr:/^[A-ZČĆŽŠĐ\s]*$/i,sv:/^[A-ZÅÄÖ\s]*$/i,tr:/^[A-ZÇĞİıÖŞÜ\s]*$/i,uk:/^[А-ЩЬЮЯЄІЇҐ\s]*$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ\s]*$/,az:/^[A-ZÇƏĞİıÖŞÜ\s]*$/i},i={en:/^[0-9A-Z]*$/i,cs:/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]*$/i,da:/^[0-9A-ZÆØÅ]$/i,de:/^[0-9A-ZÄÖÜß]*$/i,es:/^[0-9A-ZÁÉÍÑÓÚÜ]*$/i,fr:/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]*$/i,it:/^[0-9A-Z\xC0-\xFF]*$/i,lt:/^[0-9A-ZĄČĘĖĮŠŲŪŽ]*$/i,hu:/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]*$/i,nl:/^[0-9A-ZÉËÏÓÖÜ]*$/i,pl:/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]*$/i,pt:/^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]*$/i,ru:/^[0-9А-ЯЁ]*$/i,sk:/^[0-9A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ]*$/i,sr:/^[0-9A-ZČĆŽŠĐ]*$/i,sv:/^[0-9A-ZÅÄÖ]*$/i,tr:/^[0-9A-ZÇĞİıÖŞÜ]*$/i,uk:/^[0-9А-ЩЬЮЯЄІЇҐ]*$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]*$/,az:/^[0-9A-ZÇƏĞİıÖŞÜ]*$/i},n={en:/^[0-9A-Z_-]*$/i,cs:/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ_-]*$/i,da:/^[0-9A-ZÆØÅ_-]*$/i,de:/^[0-9A-ZÄÖÜß_-]*$/i,es:/^[0-9A-ZÁÉÍÑÓÚÜ_-]*$/i,fr:/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ_-]*$/i,it:/^[0-9A-Z\xC0-\xFF_-]*$/i,lt:/^[0-9A-ZĄČĘĖĮŠŲŪŽ_-]*$/i,nl:/^[0-9A-ZÉËÏÓÖÜ_-]*$/i,hu:/^[0-9A-ZÁÉÍÓÖŐÚÜŰ_-]*$/i,pl:/^[0-9A-ZĄĆĘŚŁŃÓŻŹ_-]*$/i,pt:/^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ_-]*$/i,ru:/^[0-9А-ЯЁ_-]*$/i,sk:/^[0-9A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ_-]*$/i,sr:/^[0-9A-ZČĆŽŠĐ_-]*$/i,sv:/^[0-9A-ZÅÄÖ_-]*$/i,tr:/^[0-9A-ZÇĞİıÖŞÜ_-]*$/i,uk:/^[0-9А-ЩЬЮЯЄІЇҐ_-]*$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ_-]*$/,az:/^[0-9A-ZÇƏĞİıÖŞÜ_-]*$/i},s=r=>{if(r)return Array.isArray(r)?r[0]:r.locale};function a(r,e){return Array.isArray(r)?r[0]:r[e]}function A(r){return null==r||""===r||!(!Array.isArray(r)||0!==r.length)}const u=(r,t)=>{if(A(r))return!0;const i=s(t);if(Array.isArray(r))return r.every((r=>u(r,{locale:i})));const n=String(r);return i?(e[i]||e.en).test(n):Object.keys(e).some((r=>e[r].test(n)))},o=(r,e)=>{if(A(r))return!0;const t=s(e);if(Array.isArray(r))return r.every((r=>o(r,{locale:t})));const i=String(r);return t?(n[t]||n.en).test(i):Object.keys(n).some((r=>n[r].test(i)))},$=(r,e)=>{if(A(r))return!0;const t=s(e);if(Array.isArray(r))return r.every((r=>$(r,{locale:t})));const n=String(r);return t?(i[t]||i.en).test(n):Object.keys(i).some((r=>i[r].test(n)))},y=(r,e)=>{if(A(r))return!0;const i=s(e);if(Array.isArray(r))return r.every((r=>y(r,{locale:i})));const n=String(r);return i?(t[i]||t.en).test(n):Object.keys(t).some((r=>t[r].test(n)))};const l=(r,e)=>{if(A(r))return!0;const{min:t,max:i}=function(r){return r?Array.isArray(r)?{min:r[0],max:r[1]}:r:{min:0,max:0}}(e);if(Array.isArray(r))return r.every((r=>!!l(r,{min:t,max:i})));const n=Number(r);return Number(t)<=n&&Number(i)>=n},m=(r,e)=>{const t=a(e,"target");return String(r)===String(t)},g=(r,e)=>{if(A(r))return!0;const t=a(e,"length");if(Array.isArray(r))return r.every((r=>g(r,{length:t})));const i=String(r);return/^[0-9]*$/.test(i)&&i.length===Number(t)};const Z=(r,e)=>{if(A(r))return!0;const{width:t,height:i}=function(r){return r?Array.isArray(r)?{width:Number(r[0]),height:Number(r[1])}:{width:Number(r.width),height:Number(r.height)}:{width:0,height:0}}(e),n=[],s=Array.isArray(r)?r:[r];for(let r=0;r<s.length;r++){if(!/\.(jpg|svg|jpeg|png|bmp|gif)$/i.test(s[r].name))return Promise.resolve(!1);n.push(s[r])}return Promise.all(n.map((r=>((r,e,t)=>{const i=window.URL||window.webkitURL;return new Promise((n=>{const s=new Image;s.onerror=()=>n(!1),s.onload=()=>n(s.width===e&&s.height===t),s.src=i.createObjectURL(r)}))})(r,t,i)))).then((r=>r.every((r=>r))))},c=r=>{if(A(r))return!0;const e=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return Array.isArray(r)?r.every((r=>e.test(String(r)))):e.test(String(r))},f=(r,e)=>{if(A(r))return!0;e||(e=[]);const t=new RegExp(`.(${e.join("|")})$`,"i");return Array.isArray(r)?r.every((r=>t.test(r.name))):t.test(r.name)},h=r=>{if(A(r))return!0;const e=/\.(jpg|svg|jpeg|png|bmp|gif|webp)$/i;return Array.isArray(r)?r.every((r=>e.test(r.name))):e.test(r.name)},p=r=>!!A(r)||(Array.isArray(r)?r.every((r=>/^-?[0-9]+$/.test(String(r)))):/^-?[0-9]+$/.test(String(r))),d=(r,e)=>r===a(e,"other"),_=(r,e)=>r!==a(e,"other");function b(r){return null==r}const v=(r,e)=>{const t=a(e,"length");return!b(r)&&("number"==typeof r&&(r=String(r)),r.length||(r=Array.from(r)),r.length===Number(t))},x=(r,e)=>{if(A(r))return!0;const t=a(e,"length");return Array.isArray(r)?r.every((r=>x(r,{length:t}))):String(r).length<=Number(t)},w=(r,e)=>{if(A(r))return!0;const t=a(e,"max");return Array.isArray(r)?r.length>0&&r.every((r=>w(r,{max:t}))):Number(r)<=Number(t)},N=(r,e)=>{if(A(r))return!0;e||(e=[]);const t=new RegExp(`${e.join("|").replace("*",".+")}$`,"i");return Array.isArray(r)?r.every((r=>t.test(r.type))):t.test(r.type)},S=(r,e)=>{if(A(r))return!0;const t=a(e,"length");return Array.isArray(r)?r.every((r=>S(r,{length:t}))):String(r).length>=Number(t)},j=(r,e)=>{if(A(r))return!0;const t=a(e,"min");return Array.isArray(r)?r.length>0&&r.every((r=>j(r,{min:t}))):Number(r)>=Number(t)},k=(r,e)=>!!A(r)||(Array.isArray(r)?r.every((r=>k(r,e))):Array.from(e).some((e=>e==r))),z=(r,e)=>!!A(r)||!k(r,e),F=/^[٠١٢٣٤٥٦٧٨٩]+$/,R=/^[0-9]+$/,O=r=>{if(A(r))return!0;const e=r=>{const e=String(r);return R.test(e)||F.test(e)};return Array.isArray(r)?r.every(e):e(r)},C=(r,e)=>{if(A(r))return!0;let t=a(e,"regex");return"string"==typeof t&&(t=new RegExp(t)),Array.isArray(r)?r.every((r=>C(r,{regex:t}))):t.test(String(r))},P=r=>{return!b(r)&&(e=r,!Array.isArray(e)||0!==e.length)&&!1!==r&&!!String(r).trim().length;var e},E=(r,e)=>{if(A(r))return!0;let t=a(e,"size");if(t=Number(t),isNaN(t))return!1;const i=1024*t;if(!Array.isArray(r))return r.size<=i;for(let e=0;e<r.length;e++)if(r[e].size>i)return!1;return!0},L={alpha_dash:o,alpha_num:$,alpha_spaces:y,alpha:u,between:l,confirmed:m,digits:g,dimensions:Z,email:c,ext:f,image:h,integer:p,is_not:_,is:d,length:v,max_value:w,max:x,mimes:N,min_value:j,min:S,not_one_of:z,numeric:O,one_of:k,regex:C,required:P,size:E};r.alpha=u,r.alpha_dash=o,r.alpha_num=$,r.alpha_spaces=y,r.between=l,r.confirmed=m,r.default=L,r.digits=g,r.dimensions=Z,r.email=c,r.ext=f,r.image=h,r.integer=p,r.is=d,r.is_not=_,r.length=v,r.max=x,r.max_value=w,r.mimes=N,r.min=S,r.min_value=j,r.not_one_of=z,r.numeric=O,r.one_of=k,r.regex=C,r.required=P,r.size=E,Object.defineProperty(r,"__esModule",{value:!0})}));
{
"name": "@vee-validate/rules",
"version": "4.1.20",
"version": "4.2.0",
"description": "Form Validation for Vue.js",

@@ -26,3 +26,3 @@ "author": "Abdelrahman Awad <logaretm1@gmail.com>",

],
"gitHead": "f61d1c94ad912f7e9ab68a3627ec19fea1d10db5"
"gitHead": "bfabb67852ac7080d0f1103e18c4d5e8a7924e77"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc