@regle/rules 1.1.0-beta.3 → 1.1.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { RegleRuleMetadataDefinition, RegleRuleWithParamsDefinition, RegleRuleDefinitionWithMetadataProcessor, RegleRuleMetadataConsumer, RegleRuleDefinition, InlineRuleDeclaration, UnwrapRegleUniversalParams, Maybe, FormRuleDeclaration, CommonComparationOptions } from '@regle/core';
1
+ import { RegleRuleMetadataDefinition, RegleRuleWithParamsDefinition, RegleRuleDefinitionWithMetadataProcessor, RegleRuleMetadataConsumer, RegleRuleDefinition, InlineRuleDeclaration, UnwrapRegleUniversalParams, Maybe, FormRuleDeclaration, CommonComparisonOptions, CommonAlphaOptions } from '@regle/core';
2
2
  import { Ref, MaybeRefOrGetter, MaybeRef } from 'vue';
3
3
 
4
4
  /**
@@ -206,10 +206,11 @@ declare const required: RegleRuleDefinition<unknown, [], false, boolean, unknown
206
206
  * Requires the input value to have a maximum specified length, inclusive. Works with arrays, objects and strings.
207
207
  *
208
208
  * @param max - the maximum length
209
+ * @param options - comparision options
209
210
  */
210
211
  declare const maxLength: RegleRuleWithParamsDefinition<string | any[] | Record<PropertyKey, any>, [
211
212
  count: number,
212
- options?: CommonComparationOptions
213
+ options?: CommonComparisonOptions
213
214
  ], false, boolean>;
214
215
 
215
216
  /**
@@ -221,16 +222,20 @@ declare const requiredIf: RegleRuleWithParamsDefinition<unknown, [condition: boo
221
222
 
222
223
  /**
223
224
  * Allows only alphabetic characters.
225
+ *
226
+ * @param [options] - Alpha rules options
224
227
  * */
225
228
  declare const alpha: RegleRuleWithParamsDefinition<string, [
226
- allowSymbols?: boolean | undefined
229
+ options?: CommonAlphaOptions | undefined
227
230
  ], false, boolean, string>;
228
231
 
229
232
  /**
230
233
  * Allows only alphanumeric characters.
234
+ *
235
+ * @param [options] - Alpha rules options
231
236
  */
232
237
  declare const alphaNum: RegleRuleWithParamsDefinition<string | number, [
233
- allowSymbols?: boolean | undefined
238
+ options?: CommonAlphaOptions | undefined
234
239
  ], false, boolean, string | number>;
235
240
 
236
241
  /**
@@ -242,7 +247,7 @@ declare const alphaNum: RegleRuleWithParamsDefinition<string | number, [
242
247
  declare const between: RegleRuleWithParamsDefinition<number, [
243
248
  min: number,
244
249
  max: number,
245
- options?: CommonComparationOptions
250
+ options?: CommonComparisonOptions
246
251
  ], false, boolean>;
247
252
 
248
253
  /**
@@ -264,32 +269,38 @@ declare const integer: RegleRuleDefinition<string | number, [], false, boolean,
264
269
  * Requires a field to have a specified maximum numeric value.
265
270
  *
266
271
  * @param max - the maximum value
272
+ * @param options - comparision options
267
273
  */
268
274
  declare const maxValue: RegleRuleWithParamsDefinition<number, [
269
275
  count: number,
270
- options?: CommonComparationOptions
276
+ options?: CommonComparisonOptions
271
277
  ], false, boolean>;
272
278
 
273
279
  /**
274
280
  * Requires the input value to have a minimum specified length, inclusive. Works with arrays, objects and strings.
275
281
  *
276
282
  * @param min - the minimum value
283
+ * @param options - comparision options
277
284
  */
278
285
  declare const minLength: RegleRuleWithParamsDefinition<string | any[] | Record<PropertyKey, any>, [
279
286
  count: number,
280
- options?: CommonComparationOptions
287
+ options?: CommonComparisonOptions
281
288
  ], false, boolean>;
282
289
 
283
290
  /**
284
291
  * Requires a field to have a specified minimum numeric value.
285
292
  *
286
293
  * @param count - the minimum count
294
+ * @param options - comparision options
287
295
  */
288
296
  declare const minValue: RegleRuleWithParamsDefinition<number, [
289
297
  count: number,
290
- options?: CommonComparationOptions
298
+ options?: CommonComparisonOptions
291
299
  ], false, boolean>;
292
300
 
301
+ /**
302
+ * Requires a field to have a strict numeric value.
303
+ */
293
304
  declare const exactValue: RegleRuleWithParamsDefinition<number, [count: number], false, boolean>;
294
305
 
