@regle/rules 1.8.5 → 1.8.6

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.
@@ -134,26 +134,7 @@ declare function getSize(value: MaybeRef<string | any[] | Record<string, any> |
134
134
  */
135
135
  declare function toNumber<T extends number | string | undefined>(argument: T): number;
136
136
  //#endregion
137
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/observable-like.d.ts
138
- declare global {
139
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
140
- interface SymbolConstructor {
141
- readonly observable: symbol;
142
- }
143
- }
144
-
145
- /**
146
- @remarks
147
- The TC39 observable proposal defines a `closed` property, but some implementations (such as xstream) do not as of 10/08/2021.
148
- As well, some guidance on making an `Observable` to not include `closed` property.
149
- @see https://github.com/tc39/proposal-observable/blob/master/src/Observable.js#L129-L130
150
- @see https://github.com/staltz/xstream/blob/6c22580c1d84d69773ee4b0905df44ad464955b3/src/index.ts#L79-L85
151
- @see https://github.com/benlesh/symbol-observable#making-an-object-observable
152
-
153
- @category Observable
154
- */
155
- //#endregion
156
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/empty-object.d.ts
137
+ //#region ../../node_modules/.pnpm/type-fest@5.0.0/node_modules/type-fest/source/empty-object.d.ts
157
138
  declare const emptyObjectSymbol: unique symbol;
158
139
 
159
140
  /**
@@ -185,22 +166,6 @@ Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<n
185
166
  type EmptyObject = {
186
167
  [emptyObjectSymbol]?: never;
187
168
  };
188
-
189
- /**
190
- Returns a `boolean` for whether the type is strictly equal to an empty plain object, the `{}` value.
191
-
192
- @example
193
- ```
194
- import type {IsEmptyObject} from 'type-fest';
195
-
196
- type Pass = IsEmptyObject<{}>; //=> true
197
- type Fail = IsEmptyObject<[]>; //=> false
198
- type Fail = IsEmptyObject<null>; //=> false
199
- ```
200
-
201
- @see EmptyObject
202
- @category Object
203
- */
204
169
  //#endregion
205
170
  //#region ../shared/utils/isEmpty.d.ts
206
171
  /**
@@ -147,7 +147,7 @@ function applyIf(_condition, rule) {
147
147
  if (condition) return validator(value, ...args);
148
148
  return true;
149
149
  }
150
- function newActive(metadata) {
150
+ function newActive() {
151
151
  const [condition] = unwrapRuleParameters([_condition]);
152
152
  return condition;
153
153
  }
@@ -159,10 +159,8 @@ function applyIf(_condition, rule) {
159
159
  });
160
160
  const newParams = [..._params ?? []];
161
161
  newRule._params = newParams;
162
- if (typeof newRule === "function") {
163
- const executedRule = newRule(...newParams);
164
- return executedRule;
165
- } else return newRule;
162
+ if (typeof newRule === "function") return newRule(...newParams);
163
+ else return newRule;
166
164
  }
167
165
 
168
166
  //#endregion
@@ -215,7 +213,7 @@ function isDate(value) {
215
213
  possibleDate = date$1;
216
214
  }
217
215
  return !!possibleDate;
218
- } catch (e) {
216
+ } catch {
219
217
  return false;
220
218
  }
221
219
  }
@@ -301,8 +299,7 @@ function toNumber(argument) {
301
299
  if (typeof argument === "number") return argument;
302
300
  else if (argument != null) {
303
301
  if (typeof argument === "string") {
304
- const isPadded = argument.trim() !== argument;
305
- if (isPadded) return NaN;
302
+ if (argument.trim() !== argument) return NaN;
306
303
  return +argument;
307
304
  }
308
305
  return NaN;
@@ -342,15 +339,14 @@ function and(...rules) {
342
339
  return $rules;
343
340
  }
344
341
  function computeMetadata(results) {
345
- const isAnyResultMetaData = results?.some((s) => typeof s !== "boolean");
346
- if (isAnyResultMetaData) return {
342
+ if (results?.some((s) => typeof s !== "boolean")) return {
347
343
  $valid: results.every((result) => {
348
344
  if (typeof result === "boolean") return !!result;
349
345
  return result.$valid;
350
346
  }),
351
347
  ...results.reduce((acc, result) => {
352
348
  if (typeof result === "boolean") return acc;
353
- const { $valid,...rest } = result;
349
+ const { $valid: _$valid,...rest } = result;
354
350
  return {
355
351
  ...acc,
356
352
  ...rest
@@ -360,14 +356,14 @@ function and(...rules) {
360
356
  else return results.every((result) => !!result);
361
357
  }
362
358
  let validator;
363
- if (!!rules.length) validator = isAnyRuleAsync ? async (value, ...params) => {
359
+ if (rules.length) validator = isAnyRuleAsync ? async (value, ...params) => {
364
360
  const results = await Promise.all(computeRules(rules, value, ...params));
365
361
  return computeMetadata(results);
366
362
  } : (value, ...params) => {
367
363
  const $rules = computeRules(rules, value, ...params);
368
364
  return computeMetadata($rules);
369
365
  };
370
- else validator = (value) => {
366
+ else validator = (_value) => {
371
367
  return false;
372
368
  };
373
369
  const newRule = createRule({
@@ -377,10 +373,8 @@ function and(...rules) {
377
373
  });
378
374
  const newParams = [..._params ?? []];
379
375
  newRule._params = newParams;
380
- if (typeof newRule === "function") {
381
- const executedRule = newRule(...newParams);
382
- return executedRule;
383
- } else return newRule;
376
+ if (typeof newRule === "function") return newRule(...newParams);
377
+ else return newRule;
384
378
  }
385
379
 
386
380
  //#endregion
@@ -411,15 +405,14 @@ function or(...rules) {
411
405
  return $rules;
412
406
  }
413
407
  function computeMetadata(results) {
414
- const isAnyResultMetaData = results.some((s) => typeof s !== "boolean");
415
- if (isAnyResultMetaData) return {
408
+ if (results.some((s) => typeof s !== "boolean")) return {
416
409
  $valid: results.some((result) => {
417
410
  if (typeof result === "boolean") return !!result;
418
411
  return result.$valid;
419
412
  }),
420
413
  ...results.reduce((acc, result) => {
421
414
  if (typeof result === "boolean") return acc;
422
- const { $valid,...rest } = result;
415
+ const { $valid: _,...rest } = result;
423
416
  return {
424
417
  ...acc,
425
418
  ...rest
@@ -428,24 +421,21 @@ function or(...rules) {
428
421
  };
429
422
  else return results.some((result) => !!result);
430
423
  }
431
- const validator = isAnyRuleAsync ? async (value, ...params) => {
432
- const results = await Promise.all(computeRules(rules, value, ...params));
433
- return computeMetadata(results);
434
- } : (value, ...params) => {
435
- const $rules = computeRules(rules, value, ...params);
436
- return computeMetadata($rules);
437
- };
438
424
  const newRule = createRule({
439
425
  type: "or",
440
- validator,
426
+ validator: isAnyRuleAsync ? async (value, ...params) => {
427
+ const results = await Promise.all(computeRules(rules, value, ...params));
428
+ return computeMetadata(results);
429
+ } : (value, ...params) => {
430
+ const $rules = computeRules(rules, value, ...params);
431
+ return computeMetadata($rules);
432
+ },
441
433
  message: "The value does not match any of the provided validators"
442
434
  });
443
435
  const newParams = [..._params ?? []];
444
436
  newRule._params = newParams;
445
- if (typeof newRule === "function") {
446
- const executedRule = newRule(...newParams);
447
- return executedRule;
448
- } else return newRule;
437
+ if (typeof newRule === "function") return newRule(...newParams);
438
+ else return newRule;
449
439
  }
450
440
 
451
441
  //#endregion
@@ -467,10 +457,7 @@ function not(rule, message) {
467
457
  _async = rule._async;
468
458
  }
469
459
  if (_async) newValidator = async (value, ...params) => {
470
- if (isFilled(value)) {
471
- const result = await validator(value, ...params);
472
- return !result;
473
- }
460
+ if (isFilled(value)) return !await validator(value, ...params);
474
461
  return true;
475
462
  };
476
463
  else newValidator = (value, ...params) => {
@@ -484,10 +471,8 @@ function not(rule, message) {
484
471
  });
485
472
  const newParams = [..._params ?? []];
486
473
  newRule._params = newParams;
487
- if (typeof newRule === "function") {
488
- const executedRule = newRule(...newParams);
489
- return executedRule;
490
- } else return newRule;
474
+ if (typeof newRule === "function") return newRule(...newParams);
475
+ else return newRule;
491
476
  }
492
477
 
493
478
  //#endregion
@@ -668,8 +653,7 @@ const dateAfter = createRule({
668
653
  const { allowEqual = true } = options ?? {};
669
654
  if (isFilled(value) && isFilled(after)) {
670
655
  if (isDate(value) && isDate(after)) {
671
- const result = allowEqual ? toDate(value).getTime() >= toDate(after).getTime() : toDate(value).getTime() > toDate(after).getTime();
672
- if (result) return true;
656
+ if (allowEqual ? toDate(value).getTime() >= toDate(after).getTime() : toDate(value).getTime() > toDate(after).getTime()) return true;
673
657
  return {
674
658
  $valid: false,
675
659
  error: "date-not-after"
@@ -702,8 +686,7 @@ const dateBefore = createRule({
702
686
  const { allowEqual = true } = options ?? {};
703
687
  if (isFilled(value) && isFilled(before)) {
704
688
  if (isDate(value) && isDate(before)) {
705
- const result = allowEqual ? toDate(value).getTime() <= toDate(before).getTime() : toDate(value).getTime() < toDate(before).getTime();
706
- if (result) return true;
689
+ if (allowEqual ? toDate(value).getTime() <= toDate(before).getTime() : toDate(value).getTime() < toDate(before).getTime()) return true;
707
690
  return {
708
691
  $valid: false,
709
692
  error: "date-not-before"
@@ -894,11 +877,10 @@ const ipv4Address = createRule({
894
877
  */
895
878
  function literal(literal$1) {
896
879
  const params = computed(() => toValue(literal$1));
897
- const rule = withMessage(withParams((value, literal$2) => {
880
+ return withMessage(withParams((value, literal$2) => {
898
881
  if (isFilled(value) && isFilled(literal$2)) return literal$2 === value;
899
882
  return true;
900
883
  }, [params]), ({ $params: [literal$2] }) => `Value should be ${literal$2}.`);
901
- return rule;
902
884
  }
903
885
 
904
886
  //#endregion
@@ -1039,14 +1021,10 @@ function getValidEnumValues(obj) {
1039
1021
  */
1040
1022
  function nativeEnum(enumLike) {
1041
1023
  const params = computed(() => toValue(enumLike));
1042
- const rule = withMessage(withParams((value, enumLike$1) => {
1043
- if (isFilled(value) && !isEmpty(enumLike$1)) {
1044
- const validValues = getValidEnumValues(enumLike$1);
1045
- return validValues.includes(value);
1046
- }
1024
+ return withMessage(withParams((value, enumLike$1) => {
1025
+ if (isFilled(value) && !isEmpty(enumLike$1)) return getValidEnumValues(enumLike$1).includes(value);
1047
1026
  return true;
1048
1027
  }, [params]), ({ $params: [enumLike$1] }) => `The value should be one of those options: ${Object.values(enumLike$1).join(", ")}.`);
1049
- return rule;
1050
1028
  }
1051
1029
 
1052
1030
  //#endregion
@@ -1102,10 +1080,7 @@ const oneOf = createRule({
1102
1080
  const regex = createRule({
1103
1081
  type: "regex",
1104
1082
  validator(value, regexp) {
1105
- if (isFilled(value)) {
1106
- const filteredRegexp = Array.isArray(regexp) ? regexp : [regexp];
1107
- return matchRegex(value, ...filteredRegexp);
1108
- }
1083
+ if (isFilled(value)) return matchRegex(value, ...Array.isArray(regexp) ? regexp : [regexp]);
1109
1084
  return true;
1110
1085
  },
1111
1086
  message: "The value does not match the required pattern"
@@ -1169,7 +1144,7 @@ const requiredUnless = createRule({
1169
1144
  */
1170
1145
  const sameAs = createRule({
1171
1146
  type: "sameAs",
1172
- validator(value, target, otherName) {
1147
+ validator(value, target, _otherName) {
1173
1148
  if (isEmpty(value)) return true;
1174
1149
  return value === target;
1175
1150
  },
@@ -1 +1 @@
1
- import{InternalRuleType as e,createRule as t,unwrapRuleParameters as n}from"@regle/core";import{computed as r,toValue as i,unref as a}from"vue";function o(n,r){let i,a,o,s;typeof n==`function`&&!(`_validator`in n)?(i=e.Inline,a=n):{_type:i,validator:a,_active:o,_params:s}=n;let c=t({type:i,validator:a,active:o,message:r}),l=[...s??[]];if(c._params=l,c._message_patched=!0,typeof c==`function`){if(s!=null){let e=c(...l);return e._message_patched=!0,e}return c}else return c}function s(n,r){let i,a,o,s,c;typeof n==`function`&&!(`_validator`in n)?(i=e.Inline,a=n):{_type:i,validator:a,_active:o,_params:s,_message:c}=n;let l=t({type:i,validator:a,active:o,message:c,tooltip:r}),u=[...s??[]];if(l._params=u,l._tooltip_patched=!0,typeof l==`function`){let e=l(...u);return l._tooltip_patched=!0,e}else return l}function c(n,r){let i,a,o=[],s=``;typeof n==`function`?(a=async(e,...t)=>n(e,...t),o=[r]):({_type:i,_message:s}=n,o=o=n._params?.concat(r),a=async(...e)=>n.validator(e));let c=t({type:i??e.Async,validator:a,message:s,async:!0});return c._params=c._params?.concat(o),c(...r??[])}function l(n,r){let i,a,o=[],s=``;typeof n==`function`?(e.Inline,a=(e,...t)=>n(e,...t),o=[r]):({_type:i,validator:a,_message:s}=n,o=o=n._params?.concat(r));let c=t({type:e.Inline,validator:a,message:s});return c._params=c._params?.concat(o),c(...r)}function u(r,i){let a,o,s=[],c=``;typeof i==`function`?(a=e.Inline,o=i,s=[r]):({_type:a,validator:o,_message:c}=i,s=i._params?.concat([r]));function l(e,...t){let[i]=n([r]);return i?o(e,...t):!0}function u(e){let[t]=n([r]);return t}let d=t({type:a,validator:l,active:u,message:c}),f=[...s??[]];if(d._params=f,typeof d==`function`){let e=d(...f);return e}else return d}function d(e){return e?.constructor.name==`File`||e?.constructor.name==`FileList`}function f(e,t=!0){return e==null?!0:e instanceof Date?isNaN(e.getTime()):d(e)?e.size<=0:Array.isArray(e)?t?e.length===0:!1:typeof e==`object`&&e?Object.keys(e).length===0:!String(e).length}function p(e){if(f(e))return!1;try{let t=null;if(e instanceof Date)t=e;else if(typeof e==`string`){let n=new Date(e);if(n.toString()===`Invalid Date`)return!1;t=n}return!!t}catch{return!1}}function m(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]`||typeof e==`string`||t===`[object String]`?new Date(e):new Date(NaN)}function h(e,t=!0){return!f(typeof e==`string`?e.trim():e,t)}function g(e){return e==null?!1:typeof e==`number`?!isNaN(e):!1}function _(e,...t){if(f(e))return!0;let n=typeof e==`number`?e.toString():e;return t.every(e=>(e.lastIndex=0,e.test(n)))}function v(e){let t=a(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 y(e){if(typeof e==`number`)return e;if(e!=null){if(typeof e==`string`){let t=e.trim()!==e;return t?NaN:+e}return NaN}return NaN}function b(...e){let n=e.some(e=>typeof e==`function`?e.constructor.name===`AsyncFunction`:e._async),r=e.map(e=>{if(typeof e==`function`)return null;{let t=e._params;return t?.length?t:[]}}).flat().filter(e=>!!e);function i(e,t,...n){let r=[],i=0;for(let a of e)if(typeof a==`function`)r.push(a(t)),i++;else{let e=a._params?.length??0;r.push(a.validator(t,...n.slice(i,e))),e&&(i+=e)}return r}function a(e){let t=e?.some(e=>typeof e!=`boolean`);return t?{$valid:e.every(e=>typeof e==`boolean`?!!e:e.$valid),...e.reduce((e,t)=>{if(typeof t==`boolean`)return e;let{$valid:n,...r}=t;return{...e,...r}},{})}:e.every(e=>!!e)}let o;o=e.length?n?async(t,...n)=>{let r=await Promise.all(i(e,t,...n));return a(r)}:(t,...n)=>{let r=i(e,t,...n);return a(r)}:e=>!1;let s=t({type:`and`,validator:o,message:`The value does not match all of the provided validators`}),c=[...r??[]];if(s._params=c,typeof s==`function`){let e=s(...c);return e}else return s}function ee(...e){let n=e.some(e=>typeof e==`function`?e.constructor.name===`AsyncFunction`:e._async),r=e.map(e=>typeof e==`function`?null:e._params).flat().filter(e=>!!e);function i(e,t,...n){let r=[],i=0;for(let a of e)if(typeof a==`function`)r.push(a(t)),i++;else{let e=a._params?.length??0;r.push(a.validator(t,...n.slice(i,e))),e&&(i+=e)}return r}function a(e){let t=e.some(e=>typeof e!=`boolean`);return t?{$valid:e.some(e=>typeof e==`boolean`?!!e:e.$valid),...e.reduce((e,t)=>{if(typeof t==`boolean`)return e;let{$valid:n,...r}=t;return{...e,...r}},{})}:e.some(e=>!!e)}let o=n?async(t,...n)=>{let r=await Promise.all(i(e,t,...n));return a(r)}:(t,...n)=>{let r=i(e,t,...n);return a(r)},s=t({type:`or`,validator:o,message:`The value does not match any of the provided validators`}),c=[...r??[]];if(s._params=c,typeof s==`function`){let e=s(...c);return e}else return s}function x(e,n){let r,i,a,o,s;typeof e==`function`?(i=e,s=e.constructor.name===`AsyncFunction`):({_type:r,validator:i,_params:o}=e,s=e._async),a=s?async(e,...t)=>{if(h(e)){let n=await i(e,...t);return!n}return!0}:(e,...t)=>h(e)?!i(e,...t):!0;let c=t({type:`not`,validator:a,message:n??`Error`}),l=[...o??[]];if(c._params=l,typeof c==`function`){let e=c(...l);return e}else return c}function S(e,t){return r(()=>i(e)?t:{})}const C=/^[a-zA-Z]*$/,w=/^[\w.]+$/,T=t({type:`alpha`,validator(e,t){return f(e)?!0:t?.allowSymbols?_(e,w):_(e,C)},message:`The value is not alphabetical`}),E=/^[a-zA-Z0-9]*$/,D=/^[a-zA-Z0-9_]*$/,O=t({type:`alphaNum`,validator(e,t){return f(e)?!0:t?.allowSymbols?_(e,D):_(e,E)},message:`The value must be alpha-numeric`}),k=t({type:`between`,validator:(e,t,n,r)=>{let{allowEqual:i=!0}=r??{};if(h(e)&&h(t)&&h(n)){let r=y(e),a=y(t),o=y(n);return g(r)&&g(a)&&g(o)?i?r>=a&&r<=o:r>a&&r<o:(console.warn(`[between] Value or parameters aren't numbers, got value: ${e}, min: ${t}, max: ${n}`),!1)}return!0},message:({$params:[e,t]})=>`The value must be between ${e} and ${t}`}),A=t({type:`boolean`,validator:e=>h(e)?typeof e==`boolean`:!0,message:`The value must be a native boolean`}),j=t({type:`checked`,validator:e=>h(e)?e===!0:!0,message:`The field must be checked`}),M=t({type:`contains`,validator(e,t){return h(e)&&h(t)?e.includes(t):!0},message({$params:[e]}){return`The value must contain ${e}`}}),N=t({type:`date`,validator:e=>h(e)?e instanceof Date:!0,message:`The value must be a native Date constructor`});function P(){return navigator.languages==null?navigator.language:navigator.languages[0]}function F(e){return e?new Intl.DateTimeFormat(P(),{dateStyle:`short`}).format(new Date(e)):`?`}const I=t({type:`dateAfter`,validator:(e,t,n)=>{let{allowEqual:r=!0}=n??{};if(h(e)&&h(t)){if(p(e)&&p(t)){let n=r?m(e).getTime()>=m(t).getTime():m(e).getTime()>m(t).getTime();return n?!0:{$valid:!1,error:`date-not-after`}}return{$valid:!1,error:`value-or-parameter-not-a-date`}}return!0},message:({$params:[e],error:t})=>t===`value-or-parameter-not-a-date`?`The values must be dates`:`The date must be after ${F(e)}`}),L=t({type:`dateBefore`,validator:(e,t,n)=>{let{allowEqual:r=!0}=n??{};if(h(e)&&h(t)){if(p(e)&&p(t)){let n=r?m(e).getTime()<=m(t).getTime():m(e).getTime()<m(t).getTime();return n?!0:{$valid:!1,error:`date-not-before`}}return{$valid:!1,error:`value-or-parameter-not-a-date`}}return!0},message:({$params:[e],error:t})=>t===`value-or-parameter-not-a-date`?`The values must be dates`:`The date must be before ${F(e)}`}),R=t({type:`dateBetween`,validator:(e,t,n,r)=>{let{allowEqual:i=!0}=r??{};return p(e)&&p(t)&&p(n)?i?m(e).getTime()>=m(t).getTime()&&m(e).getTime()<=m(n).getTime():m(e).getTime()>m(t).getTime()&&m(e).getTime()<m(n).getTime():!0},message:({$params:[e,t]})=>`The date must be between ${F(e)} and ${F(t)}`}),z=/^[-]?\d*(\.\d+)?$/,B=t({type:`decimal`,validator(e){return f(e)?!0:_(e,z)},message:`The value must be decimal`}),V=/^(?:[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,H=t({type:`email`,validator(e){return f(e)?!0:_(e,V)},message:`The value must be an valid email address`}),U=t({type:`endsWith`,validator(e,t){return h(e)&&h(t)?e.endsWith(t):!0},message({$params:[e]}){return`The value must end with ${e}`}}),W=t({type:`exactLength`,validator:(e,t)=>h(e,!1)&&h(t)?g(t)?v(e)===t:(console.warn(`[minLength] Parameter isn't a number, got parameter: ${t}`),!1):!0,message:({$params:[e]})=>`The value should be exactly ${e} characters long`}),te=t({type:`exactValue`,validator:(e,t)=>h(e)&&h(t)?g(t)&&!isNaN(y(e))?y(e)===t:(console.warn(`[exactValue] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),!0):!0,message:({$params:[e]})=>`The value must be equal to ${e}`}),G=/^[a-fA-F0-9]*$/,K=t({type:`hexadecimal`,validator(e){return f(e)?!0:_(e,G)},message:`The value must be hexadecimal`}),q=/(^[0-9]*$)|(^-[0-9]+$)/,J=t({type:`integer`,validator(e){return f(e)?!0:_(e,q)},message:`The value must be an integer`});function Y(e){if(e.length>3||e.length===0||e[0]===`0`&&e!==`0`||!e.match(/^\d+$/))return!1;let t=e|0;return t>=0&&t<=255}const X=t({type:`ipv4Address`,validator(e){if(f(e))return!0;if(typeof e!=`string`)return!1;let t=e.split(`.`);return t.length===4&&t.every(Y)},message:`The value is not a valid IPv4 address`});function Z(e){let t=r(()=>i(e)),n=o(l((e,t)=>h(e)&&h(t)?t===e:!0,[t]),({$params:[e]})=>`Value should be ${e}.`);return n}const Q=t({type:`macAddress`,validator(e,t=`:`){if(f(e))return!0;if(typeof e!=`string`)return!1;let n=typeof t==`string`&&t!==``?e.split(t):e.length===12||e.length===16?e.match(/.{2}/g):null;return n!==null&&(n.length===6||n.length===8)&&n.every(ne)},message:`The value is not a valid MAC Address`}),ne=e=>e.toLowerCase().match(/^[0-9a-f]{2}$/),re=t({type:`maxLength`,validator:(e,t,n)=>{let{allowEqual:r=!0}=n??{};return h(e,!1)&&h(t)?g(t)?r?v(e)<=t:v(e)<t:(console.warn(`[maxLength] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),!1):!0},message:({$value:e,$params:[t]})=>Array.isArray(e)?`This list should have maximum ${t} items`:`The value length should not exceed ${t}`}),ie=t({type:`maxValue`,validator:(e,t,n)=>{let{allowEqual:r=!0}=n??{};return h(e)&&h(t)?g(t)&&!isNaN(y(e))?r?y(e)<=t:y(e)<t:(console.warn(`[maxValue] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),!0):!0},message:({$params:[e,t]})=>{let{allowEqual:n=!0}=t??{};return n?`The value must be less than or equal to ${e}`:`The value must be less than ${e}`}}),ae=t({type:`minLength`,validator:(e,t,n)=>{let{allowEqual:r=!0}=n??{};return h(e,!1)&&h(t)?g(t)?r?v(e)>=t:v(e)>t:(console.warn(`[minLength] Parameter isn't a number, got parameter: ${t}`),!1):!0},message:({$value:e,$params:[t]})=>Array.isArray(e)?`The list should have at least ${t} items`:`The value length should be at least ${t}`}),oe=t({type:`minValue`,validator:(e,t,n)=>{let{allowEqual:r=!0}=n??{};return h(e)&&h(t)?g(t)&&!isNaN(y(e))?r?y(e)>=t:y(e)>t:(console.warn(`[minValue] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),!0):!0},message:({$params:[e,t]})=>{let{allowEqual:n=!0}=t??{};return n?`The value must be greater than or equal to ${e}`:`The value must be greater than ${e}`}});function se(e){let t=Object.keys(e).filter(t=>typeof e[e[t]]!=`number`),n={};for(let r of t)n[r]=e[r];return Object.values(n)}function ce(e){let t=r(()=>i(e)),n=o(l((e,t)=>{if(h(e)&&!f(t)){let n=se(t);return n.includes(e)}return!0},[t]),({$params:[e]})=>`The value should be one of those options: ${Object.values(e).join(`, `)}.`);return n}const le=t({type:`number`,validator:e=>h(e)?g(e):!0,message:`The value must be a native number`}),ue=/^\d*(\.\d+)?$/,de=t({type:`numeric`,validator(e){return f(e)?!0:_(e,ue)},message:`The value must be numeric`}),fe=t({type:`oneOf`,validator(e,t){return h(e)&&h(t,!1)?t.includes(e):!0},message:({$params:[e]})=>`The value should be one of those options: ${e.join(`, `)}.`}),pe=t({type:`regex`,validator(e,t){if(h(e)){let n=Array.isArray(t)?t:[t];return _(e,...n)}return!0},message:`The value does not match the required pattern`}),$=t({type:`required`,validator:e=>h(e),message:`This field is required`}),me=t({type:`required`,validator(e,t){return t?h(e):!0},message:`This field is required`,active({$params:[e]}){return e}}),he=t({type:`required`,validator(e,t){return t?!0:h(e)},message:`This field is required`,active({$params:[e]}){return!e}}),ge=t({type:`sameAs`,validator(e,t,n){return f(e)?!0:e===t},message({$params:[e,t=`other`]}){return`The value must be equal to the ${t} value`}}),_e=t({type:`startsWith`,validator(e,t){return h(e)&&h(t)?e.startsWith(t):!0},message({$params:[e]}){return`The value must end with ${e}`}}),ve=t({type:`string`,validator:e=>h(e)?typeof e==`string`:!0,message:`The value must be a string`});function ye(){return(()=>!0)}const be=/^(?:(?:(?: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,xe=t({type:`url`,validator(e){return f(e)?!0:_(e,be)},message:`The value is not a valid URL address`});export{T as alpha,O as alphaNum,b as and,u as applyIf,S as assignIf,k as between,A as boolean,j as checked,M as contains,N as date,I as dateAfter,L as dateBefore,R as dateBetween,B as decimal,H as email,U as endsWith,W as exactLength,te as exactValue,v as getSize,K as hexadecimal,J as integer,X as ipv4Address,p as isDate,f as isEmpty,h as isFilled,g as isNumber,Z as literal,Q as macAddress,_ as matchRegex,re as maxLength,ie as maxValue,ae as minLength,oe as minValue,ce as nativeEnum,x as not,le as number,de as numeric,fe as oneOf,ee as or,pe as regex,$ as required,me as requiredIf,he as requiredUnless,ge as sameAs,_e as startsWith,ve as string,m as toDate,y as toNumber,ye as type,xe as url,c as withAsync,o as withMessage,l as withParams,s as withTooltip};
1
+ import{InternalRuleType as e,createRule as t,unwrapRuleParameters as n}from"@regle/core";import{computed as r,toValue as i,unref as a}from"vue";function o(n,r){let i,a,o,s;typeof n==`function`&&!(`_validator`in n)?(i=e.Inline,a=n):{_type:i,validator:a,_active:o,_params:s}=n;let c=t({type:i,validator:a,active:o,message:r}),l=[...s??[]];if(c._params=l,c._message_patched=!0,typeof c==`function`){if(s!=null){let e=c(...l);return e._message_patched=!0,e}return c}else return c}function s(n,r){let i,a,o,s,c;typeof n==`function`&&!(`_validator`in n)?(i=e.Inline,a=n):{_type:i,validator:a,_active:o,_params:s,_message:c}=n;let l=t({type:i,validator:a,active:o,message:c,tooltip:r}),u=[...s??[]];if(l._params=u,l._tooltip_patched=!0,typeof l==`function`){let e=l(...u);return l._tooltip_patched=!0,e}else return l}function c(n,r){let i,a,o=[],s=``;typeof n==`function`?(a=async(e,...t)=>n(e,...t),o=[r]):({_type:i,_message:s}=n,o=o=n._params?.concat(r),a=async(...e)=>n.validator(e));let c=t({type:i??e.Async,validator:a,message:s,async:!0});return c._params=c._params?.concat(o),c(...r??[])}function l(n,r){let i,a,o=[],s=``;typeof n==`function`?(e.Inline,a=(e,...t)=>n(e,...t),o=[r]):({_type:i,validator:a,_message:s}=n,o=o=n._params?.concat(r));let c=t({type:e.Inline,validator:a,message:s});return c._params=c._params?.concat(o),c(...r)}function u(r,i){let a,o,s=[],c=``;typeof i==`function`?(a=e.Inline,o=i,s=[r]):({_type:a,validator:o,_message:c}=i,s=i._params?.concat([r]));function l(e,...t){let[i]=n([r]);return i?o(e,...t):!0}function u(){let[e]=n([r]);return e}let d=t({type:a,validator:l,active:u,message:c}),f=[...s??[]];return d._params=f,typeof d==`function`?d(...f):d}function d(e){return e?.constructor.name==`File`||e?.constructor.name==`FileList`}function f(e,t=!0){return e==null?!0:e instanceof Date?isNaN(e.getTime()):d(e)?e.size<=0:Array.isArray(e)?t?e.length===0:!1:typeof e==`object`&&e?Object.keys(e).length===0:!String(e).length}function p(e){if(f(e))return!1;try{let t=null;if(e instanceof Date)t=e;else if(typeof e==`string`){let n=new Date(e);if(n.toString()===`Invalid Date`)return!1;t=n}return!!t}catch{return!1}}function m(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]`||typeof e==`string`||t===`[object String]`?new Date(e):new Date(NaN)}function h(e,t=!0){return!f(typeof e==`string`?e.trim():e,t)}function g(e){return e==null?!1:typeof e==`number`?!isNaN(e):!1}function _(e,...t){if(f(e))return!0;let n=typeof e==`number`?e.toString():e;return t.every(e=>(e.lastIndex=0,e.test(n)))}function v(e){let t=a(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 y(e){return typeof e==`number`?e:e==null?NaN:typeof e==`string`&&e.trim()===e?+e:NaN}function b(...e){let n=e.some(e=>typeof e==`function`?e.constructor.name===`AsyncFunction`:e._async),r=e.map(e=>{if(typeof e==`function`)return null;{let t=e._params;return t?.length?t:[]}}).flat().filter(e=>!!e);function i(e,t,...n){let r=[],i=0;for(let a of e)if(typeof a==`function`)r.push(a(t)),i++;else{let e=a._params?.length??0;r.push(a.validator(t,...n.slice(i,e))),e&&(i+=e)}return r}function a(e){return e?.some(e=>typeof e!=`boolean`)?{$valid:e.every(e=>typeof e==`boolean`?!!e:e.$valid),...e.reduce((e,t)=>{if(typeof t==`boolean`)return e;let{$valid:n,...r}=t;return{...e,...r}},{})}:e.every(e=>!!e)}let o;o=e.length?n?async(t,...n)=>{let r=await Promise.all(i(e,t,...n));return a(r)}:(t,...n)=>{let r=i(e,t,...n);return a(r)}:e=>!1;let s=t({type:`and`,validator:o,message:`The value does not match all of the provided validators`}),c=[...r??[]];return s._params=c,typeof s==`function`?s(...c):s}function ee(...e){let n=e.some(e=>typeof e==`function`?e.constructor.name===`AsyncFunction`:e._async),r=e.map(e=>typeof e==`function`?null:e._params).flat().filter(e=>!!e);function i(e,t,...n){let r=[],i=0;for(let a of e)if(typeof a==`function`)r.push(a(t)),i++;else{let e=a._params?.length??0;r.push(a.validator(t,...n.slice(i,e))),e&&(i+=e)}return r}function a(e){return e.some(e=>typeof e!=`boolean`)?{$valid:e.some(e=>typeof e==`boolean`?!!e:e.$valid),...e.reduce((e,t)=>{if(typeof t==`boolean`)return e;let{$valid:n,...r}=t;return{...e,...r}},{})}:e.some(e=>!!e)}let o=t({type:`or`,validator:n?async(t,...n)=>{let r=await Promise.all(i(e,t,...n));return a(r)}:(t,...n)=>{let r=i(e,t,...n);return a(r)},message:`The value does not match any of the provided validators`}),s=[...r??[]];return o._params=s,typeof o==`function`?o(...s):o}function x(e,n){let r,i,a,o,s;typeof e==`function`?(i=e,s=e.constructor.name===`AsyncFunction`):({_type:r,validator:i,_params:o}=e,s=e._async),a=s?async(e,...t)=>h(e)?!await i(e,...t):!0:(e,...t)=>h(e)?!i(e,...t):!0;let c=t({type:`not`,validator:a,message:n??`Error`}),l=[...o??[]];return c._params=l,typeof c==`function`?c(...l):c}function S(e,t){return r(()=>i(e)?t:{})}const C=/^[a-zA-Z]*$/,w=/^[\w.]+$/,T=t({type:`alpha`,validator(e,t){return f(e)?!0:t?.allowSymbols?_(e,w):_(e,C)},message:`The value is not alphabetical`}),E=/^[a-zA-Z0-9]*$/,D=/^[a-zA-Z0-9_]*$/,O=t({type:`alphaNum`,validator(e,t){return f(e)?!0:t?.allowSymbols?_(e,D):_(e,E)},message:`The value must be alpha-numeric`}),k=t({type:`between`,validator:(e,t,n,r)=>{let{allowEqual:i=!0}=r??{};if(h(e)&&h(t)&&h(n)){let r=y(e),a=y(t),o=y(n);return g(r)&&g(a)&&g(o)?i?r>=a&&r<=o:r>a&&r<o:(console.warn(`[between] Value or parameters aren't numbers, got value: ${e}, min: ${t}, max: ${n}`),!1)}return!0},message:({$params:[e,t]})=>`The value must be between ${e} and ${t}`}),A=t({type:`boolean`,validator:e=>h(e)?typeof e==`boolean`:!0,message:`The value must be a native boolean`}),j=t({type:`checked`,validator:e=>h(e)?e===!0:!0,message:`The field must be checked`}),M=t({type:`contains`,validator(e,t){return h(e)&&h(t)?e.includes(t):!0},message({$params:[e]}){return`The value must contain ${e}`}}),N=t({type:`date`,validator:e=>h(e)?e instanceof Date:!0,message:`The value must be a native Date constructor`});function P(){return navigator.languages==null?navigator.language:navigator.languages[0]}function F(e){return e?new Intl.DateTimeFormat(P(),{dateStyle:`short`}).format(new Date(e)):`?`}const I=t({type:`dateAfter`,validator:(e,t,n)=>{let{allowEqual:r=!0}=n??{};return h(e)&&h(t)?p(e)&&p(t)?(r?m(e).getTime()>=m(t).getTime():m(e).getTime()>m(t).getTime())?!0:{$valid:!1,error:`date-not-after`}:{$valid:!1,error:`value-or-parameter-not-a-date`}:!0},message:({$params:[e],error:t})=>t===`value-or-parameter-not-a-date`?`The values must be dates`:`The date must be after ${F(e)}`}),L=t({type:`dateBefore`,validator:(e,t,n)=>{let{allowEqual:r=!0}=n??{};return h(e)&&h(t)?p(e)&&p(t)?(r?m(e).getTime()<=m(t).getTime():m(e).getTime()<m(t).getTime())?!0:{$valid:!1,error:`date-not-before`}:{$valid:!1,error:`value-or-parameter-not-a-date`}:!0},message:({$params:[e],error:t})=>t===`value-or-parameter-not-a-date`?`The values must be dates`:`The date must be before ${F(e)}`}),R=t({type:`dateBetween`,validator:(e,t,n,r)=>{let{allowEqual:i=!0}=r??{};return p(e)&&p(t)&&p(n)?i?m(e).getTime()>=m(t).getTime()&&m(e).getTime()<=m(n).getTime():m(e).getTime()>m(t).getTime()&&m(e).getTime()<m(n).getTime():!0},message:({$params:[e,t]})=>`The date must be between ${F(e)} and ${F(t)}`}),z=/^[-]?\d*(\.\d+)?$/,B=t({type:`decimal`,validator(e){return f(e)?!0:_(e,z)},message:`The value must be decimal`}),V=/^(?:[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,H=t({type:`email`,validator(e){return f(e)?!0:_(e,V)},message:`The value must be an valid email address`}),U=t({type:`endsWith`,validator(e,t){return h(e)&&h(t)?e.endsWith(t):!0},message({$params:[e]}){return`The value must end with ${e}`}}),W=t({type:`exactLength`,validator:(e,t)=>h(e,!1)&&h(t)?g(t)?v(e)===t:(console.warn(`[minLength] Parameter isn't a number, got parameter: ${t}`),!1):!0,message:({$params:[e]})=>`The value should be exactly ${e} characters long`}),te=t({type:`exactValue`,validator:(e,t)=>h(e)&&h(t)?g(t)&&!isNaN(y(e))?y(e)===t:(console.warn(`[exactValue] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),!0):!0,message:({$params:[e]})=>`The value must be equal to ${e}`}),G=/^[a-fA-F0-9]*$/,K=t({type:`hexadecimal`,validator(e){return f(e)?!0:_(e,G)},message:`The value must be hexadecimal`}),q=/(^[0-9]*$)|(^-[0-9]+$)/,J=t({type:`integer`,validator(e){return f(e)?!0:_(e,q)},message:`The value must be an integer`});function Y(e){if(e.length>3||e.length===0||e[0]===`0`&&e!==`0`||!e.match(/^\d+$/))return!1;let t=e|0;return t>=0&&t<=255}const X=t({type:`ipv4Address`,validator(e){if(f(e))return!0;if(typeof e!=`string`)return!1;let t=e.split(`.`);return t.length===4&&t.every(Y)},message:`The value is not a valid IPv4 address`});function Z(e){let t=r(()=>i(e));return o(l((e,t)=>h(e)&&h(t)?t===e:!0,[t]),({$params:[e]})=>`Value should be ${e}.`)}const Q=t({type:`macAddress`,validator(e,t=`:`){if(f(e))return!0;if(typeof e!=`string`)return!1;let n=typeof t==`string`&&t!==``?e.split(t):e.length===12||e.length===16?e.match(/.{2}/g):null;return n!==null&&(n.length===6||n.length===8)&&n.every(ne)},message:`The value is not a valid MAC Address`}),ne=e=>e.toLowerCase().match(/^[0-9a-f]{2}$/),re=t({type:`maxLength`,validator:(e,t,n)=>{let{allowEqual:r=!0}=n??{};return h(e,!1)&&h(t)?g(t)?r?v(e)<=t:v(e)<t:(console.warn(`[maxLength] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),!1):!0},message:({$value:e,$params:[t]})=>Array.isArray(e)?`This list should have maximum ${t} items`:`The value length should not exceed ${t}`}),ie=t({type:`maxValue`,validator:(e,t,n)=>{let{allowEqual:r=!0}=n??{};return h(e)&&h(t)?g(t)&&!isNaN(y(e))?r?y(e)<=t:y(e)<t:(console.warn(`[maxValue] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),!0):!0},message:({$params:[e,t]})=>{let{allowEqual:n=!0}=t??{};return n?`The value must be less than or equal to ${e}`:`The value must be less than ${e}`}}),ae=t({type:`minLength`,validator:(e,t,n)=>{let{allowEqual:r=!0}=n??{};return h(e,!1)&&h(t)?g(t)?r?v(e)>=t:v(e)>t:(console.warn(`[minLength] Parameter isn't a number, got parameter: ${t}`),!1):!0},message:({$value:e,$params:[t]})=>Array.isArray(e)?`The list should have at least ${t} items`:`The value length should be at least ${t}`}),oe=t({type:`minValue`,validator:(e,t,n)=>{let{allowEqual:r=!0}=n??{};return h(e)&&h(t)?g(t)&&!isNaN(y(e))?r?y(e)>=t:y(e)>t:(console.warn(`[minValue] Value or parameter isn't a number, got value: ${e}, parameter: ${t}`),!0):!0},message:({$params:[e,t]})=>{let{allowEqual:n=!0}=t??{};return n?`The value must be greater than or equal to ${e}`:`The value must be greater than ${e}`}});function se(e){let t=Object.keys(e).filter(t=>typeof e[e[t]]!=`number`),n={};for(let r of t)n[r]=e[r];return Object.values(n)}function ce(e){let t=r(()=>i(e));return o(l((e,t)=>h(e)&&!f(t)?se(t).includes(e):!0,[t]),({$params:[e]})=>`The value should be one of those options: ${Object.values(e).join(`, `)}.`)}const le=t({type:`number`,validator:e=>h(e)?g(e):!0,message:`The value must be a native number`}),ue=/^\d*(\.\d+)?$/,de=t({type:`numeric`,validator(e){return f(e)?!0:_(e,ue)},message:`The value must be numeric`}),fe=t({type:`oneOf`,validator(e,t){return h(e)&&h(t,!1)?t.includes(e):!0},message:({$params:[e]})=>`The value should be one of those options: ${e.join(`, `)}.`}),pe=t({type:`regex`,validator(e,t){return h(e)?_(e,...Array.isArray(t)?t:[t]):!0},message:`The value does not match the required pattern`}),$=t({type:`required`,validator:e=>h(e),message:`This field is required`}),me=t({type:`required`,validator(e,t){return t?h(e):!0},message:`This field is required`,active({$params:[e]}){return e}}),he=t({type:`required`,validator(e,t){return t?!0:h(e)},message:`This field is required`,active({$params:[e]}){return!e}}),ge=t({type:`sameAs`,validator(e,t,n){return f(e)?!0:e===t},message({$params:[e,t=`other`]}){return`The value must be equal to the ${t} value`}}),_e=t({type:`startsWith`,validator(e,t){return h(e)&&h(t)?e.startsWith(t):!0},message({$params:[e]}){return`The value must end with ${e}`}}),ve=t({type:`string`,validator:e=>h(e)?typeof e==`string`:!0,message:`The value must be a string`});function ye(){return(()=>!0)}const be=/^(?:(?:(?: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,xe=t({type:`url`,validator(e){return f(e)?!0:_(e,be)},message:`The value is not a valid URL address`});export{T as alpha,O as alphaNum,b as and,u as applyIf,S as assignIf,k as between,A as boolean,j as checked,M as contains,N as date,I as dateAfter,L as dateBefore,R as dateBetween,B as decimal,H as email,U as endsWith,W as exactLength,te as exactValue,v as getSize,K as hexadecimal,J as integer,X as ipv4Address,p as isDate,f as isEmpty,h as isFilled,g as isNumber,Z as literal,Q as macAddress,_ as matchRegex,re as maxLength,ie as maxValue,ae as minLength,oe as minValue,ce as nativeEnum,x as not,le as number,de as numeric,fe as oneOf,ee as or,pe as regex,$ as required,me as requiredIf,he as requiredUnless,ge as sameAs,_e as startsWith,ve as string,m as toDate,y as toNumber,ye as type,xe as url,c as withAsync,o as withMessage,l as withParams,s as withTooltip};
package/package.json CHANGED
@@ -1,27 +1,21 @@
1
1
  {
2
2
  "name": "@regle/rules",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
4
4
  "description": "Collection of rules and helpers for Regle",
5
5
  "dependencies": {
6
- "@regle/core": "1.8.5"
6
+ "@regle/core": "1.8.6"
7
7
  },
8
8
  "devDependencies": {
9
- "@types/node": "22.18.0",
10
- "@typescript-eslint/eslint-plugin": "8.42.0",
11
- "@typescript-eslint/parser": "8.42.0",
9
+ "@types/node": "22.13.14",
12
10
  "@vue/reactivity": "3.5.21",
13
11
  "@vue/test-utils": "2.4.6",
14
- "eslint": "9.34.0",
15
- "eslint-config-prettier": "10.1.8",
16
- "eslint-plugin-vue": "10.4.0",
17
12
  "prettier": "3.6.2",
18
- "tsdown": "0.14.2",
19
- "type-fest": "4.41.0",
13
+ "tsdown": "0.15.2",
14
+ "type-fest": "5.0.0",
20
15
  "typescript": "5.9.2",
21
16
  "vitest": "3.2.4",
22
17
  "vue": "3.5.21",
23
- "vue-eslint-parser": "10.2.0",
24
- "vue-tsc": "3.0.6"
18
+ "vue-tsc": "3.0.7"
25
19
  },
26
20
  "type": "module",
27
21
  "exports": {
@@ -65,8 +59,6 @@
65
59
  "build": "tsdown",
66
60
  "build:sourcemaps": "tsdown --config=tsdown.sourcemap.ts",
67
61
  "dev": "tsdown --config=tsdown.dev.ts --watch",
68
- "test": "vitest run",
69
- "lint": "eslint src/**/*.ts",
70
- "lint:fix": "eslint src/**/*.ts --fix"
62
+ "test": "vitest run"
71
63
  }
72
64
  }