295
306
  /**
@@ -1 +1 @@
1
- import {createRule,InternalRuleType,unwrapRuleParameters}from'@regle/core';import {unref,computed,toValue}from'vue';function M(e,t){let r,n,s,R;typeof e=="function"&&!("_validator"in e)?(r=InternalRuleType.Inline,n=e):{_type:r,validator:n,_active:s,_params:R}=e;let l=createRule({type:r,validator:n,active:s,message:t}),u=[...R??[]];if(l._params=u,l._message_patched=true,typeof l=="function"){let a=l(...u);return a._message_patched=true,a}else return l}function _(e,t){let r,n,s,R,l;typeof e=="function"&&!("_validator"in e)?(r=InternalRuleType.Inline,n=e):{_type:r,validator:n,_active:s,_params:R,_message:l}=e;let u=createRule({type:r,validator:n,active:s,message:l,tooltip:t}),a=[...R??[]];if(u._params=a,u._tooltip_patched=true,typeof u=="function"){let m=u(...a);return u._tooltip_patched=true,m}else return u}function E(e,t){let r,n,s=[],R="";typeof e=="function"?(r=InternalRuleType.Inline,n=async(u,...a)=>e(u,...a),s=[t]):({_type:r,_message:R}=e,s=s=e._params?.concat(t),n=async(...u)=>e.validator(u));let l=createRule({type:InternalRuleType.Async,validator:n,message:R});return l._params=l._params?.concat(s),l(...t??[])}function P(e,t){let r,n,s=[],R="";typeof e=="function"?(r=InternalRuleType.Inline,n=(u,...a)=>e(u,...a),s=[t]):({_type:r,validator:n,_message:R}=e,s=s=e._params?.concat(t));let l=createRule({type:InternalRuleType.Inline,validator:n,message:R});return l._params=l._params?.concat(s),l(...t)}function S(e,t){let r,n,s=[],R="";typeof t=="function"?(r=InternalRuleType.Inline,n=t,s=[e]):({_type:r,validator:n,_message:R}=t,s=t._params?.concat([e]));function l(o,...y){let[b]=unwrapRuleParameters([e]);return b?n(o,...y):true}function u(o){let[y]=unwrapRuleParameters([e]);return y}let a=createRule({type:r,validator:l,active:u,message:R}),m=[...s??[]];return a._params=m,typeof a=="function"?a(...m):a}function f(e,t=true){return e==null?true:e instanceof Date?isNaN(e.getTime()):e.constructor.name=="File"||e.constructor.name=="FileList"?e.size<=0:Array.isArray(e)?t?e.length===0:false:typeof e=="object"&&e!=null?Object.keys(e).length===0:!String(e).length}function x(e){if(f(e))return false;try{let t=null;if(e instanceof Date)t=e;else if(typeof e=="string"){let r=new Date(e);if(r.toString()==="Invalid Date")return !1;t=r;}return !!t}catch{return false}}function T(e){let t=Object.prototype.toString.call(e);return e==null?new Date(NaN):e instanceof Date||typeof e=="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function i(e,t=true){return !f(typeof e=="string"?e.trim():e,t)}function c(e){return e==null||typeof e!="number"?false:!isNaN(e)}function p(e,...t){if(f(e))return true;let r=typeof e=="number"?e.toString():e;return t.every(n=>(n.lastIndex=0,n.test(r)))}function D(e){let t=unref(e);return Array.isArray(t)?t.length:typeof t=="object"?Object.keys(t).length:typeof t=="number"?isNaN(t)?0:t:String(t).length}function g(e){return typeof e=="number"?e:e!=null?typeof e=="string"?e.trim()!==e?NaN:+e:NaN:NaN}function q(...e){let t=e.some(a=>typeof a=="function"?a.constructor.name==="AsyncFunction":a._async),r=e.map(a=>{if(typeof a=="function")return null;{let m=a._params;return m?.length?m:[]}}).flat().filter(a=>!!a);function n(a,m,...o){let y=[],b=0;for(let d of a)if(typeof d=="function")y.push(d(m)),b++;else {let h=d._params?.length??0;y.push(d.validator(m,...o.slice(b,h))),h&&(b+=h);}return y}function s(a){return a?.some(o=>typeof o!="boolean")?{$valid:a.every(o=>typeof o=="boolean"?!!o:o.$valid),...a.reduce((o,y)=>{if(typeof y=="boolean")return o;let{$valid:b,...d}=y;return {...o,...d}},{})}:a.every(o=>!!o)}let R;e.length?R=t?async(a,...m)=>{let o=await Promise.all(n(e,a,...m));return s(o)}:(a,...m)=>{let o=n(e,a,...m);return s(o)}:R=a=>false;let l=createRule({type:"and",validator:R,message:"The value does not match all of the provided validators"}),u=[...r??[]];return l._params=u,typeof l=="function"?l(...u):l}function G(...e){let t=e.some(a=>typeof a=="function"?a.constructor.name==="AsyncFunction":a._async),r=e.map(a=>typeof a=="function"?null:a._params).flat().filter(a=>!!a);function n(a,m,...o){let y=[],b=0;for(let d of a)if(typeof d=="function")y.push(d(m)),b++;else {let h=d._params?.length??0;y.push(d.validator(m,...o.slice(b,h))),h&&(b+=h);}return y}function s(a){return a.some(o=>typeof o!="boolean")?{$valid:a.some(o=>typeof o=="boolean"?!!o:o.$valid),...a.reduce((o,y)=>{if(typeof y=="boolean")return o;let{$valid:b,...d}=y;return {...o,...d}},{})}:a.some(o=>!!o)}let l=createRule({type:"or",validator:t?async(a,...m)=>{let o=await Promise.all(n(e,a,...m));return s(o)}:(a,...m)=>{let o=n(e,a,...m);return s(o)},message:"The value does not match any of the provided validators"}),u=[...r??[]];return l._params=u,typeof l=="function"?l(...u):l}function B(e,t){let r,n,s,R,l;typeof e=="function"?(n=e,l=e.constructor.name==="AsyncFunction"):({_type:r,validator:n,_params:R}=e,l=e._async),l?s=async(m,...o)=>i(m)?!await n(m,...o):true:s=(m,...o)=>i(m)?!n(m,...o):true;let u=createRule({type:"not",validator:s,message:t??"Error"}),a=[...R??[]];return u._params=a,typeof u=="function"?u(...a):u}var Qt=createRule({type:"required",validator:e=>i(e),message:"This field is required"});var er=createRule({type:"maxLength",validator:(e,t,r)=>{let{allowEqual:n=true}=r??{};return i(e,false)&&i(t)?c(t)?n?D(e)<=t:D(e)<t:(console.warn(`[maxLength] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),false):true},message:({$value:e,$params:[t]})=>Array.isArray(e)?`This list should have maximum ${t} items`:`The maximum length allowed is ${t}`});var ar=createRule({type:"required",validator(e,t){return t?i(e):true},message:"This field is required",active({$params:[e]}){return e}});var X=/^[a-zA-Z]*$/,Y=/^[\w.]+$/,lr=createRule({type:"alpha",validator(e,t){return f(e)?true:t?p(e,Y):p(e,X)},message:"The value is not alphabetical"});var ee=/^[a-zA-Z0-9]*$/,te=/^[a-zA-Z0-9_]*$/,Rr=createRule({type:"alphaNum",validator(e,t){return f(e)?true:t?p(e,te):p(e,ee)},message:"The value must be alpha-numeric"});var gr=createRule({type:"between",validator:(e,t,r,n)=>{let{allowEqual:s=true}=n??{};if(i(e)&&i(t)&&i(r)){let R=g(e),l=g(t),u=g(r);return c(R)&&c(l)&&c(u)?s?R>=l&&R<=u:R>l&&R<u:(console.warn(`[between] Value or parameters aren't numbers, got value: ${e}, min: ${t}, max: ${r}`),false)}return true},message:({$params:[e,t]})=>`The value must be between ${e} and ${t}`});var ae=/^[-]?\d*(\.\d+)?$/,br=createRule({type:"decimal",validator(e){return f(e)?true:p(e,ae)},message:"Value must be decimal"});var oe=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i,Pr=createRule({type:"email",validator(e){return f(e)?true:p(e,oe)},message:"Value must be an valid email address"});var le=/(^[0-9]*$)|(^-[0-9]+$)/,Wr=createRule({type:"integer",validator(e){return f(e)?true:p(e,le)},message:"Value must be an integer"});var Cr=createRule({type:"maxValue",validator:(e,t,r)=>{let{allowEqual:n=true}=r??{};return i(e)&&i(t)?c(t)&&!isNaN(g(e))?n?g(e)<=t:g(e)<t:(console.warn(`[maxValue] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),true):true},message:({$params:[e,t]})=>{let{allowEqual:r=true}=t??{};return r?`Value must be less than or equal to ${e}`:`Value must be less than ${e}`}});var Ir=createRule({type:"minLength",validator:(e,t,r)=>{let{allowEqual:n=true}=r??{};return i(e,false)&&i(t)?c(t)?n?D(e)>=t:D(e)>t:(console.warn(`[minLength] Parameter isn't a number, got parameter: ${t}`),false):true},message:({$value:e,$params:[t]})=>Array.isArray(e)?`This list should have at least ${t} items`:`This field should be at least ${t} characters long`});var zr=createRule({type:"minValue",validator:(e,t,r)=>{let{allowEqual:n=true}=r??{};return i(e)&&i(t)?c(t)&&!isNaN(g(e))?n?g(e)>=t:g(e)>t:(console.warn(`[minValue] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),true):true},message:({$params:[e,t]})=>{let{allowEqual:r=true}=t??{};return r?`Value must be greater than or equal to ${e}`:`Value must be greater than ${e}`}});var Gr=createRule({type:"exactValue",validator:(e,t)=>i(e)&&i(t)?c(t)&&!isNaN(g(e))?g(e)===t:(console.warn(`[exactValue] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),true):true,message:({$params:[e]})=>`The value must be equal to ${e}`});var Jr=createRule({type:"exactLength",validator:(e,t)=>i(e,false)&&i(t)?c(t)?D(e)===t:(console.warn(`[minLength] Parameter isn't a number, got parameter: ${t}`),false):true,message:({$params:[e]})=>`This field should be exactly ${e} characters long`});var ce=/^\d*(\.\d+)?$/,Yr=createRule({type:"numeric",validator(e){return f(e)?true:p(e,ce)},message:"This field must be numeric"});var rn=createRule({type:"required",validator(e,t){return t?true:i(e)},message:"This field is required",active({$params:[e]}){return !e}});var sn=createRule({type:"sameAs",validator(e,t,r="other"){return f(e)?true:e===t},message({$params:[e,t]}){return `Value must be equal to the ${t} value`}});var xe=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i,fn=createRule({type:"url",validator(e){return f(e)?true:p(e,xe)},message:"The value is not a valid URL address"});function be(){return navigator.languages!=null?navigator.languages[0]:navigator.language}function w(e){return e?new Intl.DateTimeFormat(be(),{dateStyle:"short"}).format(new Date(e)):"?"}var dn=createRule({type:"dateAfter",validator:(e,t)=>i(e)&&i(t)?x(e)&&x(t)?T(e).getTime()>T(t).getTime()?true:{$valid:false,error:"date-not-after"}:{$valid:false,error:"value-or-paramater-not-a-date"}:true,message:({$params:[e],error:t})=>t==="value-or-paramater-not-a-date"?"The inputs must be Dates":`The date must be after ${w(e)}`});var hn=createRule({type:"dateBefore",validator:(e,t)=>i(e)&&i(t)?x(e)&&x(t)?T(e).getTime()<T(t).getTime()?true:{$valid:false,error:"date-not-before"}:{$valid:false,error:"value-or-paramater-not-a-date"}:true,message:({$params:[e],error:t})=>t==="value-or-paramater-not-a-date"?"The fields must be Dates":`The date must be before ${w(e)}`});var $n=createRule({type:"dateBetween",validator:(e,t,r)=>x(e)&&x(t)&&x(r)?T(e).getTime()>T(t).getTime()&&T(e).getTime()<T(r).getTime():true,message:({$params:[e,t]})=>`The date must be between ${w(e)} and ${w(t)}`});function we(e){if(e.length>3||e.length===0||e[0]==="0"&&e!=="0"||!e.match(/^\d+$/))return false;let t=+e|0;return t>=0&&t<=255}var Fn=createRule({type:"ipv4Address",validator(e){if(f(e))return true;if(typeof e!="string")return false;let t=e.split(".");return t.length===4&&t.every(we)},message:"The value is not a valid IPv4 address"});var En=createRule({type:"macAddress",validator(e,t=":"){if(f(e))return true;if(typeof e!="string")return false;let r=typeof t=="string"&&t!==""?e.split(t):e.length===12||e.length===16?e.match(/.{2}/g):null;return r!==null&&(r.length===6||r.length===8)&&r.every($e)},message:"The value is not a valid MAC Address"}),$e=e=>e.toLowerCase().match(/^[0-9a-f]{2}$/);var Sn=createRule({type:"checked",validator:e=>i(e)?e===true:true,message:"This field must be checked"});var Un=createRule({type:"contains",validator(e,t){return i(e)&&i(t)?e.includes(t):true},message({$params:[e]}){return `Field must contain ${e}`}});var Zn=createRule({type:"startsWith",validator(e,t){return i(e)&&i(t)?e.startsWith(t):true},message({$params:[e]}){return `Field must end with ${e}`}});var Xn=createRule({type:"endsWith",validator(e,t){return i(e)&&i(t)?e.endsWith(t):true},message({$params:[e]}){return `Field must end with ${e}`}});var ta=createRule({type:"regex",validator(e,t){if(i(e)){let r=Array.isArray(t)?t:[t];return p(e,...r)}return true},message:"This field does not match the required pattern"});function ia(e){let t=computed(()=>toValue(e));return M(P((n,s)=>i(n)&&i(s,false)?s.includes(n):true,[t]),({$params:[n]})=>`Value should be one of those options: ${n.join(", ")}.`)}function Oe(e){let t=Object.keys(e).filter(n=>typeof e[e[n]]!="number"),r={};for(let n of t)r[n]=e[n];return Object.values(r)}function ua(e){let t=computed(()=>toValue(e));return M(P((n,s)=>i(n)&&!f(s)?Oe(s).includes(n):true,[t]),({$params:[n]})=>`Value should be one of those options: ${Object.values(n).join(", ")}.`)}function ya(e){let t=computed(()=>toValue(e));return M(P((n,s)=>s===n,[t]),({$params:[n]})=>`Value should be ${n}.`)}export{lr as alpha,Rr as alphaNum,q as and,S as applyIf,gr as between,Sn as checked,Un as contains,dn as dateAfter,hn as dateBefore,$n as dateBetween,br as decimal,Pr as email,Xn as endsWith,Jr as exactLength,Gr as exactValue,D as getSize,Wr as integer,Fn as ipv4Address,x as isDate,f as isEmpty,i as isFilled,c as isNumber,ya as literal,En as macAddress,p as matchRegex,er as maxLength,Cr as maxValue,Ir as minLength,zr as minValue,ua as nativeEnum,B as not,Yr as numeric,ia as oneOf,G as or,ta as regex,Qt as required,ar as requiredIf,rn as requiredUnless,sn as sameAs,Zn as startsWith,T as toDate,g as toNumber,fn as url,E as withAsync,M as withMessage,P as withParams,_ as withTooltip};
1
+ import {createRule,InternalRuleType,unwrapRuleParameters}from'@regle/core';import {unref,computed,toValue}from'vue';function M(e,t){let r,n,s,R;typeof e=="function"&&!("_validator"in e)?(r=InternalRuleType.Inline,n=e):{_type:r,validator:n,_active:s,_params:R}=e;let l=createRule({type:r,validator:n,active:s,message:t}),u=[...R??[]];if(l._params=u,l._message_patched=true,typeof l=="function"){let a=l(...u);return a._message_patched=true,a}else return l}function _(e,t){let r,n,s,R,l;typeof e=="function"&&!("_validator"in e)?(r=InternalRuleType.Inline,n=e):{_type:r,validator:n,_active:s,_params:R,_message:l}=e;let u=createRule({type:r,validator:n,active:s,message:l,tooltip:t}),a=[...R??[]];if(u._params=a,u._tooltip_patched=true,typeof u=="function"){let m=u(...a);return u._tooltip_patched=true,m}else return u}function E(e,t){let r,n,s=[],R="";typeof e=="function"?(r=InternalRuleType.Inline,n=async(u,...a)=>e(u,...a),s=[t]):({_type:r,_message:R}=e,s=s=e._params?.concat(t),n=async(...u)=>e.validator(u));let l=createRule({type:InternalRuleType.Async,validator:n,message:R});return l._params=l._params?.concat(s),l(...t??[])}function P(e,t){let r,n,s=[],R="";typeof e=="function"?(r=InternalRuleType.Inline,n=(u,...a)=>e(u,...a),s=[t]):({_type:r,validator:n,_message:R}=e,s=s=e._params?.concat(t));let l=createRule({type:InternalRuleType.Inline,validator:n,message:R});return l._params=l._params?.concat(s),l(...t)}function S(e,t){let r,n,s=[],R="";typeof t=="function"?(r=InternalRuleType.Inline,n=t,s=[e]):({_type:r,validator:n,_message:R}=t,s=t._params?.concat([e]));function l(o,...y){let[b]=unwrapRuleParameters([e]);return b?n(o,...y):true}function u(o){let[y]=unwrapRuleParameters([e]);return y}let a=createRule({type:r,validator:l,active:u,message:R}),m=[...s??[]];return a._params=m,typeof a=="function"?a(...m):a}function f(e,t=true){return e==null?true:e instanceof Date?isNaN(e.getTime()):e.constructor.name=="File"||e.constructor.name=="FileList"?e.size<=0:Array.isArray(e)?t?e.length===0:false:typeof e=="object"&&e!=null?Object.keys(e).length===0:!String(e).length}function x(e){if(f(e))return false;try{let t=null;if(e instanceof Date)t=e;else if(typeof e=="string"){let r=new Date(e);if(r.toString()==="Invalid Date")return !1;t=r;}return !!t}catch{return false}}function T(e){let t=Object.prototype.toString.call(e);return e==null?new Date(NaN):e instanceof Date||typeof e=="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function i(e,t=true){return !f(typeof e=="string"?e.trim():e,t)}function c(e){return e==null||typeof e!="number"?false:!isNaN(e)}function p(e,...t){if(f(e))return true;let r=typeof e=="number"?e.toString():e;return t.every(n=>(n.lastIndex=0,n.test(r)))}function h(e){let t=unref(e);return Array.isArray(t)?t.length:typeof t=="object"?Object.keys(t).length:typeof t=="number"?isNaN(t)?0:t:String(t).length}function g(e){return typeof e=="number"?e:e!=null?typeof e=="string"?e.trim()!==e?NaN:+e:NaN:NaN}function q(...e){let t=e.some(a=>typeof a=="function"?a.constructor.name==="AsyncFunction":a._async),r=e.map(a=>{if(typeof a=="function")return null;{let m=a._params;return m?.length?m:[]}}).flat().filter(a=>!!a);function n(a,m,...o){let y=[],b=0;for(let d of a)if(typeof d=="function")y.push(d(m)),b++;else {let D=d._params?.length??0;y.push(d.validator(m,...o.slice(b,D))),D&&(b+=D);}return y}function s(a){return a?.some(o=>typeof o!="boolean")?{$valid:a.every(o=>typeof o=="boolean"?!!o:o.$valid),...a.reduce((o,y)=>{if(typeof y=="boolean")return o;let{$valid:b,...d}=y;return {...o,...d}},{})}:a.every(o=>!!o)}let R;e.length?R=t?async(a,...m)=>{let o=await Promise.all(n(e,a,...m));return s(o)}:(a,...m)=>{let o=n(e,a,...m);return s(o)}:R=a=>false;let l=createRule({type:"and",validator:R,message:"The value does not match all of the provided validators"}),u=[...r??[]];return l._params=u,typeof l=="function"?l(...u):l}function G(...e){let t=e.some(a=>typeof a=="function"?a.constructor.name==="AsyncFunction":a._async),r=e.map(a=>typeof a=="function"?null:a._params).flat().filter(a=>!!a);function n(a,m,...o){let y=[],b=0;for(let d of a)if(typeof d=="function")y.push(d(m)),b++;else {let D=d._params?.length??0;y.push(d.validator(m,...o.slice(b,D))),D&&(b+=D);}return y}function s(a){return a.some(o=>typeof o!="boolean")?{$valid:a.some(o=>typeof o=="boolean"?!!o:o.$valid),...a.reduce((o,y)=>{if(typeof y=="boolean")return o;let{$valid:b,...d}=y;return {...o,...d}},{})}:a.some(o=>!!o)}let l=createRule({type:"or",validator:t?async(a,...m)=>{let o=await Promise.all(n(e,a,...m));return s(o)}:(a,...m)=>{let o=n(e,a,...m);return s(o)},message:"The value does not match any of the provided validators"}),u=[...r??[]];return l._params=u,typeof l=="function"?l(...u):l}function B(e,t){let r,n,s,R,l;typeof e=="function"?(n=e,l=e.constructor.name==="AsyncFunction"):({_type:r,validator:n,_params:R}=e,l=e._async),l?s=async(m,...o)=>i(m)?!await n(m,...o):true:s=(m,...o)=>i(m)?!n(m,...o):true;let u=createRule({type:"not",validator:s,message:t??"Error"}),a=[...R??[]];return u._params=a,typeof u=="function"?u(...a):u}var Qt=createRule({type:"required",validator:e=>i(e),message:"This field is required"});var er=createRule({type:"maxLength",validator:(e,t,r)=>{let{allowEqual:n=true}=r??{};return i(e,false)&&i(t)?c(t)?n?h(e)<=t:h(e)<t:(console.warn(`[maxLength] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),false):true},message:({$value:e,$params:[t]})=>Array.isArray(e)?`This list should have maximum ${t} items`:`The value length should not exceed ${t}`});var ar=createRule({type:"required",validator(e,t){return t?i(e):true},message:"This field is required",active({$params:[e]}){return e}});var X=/^[a-zA-Z]*$/,Y=/^[\w.]+$/,lr=createRule({type:"alpha",validator(e,t){return f(e)?true:t?.allowSymbols?p(e,Y):p(e,X)},message:"The value is not alphabetical"});var ee=/^[a-zA-Z0-9]*$/,te=/^[a-zA-Z0-9_]*$/,Rr=createRule({type:"alphaNum",validator(e,t){return f(e)?true:t?.allowSymbols?p(e,te):p(e,ee)},message:"The value must be alpha-numeric"});var gr=createRule({type:"between",validator:(e,t,r,n)=>{let{allowEqual:s=true}=n??{};if(i(e)&&i(t)&&i(r)){let R=g(e),l=g(t),u=g(r);return c(R)&&c(l)&&c(u)?s?R>=l&&R<=u:R>l&&R<u:(console.warn(`[between] Value or parameters aren't numbers, got value: ${e}, min: ${t}, max: ${r}`),false)}return true},message:({$params:[e,t]})=>`The value must be between ${e} and ${t}`});var ae=/^[-]?\d*(\.\d+)?$/,br=createRule({type:"decimal",validator(e){return f(e)?true:p(e,ae)},message:"The value must be decimal"});var oe=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i,Pr=createRule({type:"email",validator(e){return f(e)?true:p(e,oe)},message:"The value must be an valid email address"});var le=/(^[0-9]*$)|(^-[0-9]+$)/,Vr=createRule({type:"integer",validator(e){return f(e)?true:p(e,le)},message:"The value must be an integer"});var Fr=createRule({type:"maxValue",validator:(e,t,r)=>{let{allowEqual:n=true}=r??{};return i(e)&&i(t)?c(t)&&!isNaN(g(e))?n?g(e)<=t:g(e)<t:(console.warn(`[maxValue] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),true):true},message:({$params:[e,t]})=>{let{allowEqual:r=true}=t??{};return r?`The value must be less than or equal to ${e}`:`The value must be less than ${e}`}});var Or=createRule({type:"minLength",validator:(e,t,r)=>{let{allowEqual:n=true}=r??{};return i(e,false)&&i(t)?c(t)?n?h(e)>=t:h(e)>t:(console.warn(`[minLength] Parameter isn't a number, got parameter: ${t}`),false):true},message:({$value:e,$params:[t]})=>Array.isArray(e)?`The list should have at least ${t} items`:`The value length should be at least ${t}`});var zr=createRule({type:"minValue",validator:(e,t,r)=>{let{allowEqual:n=true}=r??{};return i(e)&&i(t)?c(t)&&!isNaN(g(e))?n?g(e)>=t:g(e)>t:(console.warn(`[minValue] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),true):true},message:({$params:[e,t]})=>{let{allowEqual:r=true}=t??{};return r?`The value must be greater than or equal to ${e}`:`The value must be greater than ${e}`}});var Gr=createRule({type:"exactValue",validator:(e,t)=>i(e)&&i(t)?c(t)&&!isNaN(g(e))?g(e)===t:(console.warn(`[exactValue] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),true):true,message:({$params:[e]})=>`The value must be equal to ${e}`});var Jr=createRule({type:"exactLength",validator:(e,t)=>i(e,false)&&i(t)?c(t)?h(e)===t:(console.warn(`[minLength] Parameter isn't a number, got parameter: ${t}`),false):true,message:({$params:[e]})=>`The value should be exactly ${e} characters long`});var ce=/^\d*(\.\d+)?$/,Yr=createRule({type:"numeric",validator(e){return f(e)?true:p(e,ce)},message:"The value must be numeric"});var rn=createRule({type:"required",validator(e,t){return t?true:i(e)},message:"This field is required",active({$params:[e]}){return !e}});var sn=createRule({type:"sameAs",validator(e,t,r="other"){return f(e)?true:e===t},message({$params:[e,t]}){return `The value must be equal to the ${t} value`}});var xe=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i,fn=createRule({type:"url",validator(e){return f(e)?true:p(e,xe)},message:"The value is not a valid URL address"});function be(){return navigator.languages!=null?navigator.languages[0]:navigator.language}function w(e){return e?new Intl.DateTimeFormat(be(),{dateStyle:"short"}).format(new Date(e)):"?"}var dn=createRule({type:"dateAfter",validator:(e,t)=>i(e)&&i(t)?x(e)&&x(t)?T(e).getTime()>T(t).getTime()?true:{$valid:false,error:"date-not-after"}:{$valid:false,error:"value-or-paramater-not-a-date"}:true,message:({$params:[e],error:t})=>t==="value-or-paramater-not-a-date"?"The values must be dates":`The date must be after ${w(e)}`});var Dn=createRule({type:"dateBefore",validator:(e,t)=>i(e)&&i(t)?x(e)&&x(t)?T(e).getTime()<T(t).getTime()?true:{$valid:false,error:"date-not-before"}:{$valid:false,error:"value-or-paramater-not-a-date"}:true,message:({$params:[e],error:t})=>t==="value-or-paramater-not-a-date"?"The fields must be dates":`The date must be before ${w(e)}`});var vn=createRule({type:"dateBetween",validator:(e,t,r)=>x(e)&&x(t)&&x(r)?T(e).getTime()>T(t).getTime()&&T(e).getTime()<T(r).getTime():true,message:({$params:[e,t]})=>`The date must be between ${w(e)} and ${w(t)}`});function we(e){if(e.length>3||e.length===0||e[0]==="0"&&e!=="0"||!e.match(/^\d+$/))return false;let t=+e|0;return t>=0&&t<=255}var Cn=createRule({type:"ipv4Address",validator(e){if(f(e))return true;if(typeof e!="string")return false;let t=e.split(".");return t.length===4&&t.every(we)},message:"The value is not a valid IPv4 address"});var En=createRule({type:"macAddress",validator(e,t=":"){if(f(e))return true;if(typeof e!="string")return false;let r=typeof t=="string"&&t!==""?e.split(t):e.length===12||e.length===16?e.match(/.{2}/g):null;return r!==null&&(r.length===6||r.length===8)&&r.every(ve)},message:"The value is not a valid MAC Address"}),ve=e=>e.toLowerCase().match(/^[0-9a-f]{2}$/);var Sn=createRule({type:"checked",validator:e=>i(e)?e===true:true,message:"The field must be checked"});var Un=createRule({type:"contains",validator(e,t){return i(e)&&i(t)?e.includes(t):true},message({$params:[e]}){return `The value must contain ${e}`}});var Zn=createRule({type:"startsWith",validator(e,t){return i(e)&&i(t)?e.startsWith(t):true},message({$params:[e]}){return `The value must end with ${e}`}});var Xn=createRule({type:"endsWith",validator(e,t){return i(e)&&i(t)?e.endsWith(t):true},message({$params:[e]}){return `The value must end with ${e}`}});var ta=createRule({type:"regex",validator(e,t){if(i(e)){let r=Array.isArray(t)?t:[t];return p(e,...r)}return true},message:"The value does not match the required pattern"});function ia(e){let t=computed(()=>toValue(e));return M(P((n,s)=>i(n)&&i(s,false)?s.includes(n):true,[t]),({$params:[n]})=>`The value should be one of those options: ${n.join(", ")}.`)}function Ie(e){let t=Object.keys(e).filter(n=>typeof e[e[n]]!="number"),r={};for(let n of t)r[n]=e[n];return Object.values(r)}function ua(e){let t=computed(()=>toValue(e));return M(P((n,s)=>i(n)&&!f(s)?Ie(s).includes(n):true,[t]),({$params:[n]})=>`The value should be one of those options: ${Object.values(n).join(", ")}.`)}function ya(e){let t=computed(()=>toValue(e));return M(P((n,s)=>s===n,[t]),({$params:[n]})=>`Value should be ${n}.`)}export{lr as alpha,Rr as alphaNum,q as and,S as applyIf,gr as between,Sn as checked,Un as contains,dn as dateAfter,Dn as dateBefore,vn as dateBetween,br as decimal,Pr as email,Xn as endsWith,Jr as exactLength,Gr as exactValue,h as getSize,Vr as integer,Cn as ipv4Address,x as isDate,f as isEmpty,i as isFilled,c as isNumber,ya as literal,En as macAddress,p as matchRegex,er as maxLength,Fr as maxValue,Or as minLength,zr as minValue,ua as nativeEnum,B as not,Yr as numeric,ia as oneOf,G as or,ta as regex,Qt as required,ar as requiredIf,rn as requiredUnless,sn as sameAs,Zn as startsWith,T as toDate,g as toNumber,fn as url,E as withAsync,M as withMessage,P as withParams,_ as withTooltip};
@@ -497,7 +497,7 @@ var maxLength = createRule({
497
497
  if (Array.isArray($value)) {
498
498
  return `This list should have maximum ${count} items`;
499
499
  }
500
- return `The maximum length allowed is ${count}`;
500
+ return `The value length should not exceed ${count}`;
501
501
  }
502
502
  });
503
503
  var requiredIf = createRule({
@@ -517,11 +517,11 @@ var alphaRegex = /^[a-zA-Z]*$/;
517
517
  var alphaSymbolRegex = /^[\w.]+$/;
518
518
  var alpha = createRule({
519
519
  type: "alpha",
520
- validator(value, allowSymbols) {
520
+ validator(value, options) {
521
521
  if (isEmpty(value)) {
522
522
  return true;
523
523
  }
524
- if (allowSymbols) {
524
+ if (options?.allowSymbols) {
525
525
  return matchRegex(value, alphaSymbolRegex);
526
526
  }
527
527
  return matchRegex(value, alphaRegex);
@@ -532,11 +532,11 @@ var alphaNumRegex = /^[a-zA-Z0-9]*$/;
532
532
  var alphaNumSymbolRegex = /^[a-zA-Z0-9_]*$/;
533
533
  var alphaNum = createRule({
534
534
  type: "alphaNum",
535
- validator(value, allowSymbols) {
535
+ validator(value, options) {
536
536
  if (isEmpty(value)) {
537
537
  return true;
538
538
  }
539
- if (allowSymbols) {
539
+ if (options?.allowSymbols) {
540
540
  return matchRegex(value, alphaNumSymbolRegex);
541
541
  }
542
542
  return matchRegex(value, alphaNumRegex);
@@ -576,7 +576,7 @@ var decimal = createRule({
576
576
  }
577
577
  return matchRegex(value, decimalRegex);
578
578
  },
579
- message: "Value must be decimal"
579
+ message: "The value must be decimal"
580
580
  });
581
581
  var emailRegex = /^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
582
582
  var email = createRule({
@@ -587,7 +587,7 @@ var email = createRule({
587
587
  }
588
588
  return matchRegex(value, emailRegex);
589
589
  },
590
- message: "Value must be an valid email address"
590
+ message: "The value must be an valid email address"
591
591
  });
592
592
  var integerRegex = /(^[0-9]*$)|(^-[0-9]+$)/;
593
593
  var integer = createRule({
@@ -598,7 +598,7 @@ var integer = createRule({
598
598
  }
599
599
  return matchRegex(value, integerRegex);
600
600
  },
601
- message: "Value must be an integer"
601
+ message: "The value must be an integer"
602
602
  });
603
603
  var maxValue = createRule({
604
604
  type: "maxValue",
@@ -620,9 +620,9 @@ var maxValue = createRule({
620
620
  message: ({ $params: [count, options] }) => {
621
621
  const { allowEqual = true } = options ?? {};
622
622
  if (allowEqual) {
623
- return `Value must be less than or equal to ${count}`;
623
+ return `The value must be less than or equal to ${count}`;
624
624
  } else {
625
- return `Value must be less than ${count}`;
625
+ return `The value must be less than ${count}`;
626
626
  }
627
627
  }
628
628
  });
@@ -645,9 +645,9 @@ var minLength = createRule({
645
645
  },
646
646
  message: ({ $value, $params: [count] }) => {
647
647
  if (Array.isArray($value)) {
648
- return `This list should have at least ${count} items`;
648
+ return `The list should have at least ${count} items`;
649
649
  }
650
- return `This field should be at least ${count} characters long`;
650
+ return `The value length should be at least ${count}`;
651
651
  }
652
652
  });
653
653
  var minValue = createRule({
@@ -670,9 +670,9 @@ var minValue = createRule({
670
670
  message: ({ $params: [count, options] }) => {
671
671
  const { allowEqual = true } = options ?? {};
672
672
  if (allowEqual) {
673
- return `Value must be greater than or equal to ${count}`;
673
+ return `The value must be greater than or equal to ${count}`;
674
674
  } else {
675
- return `Value must be greater than ${count}`;
675
+ return `The value must be greater than ${count}`;
676
676
  }
677
677
  }
678
678
  });
@@ -705,7 +705,7 @@ var exactLength = createRule({
705
705
  return true;
706
706
  },
707
707
  message: ({ $params: [count] }) => {
708
- return `This field should be exactly ${count} characters long`;
708
+ return `The value should be exactly ${count} characters long`;
709
709
  }
710
710
  });
711
711
  var numericRegex = /^\d*(\.\d+)?$/;
@@ -717,7 +717,7 @@ var numeric = createRule({
717
717
  }
718
718
  return matchRegex(value, numericRegex);
719
719
  },
720
- message: "This field must be numeric"
720
+ message: "The value must be numeric"
721
721
  });
722
722
  var requiredUnless = createRule({
723
723
  type: "required",
@@ -741,7 +741,7 @@ var sameAs = createRule({
741
741
  return value === target;
742
742
  },
743
743
  message({ $params: [_, otherName] }) {
744
- return `Value must be equal to the ${otherName} value`;
744
+ return `The value must be equal to the ${otherName} value`;
745
745
  }
746
746
  });
747
747
  var urlRegex = /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;
@@ -786,7 +786,7 @@ var dateAfter = createRule({
786
786
  },
787
787
  message: ({ $params: [after], error }) => {
788
788
  if (error === "value-or-paramater-not-a-date") {
789
- return "The inputs must be Dates";
789
+ return "The values must be dates";
790
790
  }
791
791
  return `The date must be after ${formatLocaleDate(after)}`;
792
792
  }
@@ -808,7 +808,7 @@ var dateBefore = createRule({
808
808
  },
809
809
  message: ({ $params: [before], error }) => {
810
810
  if (error === "value-or-paramater-not-a-date") {
811
- return "The fields must be Dates";
811
+ return "The fields must be dates";
812
812
  }
813
813
  return `The date must be before ${formatLocaleDate(before)}`;
814
814
  }
@@ -875,7 +875,7 @@ var checked = createRule({
875
875
  }
876
876
  return true;
877
877
  },
878
- message: "This field must be checked"
878
+ message: "The field must be checked"
879
879
  });
880
880
  var contains = createRule({
881
881
  type: "contains",
@@ -886,7 +886,7 @@ var contains = createRule({
886
886
  return true;
887
887
  },
888
888
  message({ $params: [part] }) {
889
- return `Field must contain ${part}`;
889
+ return `The value must contain ${part}`;
890
890
  }
891
891
  });
892
892
  var startsWith = createRule({
@@ -898,7 +898,7 @@ var startsWith = createRule({
898
898
  return true;
899
899
  },
900
900
  message({ $params: [part] }) {
901
- return `Field must end with ${part}`;
901
+ return `The value must end with ${part}`;
902
902
  }
903
903
  });
904
904
  var endsWith = createRule({
@@ -910,7 +910,7 @@ var endsWith = createRule({
910
910
  return true;
911
911
  },
912
912
  message({ $params: [part] }) {
913
- return `Field must end with ${part}`;
913
+ return `The value must end with ${part}`;
914
914
  }
915
915
  });
916
916
  var regex = createRule({
@@ -922,7 +922,7 @@ var regex = createRule({
922
922
  }
923
923
  return true;
924
924
  },
925
- message: "This field does not match the required pattern"
925
+ message: "The value does not match the required pattern"
926
926
  });
927
927
  function oneOf(options) {
928
928
  const params = computed(() => toValue(options));
@@ -936,7 +936,7 @@ function oneOf(options) {
936
936
  },
937
937
  [params]
938
938
  ),
939
- ({ $params: [options2] }) => `Value should be one of those options: ${options2.join(", ")}.`
939
+ ({ $params: [options2] }) => `The value should be one of those options: ${options2.join(", ")}.`
940
940
  );
941
941
  return rule;
942
942
  }
@@ -961,7 +961,7 @@ function nativeEnum(enumLike) {
961
961
  },
962
962
  [params]
963
963
  ),
964
- ({ $params: [enumLike2] }) => `Value should be one of those options: ${Object.values(enumLike2).join(", ")}.`
964
+ ({ $params: [enumLike2] }) => `The value should be one of those options: ${Object.values(enumLike2).join(", ")}.`
965
965
  );
966
966
  return rule;
967
967
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@regle/rules",
3
- "version": "1.1.0-beta.3",
3
+ "version": "1.1.0-beta.5",
4
4
  "description": "Collection of rules and helpers for Regle",
5
5
  "dependencies": {
6
- "@regle/core": "1.1.0-beta.3"
6
+ "@regle/core": "1.1.0-beta.5"
7
7
  },
8
8
  "devDependencies": {
9
9
  "@typescript-eslint/eslint-plugin": "8.28.0",