@zipbul/baker 0.1.2 → 1.1.0
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.
- package/README.ko.md +368 -280
- package/README.md +407 -280
- package/dist/index-70ggmxsa.js +6 -0
- package/dist/index-gcptd79v.js +6 -0
- package/dist/index-xdn55cz3.js +4 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +211 -155
- package/dist/src/collect.d.ts +3 -3
- package/dist/src/configure.d.ts +33 -0
- package/dist/src/create-rule.d.ts +10 -19
- package/dist/src/decorators/field.d.ts +86 -0
- package/dist/src/decorators/index.d.ts +2 -14
- package/dist/src/decorators/index.js +2 -2
- package/dist/src/errors.d.ts +17 -17
- package/dist/src/functions/deserialize.d.ts +6 -4
- package/dist/src/functions/serialize.d.ts +5 -4
- package/dist/src/functions/to-json-schema.d.ts +11 -5
- package/dist/src/interfaces.d.ts +9 -30
- package/dist/src/registry.d.ts +4 -12
- package/dist/src/rules/index.d.ts +2 -0
- package/dist/src/rules/index.js +11 -2
- package/dist/src/rules/object.d.ts +1 -1
- package/dist/src/seal/circular-analyzer.d.ts +5 -9
- package/dist/src/seal/expose-validator.d.ts +6 -6
- package/dist/src/seal/index.d.ts +1 -1
- package/dist/src/seal/seal.d.ts +30 -15
- package/dist/src/seal/serialize-builder.d.ts +2 -2
- package/dist/src/symbols.d.ts +5 -5
- package/dist/src/symbols.js +2 -2
- package/dist/src/types.d.ts +38 -32
- package/dist/src/utils.d.ts +2 -0
- package/package.json +1 -1
- package/dist/index-3gcf6hkv.js +0 -5
- package/dist/index-mx6gnk4h.js +0 -6
- package/dist/index-wy5sh2nx.js +0 -15
- package/dist/src/decorators/array.d.ts +0 -13
- package/dist/src/decorators/common.d.ts +0 -39
- package/dist/src/decorators/date.d.ts +0 -5
- package/dist/src/decorators/locales.d.ts +0 -9
- package/dist/src/decorators/nested.d.ts +0 -17
- package/dist/src/decorators/number.d.ts +0 -15
- package/dist/src/decorators/object.d.ts +0 -9
- package/dist/src/decorators/schema.d.ts +0 -13
- package/dist/src/decorators/string.d.ts +0 -72
- package/dist/src/decorators/transform.d.ts +0 -68
- package/dist/src/decorators/typechecker.d.ts +0 -18
package/dist/src/seal/seal.d.ts
CHANGED
|
@@ -1,27 +1,42 @@
|
|
|
1
|
-
import type { RawClassMeta } from '../types';
|
|
2
|
-
|
|
1
|
+
import type { RawClassMeta, SealedExecutors } from '../types';
|
|
2
|
+
/** @internal Placeholder executor for circular dependency detection during seal */
|
|
3
|
+
declare function _circularPlaceholder(className: string): SealedExecutors<unknown>;
|
|
4
|
+
/** @internal — used by configure() to warn about post-seal calls */
|
|
5
|
+
export declare function _isSealed(): boolean;
|
|
6
|
+
/** List of sealed classes — used by unseal to remove SEALED */
|
|
7
|
+
export declare const _sealedClasses: Set<Function>;
|
|
3
8
|
/**
|
|
4
|
-
*
|
|
5
|
-
* -
|
|
6
|
-
* - 순환 참조 DTO는 placeholder 패턴으로 안전하게 처리
|
|
9
|
+
* @internal — called from deserialize/serialize.
|
|
10
|
+
* No-op if already sealed.
|
|
7
11
|
*/
|
|
8
|
-
export declare function
|
|
12
|
+
export declare function _autoSeal(): void;
|
|
9
13
|
/**
|
|
10
|
-
* @internal
|
|
14
|
+
* @internal — on-demand seal for classes registered after auto-seal via dynamic import.
|
|
15
|
+
* Only operates when Class[RAW] exists and Class[SEALED] does not.
|
|
16
|
+
*/
|
|
17
|
+
export declare function _sealOnDemand(Class: Function): void;
|
|
18
|
+
/**
|
|
19
|
+
* @internal testing only — called by unseal() in testing.ts
|
|
11
20
|
*/
|
|
12
21
|
export declare function _resetForTesting(): void;
|
|
13
22
|
/**
|
|
14
|
-
*
|
|
23
|
+
* @internal — used by serialize/deserialize. Ensures and returns a sealed executor.
|
|
24
|
+
*/
|
|
25
|
+
export declare function _ensureSealed(Class: Function): SealedExecutors<unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* Merges RAW metadata child-first along the prototype chain of Class.
|
|
15
28
|
*
|
|
16
|
-
*
|
|
17
|
-
* - validation: union merge (
|
|
18
|
-
* - transform:
|
|
19
|
-
* - expose:
|
|
20
|
-
* - exclude:
|
|
21
|
-
* - type:
|
|
22
|
-
* - flags:
|
|
29
|
+
* Merge rules:
|
|
30
|
+
* - validation: union merge (both parent and child apply, duplicate rules removed)
|
|
31
|
+
* - transform: child takes priority, inherits from parent if absent in child
|
|
32
|
+
* - expose: child takes priority, inherits from parent if absent in child
|
|
33
|
+
* - exclude: child takes priority, inherits from parent if absent in child
|
|
34
|
+
* - type: child takes priority, inherits from parent if absent in child
|
|
35
|
+
* - flags: child takes priority, only missing flags are supplemented from parent
|
|
23
36
|
*/
|
|
24
37
|
export declare function mergeInheritance(Class: Function): RawClassMeta;
|
|
25
38
|
export declare const __testing__: {
|
|
26
39
|
mergeInheritance: typeof mergeInheritance;
|
|
40
|
+
_circularPlaceholder: typeof _circularPlaceholder;
|
|
27
41
|
};
|
|
42
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RawClassMeta } from '../types';
|
|
2
2
|
import type { SealOptions, RuntimeOptions } from '../interfaces';
|
|
3
3
|
/**
|
|
4
|
-
* serialize executor
|
|
5
|
-
*
|
|
4
|
+
* Generate serialize executor code.
|
|
5
|
+
* Assumes no validation — always returns Record<string, unknown> (§4.3).
|
|
6
6
|
*/
|
|
7
7
|
export declare function buildSerializeCode<T>(Class: Function, merged: RawClassMeta, options: SealOptions | undefined, isAsync: boolean): (instance: T, opts?: RuntimeOptions) => Record<string, unknown> | Promise<Record<string, unknown>>;
|
package/dist/src/symbols.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 2
|
|
3
|
-
* Symbol.for
|
|
2
|
+
* 2 Symbols — zero external storage, zero global pollution
|
|
3
|
+
* Uses Symbol.for: allows AOT code and runtime code to share the same Symbol via the global registry
|
|
4
4
|
*/
|
|
5
|
-
/** Tier 1
|
|
5
|
+
/** Tier 1 collection metadata (stored on Class by decorators) */
|
|
6
6
|
export declare const RAW: unique symbol;
|
|
7
|
-
/** Tier 2
|
|
7
|
+
/** Tier 2 seal result (dual executor stored on Class by seal()) */
|
|
8
8
|
export declare const SEALED: unique symbol;
|
|
9
|
-
/**
|
|
9
|
+
/** Class-level @Schema() metadata */
|
|
10
10
|
export declare const RAW_CLASS_SCHEMA: unique symbol;
|
package/dist/src/symbols.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{e as a,f as b,g as c}from"../index-70ggmxsa.js";export{b as SEALED,c as RAW_CLASS_SCHEMA,a as RAW};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=51B5F46B85FFE3B364756E2164756E21
|
|
5
5
|
//# sourceMappingURL=symbols.js.map
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export interface EmitContext {
|
|
2
|
-
/** RegExp
|
|
2
|
+
/** Register a RegExp in the reference array, return its index */
|
|
3
3
|
addRegex(re: RegExp): number;
|
|
4
|
-
/**
|
|
4
|
+
/** Register in the reference array, return its index — functions, arrays, Sets, primitives, etc. */
|
|
5
5
|
addRef(value: unknown): number;
|
|
6
|
-
/** SealedExecutors
|
|
6
|
+
/** Register a SealedExecutors object in the reference array — for nested @Type DTOs */
|
|
7
7
|
addExecutor(executor: SealedExecutors<unknown>): number;
|
|
8
|
-
/**
|
|
8
|
+
/** Generate a failure code string from an error code — path is bound by the builder */
|
|
9
9
|
fail(code: string): string;
|
|
10
|
-
/**
|
|
10
|
+
/** Whether error collection mode is enabled (= !stopAtFirstError) */
|
|
11
11
|
collectErrors: boolean;
|
|
12
12
|
}
|
|
13
13
|
export interface EmittableRule {
|
|
@@ -15,17 +15,17 @@ export interface EmittableRule {
|
|
|
15
15
|
emit(varName: string, ctx: EmitContext): string;
|
|
16
16
|
readonly ruleName: string;
|
|
17
17
|
/**
|
|
18
|
-
* builder
|
|
19
|
-
*
|
|
20
|
-
* @IsString
|
|
18
|
+
* Meta for the builder to determine whether to insert a typeof guard.
|
|
19
|
+
* Only set for rules that assume a specific type (e.g., isEmail → 'string').
|
|
20
|
+
* @IsString itself is undefined (it includes its own typeof check).
|
|
21
21
|
*/
|
|
22
22
|
readonly requiresType?: 'string' | 'number' | 'boolean' | 'date';
|
|
23
|
-
/**
|
|
23
|
+
/** Expose rule parameters for external reading — used for toJsonSchema mapping */
|
|
24
24
|
readonly constraints?: Record<string, unknown>;
|
|
25
|
-
/**
|
|
25
|
+
/** true when using an async validate function — deserialize-builder generates await code */
|
|
26
26
|
readonly isAsync?: boolean;
|
|
27
27
|
}
|
|
28
|
-
/**
|
|
28
|
+
/** Arguments for user-defined message callback */
|
|
29
29
|
export interface MessageArgs {
|
|
30
30
|
property: string;
|
|
31
31
|
value: unknown;
|
|
@@ -35,17 +35,17 @@ export interface RuleDef {
|
|
|
35
35
|
rule: EmittableRule;
|
|
36
36
|
each?: boolean;
|
|
37
37
|
groups?: string[];
|
|
38
|
-
/**
|
|
38
|
+
/** Value to include in BakerError.message on validation failure */
|
|
39
39
|
message?: string | ((args: MessageArgs) => string);
|
|
40
|
-
/**
|
|
40
|
+
/** Arbitrary value to include in BakerError.context on validation failure */
|
|
41
41
|
context?: unknown;
|
|
42
42
|
}
|
|
43
|
-
/** @Transform
|
|
43
|
+
/** @Transform callback signature */
|
|
44
44
|
export type TransformFunction = (params: TransformParams) => unknown;
|
|
45
45
|
export interface TransformParams {
|
|
46
46
|
value: unknown;
|
|
47
47
|
key: string;
|
|
48
|
-
/** deserialize: input
|
|
48
|
+
/** deserialize: original input object, serialize: class instance */
|
|
49
49
|
obj: Record<string, unknown>;
|
|
50
50
|
type: 'deserialize' | 'serialize';
|
|
51
51
|
}
|
|
@@ -68,7 +68,7 @@ export interface ExcludeDef {
|
|
|
68
68
|
serializeOnly?: boolean;
|
|
69
69
|
}
|
|
70
70
|
export interface TypeDef {
|
|
71
|
-
fn: () => new (...args: any[]) => any;
|
|
71
|
+
fn: () => (new (...args: any[]) => any) | (new (...args: any[]) => any)[];
|
|
72
72
|
discriminator?: {
|
|
73
73
|
property: string;
|
|
74
74
|
subTypes: {
|
|
@@ -77,19 +77,29 @@ export interface TypeDef {
|
|
|
77
77
|
}[];
|
|
78
78
|
};
|
|
79
79
|
keepDiscriminatorProperty?: boolean;
|
|
80
|
+
/** seal() normalization result — true if fn() returns an array */
|
|
81
|
+
isArray?: boolean;
|
|
82
|
+
/** seal() normalization result — cached class after resolving fn() (DTOs only, excluding primitives) */
|
|
83
|
+
resolvedClass?: new (...args: any[]) => any;
|
|
84
|
+
/** seal() normalization result — Map or Set collection type */
|
|
85
|
+
collection?: 'Map' | 'Set';
|
|
86
|
+
/** Nested DTO class thunk for Map value / Set element */
|
|
87
|
+
collectionValue?: () => new (...args: any[]) => any;
|
|
88
|
+
/** seal() normalization result — cached class after resolving collectionValue */
|
|
89
|
+
resolvedCollectionValue?: new (...args: any[]) => any;
|
|
80
90
|
}
|
|
81
91
|
export interface PropertyFlags {
|
|
82
|
-
/** @IsOptional() —
|
|
92
|
+
/** @IsOptional() — skip all validation when undefined/null */
|
|
83
93
|
isOptional?: boolean;
|
|
84
|
-
/** @IsDefined() — undefined
|
|
94
|
+
/** @IsDefined() — disallow undefined (overrides @IsOptional). Current code rejects only undefined; null is delegated to subsequent validation */
|
|
85
95
|
isDefined?: boolean;
|
|
86
|
-
/** @IsNullable() — null
|
|
96
|
+
/** @IsNullable() — allow and assign null, reject undefined */
|
|
87
97
|
isNullable?: boolean;
|
|
88
|
-
/** @ValidateIf(cond) —
|
|
98
|
+
/** @ValidateIf(cond) — skip all field validation when false */
|
|
89
99
|
validateIf?: (obj: any) => boolean;
|
|
90
|
-
/** @ValidateNested() —
|
|
100
|
+
/** @ValidateNested() — trigger recursive validation for nested DTOs. Used with @Type */
|
|
91
101
|
validateNested?: boolean;
|
|
92
|
-
/** @ValidateNested({ each: true }) —
|
|
102
|
+
/** @ValidateNested({ each: true }) — validate nested DTOs per array element */
|
|
93
103
|
validateNestedEach?: boolean;
|
|
94
104
|
}
|
|
95
105
|
export interface RawPropertyMeta {
|
|
@@ -108,19 +118,16 @@ import type { RuntimeOptions } from './interfaces';
|
|
|
108
118
|
import type { BakerError } from './errors';
|
|
109
119
|
import type { Result, ResultAsync } from '@zipbul/result';
|
|
110
120
|
export interface SealedExecutors<T> {
|
|
111
|
-
/**
|
|
121
|
+
/** Internal executor — Result pattern. deserialize() wraps and converts to throw */
|
|
112
122
|
_deserialize(input: unknown, options?: RuntimeOptions): Result<T, BakerError[]> | ResultAsync<T, BakerError[]>;
|
|
113
|
-
/**
|
|
123
|
+
/** Internal executor — always succeeds. serialize assumes no validation */
|
|
114
124
|
_serialize(instance: T, options?: RuntimeOptions): Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
115
|
-
/** deserialize
|
|
125
|
+
/** true if the deserialize direction has async rules/transforms/nested */
|
|
116
126
|
_isAsync: boolean;
|
|
117
|
-
/** serialize
|
|
127
|
+
/** true if the serialize direction has async transforms/nested */
|
|
118
128
|
_isSerializeAsync: boolean;
|
|
119
|
-
/**
|
|
120
|
-
|
|
121
|
-
deserialize: string;
|
|
122
|
-
serialize: string;
|
|
123
|
-
};
|
|
129
|
+
/** Merged metadata cache at seal time — used by toJsonSchema (valid even after RAW is deleted) */
|
|
130
|
+
_merged?: RawClassMeta;
|
|
124
131
|
}
|
|
125
132
|
export interface JsonSchema202012 {
|
|
126
133
|
$schema?: string;
|
|
@@ -177,4 +184,3 @@ export interface JsonSchema202012 {
|
|
|
177
184
|
contentSchema?: JsonSchema202012;
|
|
178
185
|
[key: string]: unknown;
|
|
179
186
|
}
|
|
180
|
-
export type { ValidationOptions } from './interfaces';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zipbul/baker",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Decorator-based validate + transform with inline code generation. class-validator DX, AOT-level performance, zero reflect-metadata.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Junhyung Park (https://github.com/parkrevil)",
|
package/dist/index-3gcf6hkv.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{$b as JI,$c as J6,Ab as O,Ac as OI,Bb as v,Bc as vI,Cb as u,Cc as uI,Db as m,Dc as mI,Eb as V,Ec as VI,Fb as d,Fc as dI,Gb as k,Gc as kI,Hb as g,Hc as gI,Ib as y,Ic as yI,Jb as c,Jc as cI,Kb as r,Kc as rI,Lb as l,Lc as lI,Mb as a,Mc as aI,Nb as e,Nc as eI,Ob as p,Oc as pI,Pb as s,Pc as sI,Qb as n,Qc as nI,Rb as i,Rc as iI,Sb as t,Sc as tI,Tb as o,Tc as oI,Ub as II,Uc as I6,Vb as BI,Vc as B6,Wb as EI,Wc as E6,Xb as NI,Xc as N6,Yb as QI,Yc as Q6,Zb as UI,Zc as U6,_b as xI,_c as x6,ac as KI,ad as K6,bc as XI,bd as X6,cc as YI,cd as Y6,dc as ZI,ec as $I,fc as GI,gc as LI,hc as PI,ic as qI,jb as w,jc as wI,kb as z,kc as zI,lb as A,lc as AI,mb as H,mc as HI,nb as S,nc as SI,ob as j,oc as jI,pb as C,pc as CI,qb as T,qc as TI,rb as W,rc as WI,sb as _,sc as _I,tb as M,tc as MI,ub as F,uc as FI,vb as R,vc as RI,wb as D,wc as DI,xb as f,xc as fI,yb as b,yc as bI,zb as h,zc as hI}from"./index-wy5sh2nx.js";import{dd as K,fd as Y}from"./index-mx6gnk4h.js";var J=new Set;function w3(I){return J.delete(I)}function U(I,B){if(J.add(I),!Object.prototype.hasOwnProperty.call(I,K))I[K]=Object.create(null);let E=I[K];return E[B]??={validation:[],transform:[],expose:[],exclude:null,type:null,flags:{},schema:null}}function Q(I,B,E){U(I.constructor,B).validation.push(E)}function $(I,B,E){U(I.constructor,B).transform.push(E)}function G(I,B,E){U(I.constructor,B).expose.push(E)}function L(I,B,E){let N=U(I.constructor,B);N.exclude=E}function X(I,B,E){let N=U(I.constructor,B);N.type=E}function P(I,B,E){let N=U(I.constructor,B);if(typeof E==="function"||typeof N.schema==="function")N.schema=E;else N.schema={...N.schema??{},...E}}function q(I,B){J.add(I);let E=I[Y];I[Y]={...E??{},...B}}function Z6(I){return(B,E)=>{let N=U(B.constructor,E);N.flags.isDefined=!0}}function $6(I){return(B,E)=>{let N=U(B.constructor,E);N.flags.isOptional=!0}}function G6(I){return(B,E)=>{let N=U(B.constructor,E);N.flags.validateIf=I}}function L6(I){return(B,E)=>{let N=U(B.constructor,E);if(N.flags.validateNested=!0,I?.each)N.flags.validateNestedEach=!0}}function P6(I){return(B,E)=>{let N=U(B.constructor,E);N.flags.isNullable=!0}}function q6(I,B){return(E,N)=>{Q(E,N,{rule:w(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function w6(I,B){return(E,N)=>{Q(E,N,{rule:z(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function z6(I){return(B,E)=>{Q(B,E,{rule:A,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function A6(I){return(B,E)=>{Q(B,E,{rule:H,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function H6(I,B){return(E,N)=>{Q(E,N,{rule:S(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function S6(I,B){return(E,N)=>{Q(E,N,{rule:j(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}class j6 extends Error{errors;className;constructor(I,B){let E=B?`Validation failed for ${B}`:"Validation failed";super(`${E}: ${I.length} error(s)`);this.name="BakerValidationError",this.errors=I,this.className=B}}class Z extends Error{constructor(I){super(I);this.name="SealError"}}function C6(I,B){if(B?.discriminator&&B?.each)throw new Z("@Nested: discriminator + each \uB3D9\uC2DC \uC0AC\uC6A9 \uBD88\uAC00");return(E,N)=>{X(E,N,{fn:I,discriminator:B?.discriminator,keepDiscriminatorProperty:B?.keepDiscriminatorProperty});let x=U(E.constructor,N);if(x.flags.validateNested=!0,B?.each)x.flags.validateNestedEach=!0}}function T6(I){return(B,E)=>{Q(B,E,{rule:C,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function W6(I,B){return(E,N)=>{Q(E,N,{rule:T(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function _6(I){return(B,E)=>{Q(B,E,{rule:W,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function M6(I){return(B,E)=>{Q(B,E,{rule:_,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function F6(I,B){return(E,N)=>{Q(E,N,{rule:M(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function R6(I){return(B,E)=>{Q(B,E,{rule:F,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function D6(I){return(B,E)=>{Q(B,E,{rule:R,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function f6(I){return(B,E)=>{Q(B,E,{rule:D,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function b6(I,B){return(E,N)=>{Q(E,N,{rule:f(I,B?.exclusive?{exclusive:!0}:void 0),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function h6(I,B){return(E,N)=>{Q(E,N,{rule:b(I,B?.exclusive?{exclusive:!0}:void 0),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function O6(I){return(B,E)=>{Q(B,E,{rule:h,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function v6(I){return(B,E)=>{Q(B,E,{rule:O,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function u6(I,B){return(E,N)=>{Q(E,N,{rule:v(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function m6(I,B){return(E,N)=>{Q(E,N,{rule:u(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function V6(I,B){return(E,N)=>{Q(E,N,{rule:m(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function d6(I,B){return(E,N)=>{Q(E,N,{rule:V(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function k6(I,B){return(E,N)=>{Q(E,N,{rule:d(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function g6(I,B,E){return(N,x)=>{Q(N,x,{rule:k(I,B),each:E?.each,groups:E?.groups,message:E?.message,context:E?.context})}}function y6(I,B){return(E,N)=>{Q(E,N,{rule:g(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function c6(I,B){return(E,N)=>{Q(E,N,{rule:y(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function r6(I,B,E){return(N,x)=>{Q(N,x,{rule:c(I,B),each:E?.each,groups:E?.groups,message:E?.message,context:E?.context})}}function l6(I){return(B,E)=>{Q(B,E,{rule:r,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function a6(I){return(B,E)=>{Q(B,E,{rule:l,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function e6(I){return(B,E)=>{Q(B,E,{rule:a,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function p6(I){return(B,E)=>{Q(B,E,{rule:e,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function s6(I){return(B,E)=>{Q(B,E,{rule:p,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function n6(I){return(B,E)=>{Q(B,E,{rule:s,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function i6(I,B){return(E,N)=>{Q(E,N,{rule:n(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function t6(I,B){return(E,N)=>{Q(E,N,{rule:i(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function o6(I){return(B,E)=>{Q(B,E,{rule:t,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function IB(I){return(B,E)=>{Q(B,E,{rule:o,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function BB(I){return(B,E)=>{Q(B,E,{rule:II,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function EB(I){return(B,E)=>{Q(B,E,{rule:BI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function NB(I){return(B,E)=>{Q(B,E,{rule:EI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function QB(I){return(B,E)=>{Q(B,E,{rule:NI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function UB(I){return(B,E)=>{Q(B,E,{rule:QI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function xB(I,B){return(E,N)=>{Q(E,N,{rule:UI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function JB(I,B){return(E,N)=>{Q(E,N,{rule:xI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function KB(I,B){return(E,N)=>{Q(E,N,{rule:JI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function XB(I,B){return(E,N)=>{Q(E,N,{rule:KI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function YB(I){return(B,E)=>{Q(B,E,{rule:XI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function ZB(I,B){return(E,N)=>{Q(E,N,{rule:YI(I??!1),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function $B(I){return(B,E)=>{Q(B,E,{rule:ZI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function GB(I,B){return(E,N)=>{Q(E,N,{rule:$I(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function LB(I,B){return(E,N)=>{Q(E,N,{rule:GI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function PB(I){return(B,E)=>{Q(B,E,{rule:LI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function qB(I,B){return(E,N)=>{Q(E,N,{rule:PI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function wB(I){return(B,E)=>{Q(B,E,{rule:qI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function zB(I,B){return(E,N)=>{Q(E,N,{rule:wI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function AB(I){return(B,E)=>{Q(B,E,{rule:zI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function HB(I,B){return(E,N)=>{Q(E,N,{rule:AI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function SB(I){return(B,E)=>{Q(B,E,{rule:HI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function jB(I){return(B,E)=>{Q(B,E,{rule:SI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function CB(I,B){return(E,N)=>{Q(E,N,{rule:jI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function TB(I){return(B,E)=>{Q(B,E,{rule:CI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function WB(I){return(B,E)=>{Q(B,E,{rule:TI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function _B(I){return(B,E)=>{Q(B,E,{rule:WI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function MB(I){return(B,E)=>{Q(B,E,{rule:_I,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function FB(I){return(B,E)=>{Q(B,E,{rule:MI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function RB(I){return(B,E)=>{Q(B,E,{rule:FI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function DB(I){return(B,E)=>{Q(B,E,{rule:RI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function fB(I){return(B,E)=>{Q(B,E,{rule:DI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function bB(I){return(B,E)=>{Q(B,E,{rule:fI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function hB(I,B){return(E,N)=>{Q(E,N,{rule:bI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function OB(I){return(B,E)=>{Q(B,E,{rule:hI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function vB(I,B){return(E,N)=>{Q(E,N,{rule:OI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function uB(I,B){return(E,N)=>{Q(E,N,{rule:vI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function mB(I){return(B,E)=>{Q(B,E,{rule:uI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function VB(I,B){return(E,N)=>{Q(E,N,{rule:mI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function dB(I){return(B,E)=>{Q(B,E,{rule:VI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function kB(I){return(B,E)=>{Q(B,E,{rule:dI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function gB(I,B){return(E,N)=>{Q(E,N,{rule:kI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function yB(I,B,E){return(N,x)=>{Q(N,x,{rule:gI(I,B),each:E?.each,groups:E?.groups,message:E?.message,context:E?.context})}}function cB(I,B){return(E,N)=>{Q(E,N,{rule:yI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function rB(I){return(B,E)=>{Q(B,E,{rule:cI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function lB(I){return(B,E)=>{Q(B,E,{rule:rI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function aB(I){return(B,E)=>{Q(B,E,{rule:lI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function eB(I){return(B,E)=>{Q(B,E,{rule:aI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function pB(I){return(B,E)=>{Q(B,E,{rule:eI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function sB(I){return(B,E)=>{Q(B,E,{rule:pI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function nB(I){return(B,E)=>{Q(B,E,{rule:sI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function iB(I){return(B,E)=>{Q(B,E,{rule:nI,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function tB(I,B){return(E,N)=>{Q(E,N,{rule:iI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function oB(I,B){return(E,N)=>{Q(E,N,{rule:tI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function I3(I,B){return(E,N)=>{Q(E,N,{rule:oI(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function B3(I,B){return(E,N)=>{Q(E,N,{rule:I6(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function E3(I,B){return(E,N)=>{Q(E,N,{rule:B6(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function N3(I,B){return(E,N)=>{Q(E,N,{rule:E6(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function Q3(I,B){return(E,N)=>{Q(E,N,{rule:N6(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function U3(I){return(B,E)=>{Q(B,E,{rule:Q6,each:I?.each,groups:I?.groups,message:I?.message,context:I?.context})}}function x3(I,B){return(E,N)=>{Q(E,N,{rule:U6(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function J3(I,B){return(E,N)=>{Q(E,N,{rule:x6(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function K3(I){return(B,E)=>{G(B,E,I??{})}}function X3(I){return(B,E)=>{L(B,E,I??{})}}function Y3(I,B){return(E,N)=>{$(E,N,{fn:I,options:B?{groups:B.groups,deserializeOnly:B.deserializeOnly,serializeOnly:B.serializeOnly}:void 0})}}function Z3(I,B){return(E,N)=>{X(E,N,{fn:I,discriminator:B?.discriminator,keepDiscriminatorProperty:B?.keepDiscriminatorProperty})}}function $3(I){return(B,E)=>{if(E!==void 0)P(B,E,I);else{if(typeof I==="function")throw Error("@Schema(fn) function form is not supported at class level");q(B,I)}}}function G3(I,B){return(E,N)=>{Q(E,N,{rule:J6(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function L3(I,B){return(E,N)=>{Q(E,N,{rule:K6(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function P3(I,B){return(E,N)=>{Q(E,N,{rule:X6(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}function q3(I,B){return(E,N)=>{Q(E,N,{rule:Y6(I),each:B?.each,groups:B?.groups,message:B?.message,context:B?.context})}}export{J as a,w3 as b,j6 as c,Z as d,Z6 as e,$6 as f,G6 as g,L6 as h,P6 as i,q6 as j,w6 as k,z6 as l,A6 as m,H6 as n,S6 as o,C6 as p,T6 as q,W6 as r,_6 as s,M6 as t,F6 as u,R6 as v,D6 as w,f6 as x,b6 as y,h6 as z,O6 as A,v6 as B,u6 as C,m6 as D,V6 as E,d6 as F,k6 as G,g6 as H,y6 as I,c6 as J,r6 as K,l6 as L,a6 as M,e6 as N,p6 as O,s6 as P,n6 as Q,i6 as R,t6 as S,o6 as T,IB as U,BB as V,EB as W,NB as X,QB as Y,UB as Z,xB as _,JB as $,KB as aa,XB as ba,YB as ca,ZB as da,$B as ea,GB as fa,LB as ga,PB as ha,qB as ia,wB as ja,zB as ka,AB as la,HB as ma,SB as na,jB as oa,CB as pa,TB as qa,WB as ra,_B as sa,MB as ta,FB as ua,RB as va,DB as wa,fB as xa,bB as ya,hB as za,OB as Aa,vB as Ba,uB as Ca,mB as Da,VB as Ea,dB as Fa,kB as Ga,gB as Ha,yB as Ia,cB as Ja,rB as Ka,lB as La,aB as Ma,eB as Na,pB as Oa,sB as Pa,nB as Qa,iB as Ra,tB as Sa,oB as Ta,I3 as Ua,B3 as Va,E3 as Wa,N3 as Xa,Q3 as Ya,U3 as Za,x3 as _a,J3 as $a,K3 as ab,X3 as bb,Y3 as cb,Z3 as db,$3 as eb,G3 as fb,L3 as gb,P3 as hb,q3 as ib};
|
|
3
|
-
|
|
4
|
-
//# debugId=EA08FE35462633F164756E2164756E21
|
|
5
|
-
//# sourceMappingURL=index-3gcf6hkv.js.map
|
package/dist/index-mx6gnk4h.js
DELETED
package/dist/index-wy5sh2nx.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
function TQ(z){let Q=(Z)=>Z===z;return Q.emit=(Z,$)=>{let K=$.addRef(z);return`if (${Z} !== _refs[${K}]) ${$.fail("equals")};`},Q.ruleName="equals",Q.constraints={value:z},Q}function gQ(z){let Q=(Z)=>Z!==z;return Q.emit=(Z,$)=>{let K=$.addRef(z);return`if (${Z} === _refs[${K}]) ${$.fail("notEquals")};`},Q.ruleName="notEquals",Q.constraints={value:z},Q}var P=(z)=>z===void 0||z===null||z==="";P.emit=(z,Q)=>`if (${z} !== undefined && ${z} !== null && ${z} !== '') ${Q.fail("isEmpty")};`;P.ruleName="isEmpty";P.constraints={};var LQ=P,C=(z)=>z!==void 0&&z!==null&&z!=="";C.emit=(z,Q)=>`if (${z} === undefined || ${z} === null || ${z} === '') ${Q.fail("isNotEmpty")};`;C.ruleName="isNotEmpty";C.constraints={};var AQ=C;function IQ(z){let Q=new Set(z),Z=($)=>Q.has($);return Z.emit=($,K)=>{return`if (!_refs[${K.addRef(Q)}].has(${$})) ${K.fail("isIn")};`},Z.ruleName="isIn",Z.constraints={values:z},Z}function dQ(z){let Q=new Set(z),Z=($)=>!Q.has($);return Z.emit=($,K)=>{return`if (_refs[${K.addRef(Q)}].has(${$})) ${K.fail("isNotIn")};`},Z.ruleName="isNotIn",Z.constraints={values:z},Z}var y=(z)=>typeof z==="string";y.emit=(z,Q)=>`if (typeof ${z} !== 'string') ${Q.fail("isString")};`;y.ruleName="isString";y.constraints={};var pQ=y;function RQ(z){let Q=z?.allowNaN??!1,Z=z?.allowInfinity??!1,$=z?.maxDecimalPlaces,K=(j)=>{if(typeof j!=="number")return!1;if(isNaN(j))return Q;if(!isFinite(j))return Z;if($!==void 0){let J=j.toString(),w=J.indexOf(".");if(w!==-1&&J.length-w-1>$)return!1}return!0};return K.emit=(j,J)=>{let w=`if (typeof ${j} !== 'number') ${J.fail("isNumber")};`;if(!Q)w+=`
|
|
3
|
-
else if (isNaN(${j})) ${J.fail("isNumber")};`;if(!Z)w+=`
|
|
4
|
-
else if (${j} === Infinity || ${j} === -Infinity) ${J.fail("isNumber")};`;if($!==void 0)w+=`
|
|
5
|
-
else { var _s=${j}.toString(); var _d=_s.indexOf('.'); if(_d!==-1&&_s.length-_d-1>${$}) ${J.fail("isNumber")}; }`;return w},K.ruleName="isNumber",K.constraints={allowNaN:z?.allowNaN,allowInfinity:z?.allowInfinity,maxDecimalPlaces:z?.maxDecimalPlaces},K}var O=(z)=>typeof z==="boolean";O.emit=(z,Q)=>`if (typeof ${z} !== 'boolean') ${Q.fail("isBoolean")};`;O.ruleName="isBoolean";O.constraints={};var EQ=O,T=(z)=>z instanceof Date&&!isNaN(z.getTime());T.emit=(z,Q)=>`if (!(${z} instanceof Date) || isNaN(${z}.getTime())) ${Q.fail("isDate")};`;T.ruleName="isDate";T.constraints={};var fQ=T;function oQ(z){let Q=Object.values(z),Z=($)=>Q.indexOf($)!==-1;return Z.emit=($,K)=>{return`if (_refs[${K.addRef(Q)}].indexOf(${$}) === -1) ${K.fail("isEnum")};`},Z.ruleName="isEnum",Z.constraints={values:Object.values(z)},Z}var b=(z)=>typeof z==="number"&&Number.isInteger(z);b.emit=(z,Q)=>`if (typeof ${z} !== 'number' || !Number.isInteger(${z})) ${Q.fail("isInt")};`;b.ruleName="isInt";b.requiresType="number";b.constraints={};var _Q=b,g=(z)=>Array.isArray(z);g.emit=(z,Q)=>`if (!Array.isArray(${z})) ${Q.fail("isArray")};`;g.ruleName="isArray";g.constraints={};var NQ=g,L=(z)=>typeof z==="object"&&z!==null&&!Array.isArray(z);L.emit=(z,Q)=>`if (typeof ${z} !== 'object' || ${z} === null || Array.isArray(${z})) ${Q.fail("isObject")};`;L.ruleName="isObject";L.constraints={};var sQ=L;function xQ(z,Q){let Z=Q?.exclusive??!1,$=Z?(K)=>K>z:(K)=>K>=z;return $.emit=(K,j)=>Z?`if (${K} <= ${z}) ${j.fail("min")};`:`if (${K} < ${z}) ${j.fail("min")};`,$.ruleName="min",$.requiresType="number",$.constraints=Z?{min:z,exclusive:!0}:{min:z},$}function mQ(z,Q){let Z=Q?.exclusive??!1,$=Z?(K)=>K<z:(K)=>K<=z;return $.emit=(K,j)=>Z?`if (${K} >= ${z}) ${j.fail("max")};`:`if (${K} > ${z}) ${j.fail("max")};`,$.ruleName="max",$.requiresType="number",$.constraints=Z?{max:z,exclusive:!0}:{max:z},$}var V=(z)=>z>0;V.emit=(z,Q)=>`if (${z} <= 0) ${Q.fail("isPositive")};`;V.ruleName="isPositive";V.requiresType="number";V.constraints={min:0,exclusive:!0};var iQ=V,G=(z)=>z<0;G.emit=(z,Q)=>`if (${z} >= 0) ${Q.fail("isNegative")};`;G.ruleName="isNegative";G.requiresType="number";G.constraints={max:0,exclusive:!0};var cQ=G;function lQ(z){let Q=(Z)=>Z%z===0;return Q.emit=(Z,$)=>`if (${Z} % ${z} !== 0) ${$.fail("isDivisibleBy")};`,Q.ruleName="isDivisibleBy",Q.requiresType="number",Q.constraints={divisor:z},Q}function rQ(z){let Q=z.getTime(),Z=($)=>$ instanceof Date&&$.getTime()>=Q;return Z.emit=($,K)=>{let j=K.addRef(Q);return`if (!(${$} instanceof Date) || ${$}.getTime() < _refs[${j}]) ${K.fail("minDate")};`},Z.ruleName="minDate",Z.requiresType="date",Z.constraints={min:z.toISOString()},Z}function tQ(z){let Q=z.getTime(),Z=($)=>$ instanceof Date&&$.getTime()<=Q;return Z.emit=($,K)=>{let j=K.addRef(Q);return`if (!(${$} instanceof Date) || ${$}.getTime() > _refs[${j}]) ${K.fail("maxDate")};`},Z.ruleName="maxDate",Z.requiresType="date",Z.constraints={max:z.toISOString()},Z}function q(z,Q,Z,$="string"){let K=(j)=>{if(typeof j!=="string")return!1;return Q(j)};if(K.emit=Z,K.ruleName=z,$!==void 0)K.requiresType=$;return K}function eQ(z){let Q=(Z)=>typeof Z==="string"&&Z.length>=z;return Q.emit=(Z,$)=>`if (${Z}.length < ${z}) ${$.fail("minLength")};`,Q.ruleName="minLength",Q.requiresType="string",Q.constraints={min:z},Q}function aQ(z){let Q=(Z)=>typeof Z==="string"&&Z.length<=z;return Q.emit=(Z,$)=>`if (${Z}.length > ${z}) ${$.fail("maxLength")};`,Q.ruleName="maxLength",Q.requiresType="string",Q.constraints={max:z},Q}function zZ(z,Q){let Z=($)=>typeof $==="string"&&$.length>=z&&$.length<=Q;return Z.emit=($,K)=>`if (${$}.length < ${z} || ${$}.length > ${Q}) ${K.fail("length")};`,Z.ruleName="length",Z.requiresType="string",Z.constraints={min:z,max:Q},Z}function QZ(z){let Q=(Z)=>typeof Z==="string"&&Z.includes(z);return Q.emit=(Z,$)=>{let K=$.addRef(z);return`if (${Z}.indexOf(_refs[${K}]) === -1) ${$.fail("contains")};`},Q.ruleName="contains",Q.requiresType="string",Q.constraints={seed:z},Q}function ZZ(z){let Q=(Z)=>typeof Z==="string"&&!Z.includes(z);return Q.emit=(Z,$)=>{let K=$.addRef(z);return`if (${Z}.indexOf(_refs[${K}]) !== -1) ${$.fail("notContains")};`},Q.ruleName="notContains",Q.requiresType="string",Q.constraints={seed:z},Q}function $Z(z,Q){let Z=z instanceof RegExp?z:new RegExp(z,Q),$=(K)=>typeof K==="string"&&Z.test(K);return $.emit=(K,j)=>{return`if (!_re[${j.addRegex(Z)}].test(${K})) ${j.fail("matches")};`},$.ruleName="matches",$.requiresType="string",$.constraints={pattern:Z.source},$}var X=(z)=>typeof z==="string"&&z===z.toLowerCase();X.emit=(z,Q)=>`if (${z} !== ${z}.toLowerCase()) ${Q.fail("isLowercase")};`;X.ruleName="isLowercase";X.requiresType="string";X.constraints={};var KZ=X,F=(z)=>typeof z==="string"&&z===z.toUpperCase();F.emit=(z,Q)=>`if (${z} !== ${z}.toUpperCase()) ${Q.fail("isUppercase")};`;F.ruleName="isUppercase";F.requiresType="string";F.constraints={};var jZ=F,_=/^[\x00-\x7F]*$/,dz=q("isAscii",(z)=>_.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(_)}].test(${z})) ${Q.fail("isAscii")};`});dz.constraints={};var Oz=/^[a-zA-Z]+$/;function Sz(z){return typeof z==="string"&&z.length>0&&Oz.test(z)}var M=function z(Q){if(Q===void 0)return z;return Sz(Q)};M.emit=(z,Q)=>{return`if (!_re[${Q.addRegex(Oz)}].test(${z})) ${Q.fail("isAlpha")};`};M.ruleName="isAlpha";M.requiresType="string";M.constraints={};var JZ=M,Tz=/^[a-zA-Z0-9]+$/;function pz(z){return typeof z==="string"&&z.length>0&&Tz.test(z)}var U=function z(Q){if(Q===void 0)return z;return pz(Q)};U.emit=(z,Q)=>{return`if (!_re[${Q.addRegex(Tz)}].test(${z})) ${Q.fail("isAlphanumeric")};`};U.ruleName="isAlphanumeric";U.requiresType="string";U.constraints={};var qZ=U,H=(z)=>z==="true"||z==="false"||z==="1"||z==="0";H.emit=(z,Q)=>`if (${z} !== 'true' && ${z} !== 'false' && ${z} !== '1' && ${z} !== '0') ${Q.fail("isBooleanString")};`;H.ruleName="isBooleanString";H.requiresType="string";H.constraints={};var wZ=H;function YZ(z){let Q=q("isNumberString",(Z)=>{if(Z.length===0)return!1;let $=Number(Z);return!isNaN($)&&isFinite($)},(Z,$)=>{let K=(J)=>{if(J.length===0)return!1;let w=Number(J);return!isNaN(w)&&isFinite(w)};return`if (!_refs[${$.addRef(K)}](${Z})) ${$.fail("isNumberString")};`});return Q.constraints={},Q}function WZ(z){let Q=/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)$/,Z=q("isDecimal",($)=>Q.test($),($,K)=>{return`if (!_re[${K.addRegex(Q)}].test(${$})) ${K.fail("isDecimal")};`});return Z.constraints={},Z}var d=/[^\u0020-\u007E\uFF61-\uFF9F]/,Rz=q("isFullWidth",(z)=>z.length>0&&d.test(z),(z,Q)=>{let Z=Q.addRegex(d);return`if (${z}.length === 0 || !_re[${Z}].test(${z})) ${Q.fail("isFullWidth")};`});Rz.constraints={};var S=/[\u0020-\u007E\uFF61-\uFF9F]/,Ez=q("isHalfWidth",(z)=>z.length>0&&S.test(z),(z,Q)=>{let Z=Q.addRegex(S);return`if (${z}.length === 0 || !_re[${Z}].test(${z})) ${Q.fail("isHalfWidth")};`});Ez.constraints={};var fz=q("isVariableWidth",(z)=>d.test(z)&&S.test(z),(z,Q)=>{let Z=Q.addRegex(d),$=Q.addRegex(S);return`if (!_re[${Z}].test(${z}) || !_re[${$}].test(${z})) ${Q.fail("isVariableWidth")};`});fz.constraints={};var N=/[^\x00-\xFF]/,oz=q("isMultibyte",(z)=>z.length>0&&N.test(z),(z,Q)=>{let Z=Q.addRegex(N);return`if (${z}.length === 0 || !_re[${Z}].test(${z})) ${Q.fail("isMultibyte")};`});oz.constraints={};var s=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,_z=q("isSurrogatePair",(z)=>z.length>0&&s.test(z),(z,Q)=>{let Z=Q.addRegex(s);return`if (${z}.length === 0 || !_re[${Z}].test(${z})) ${Q.fail("isSurrogatePair")};`});_z.constraints={};var u=/^[0-9a-fA-F]+$/,Nz=q("isHexadecimal",(z)=>u.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(u)}].test(${z})) ${Q.fail("isHexadecimal")};`});Nz.constraints={};var x=/^(0[oO])?[0-7]+$/,sz=q("isOctal",(z)=>z.length>0&&x.test(z),(z,Q)=>{let Z=Q.addRegex(x);return`if (${z}.length === 0 || !_re[${Z}].test(${z})) ${Q.fail("isOctal")};`});sz.constraints={};var m=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\.[a-zA-Z]{2,}$/;function bZ(z){let Q=q("isEmail",(Z)=>m.test(Z),(Z,$)=>{return`if (!_re[${$.addRegex(m)}].test(${Z})) ${$.fail("isEmail")};`});return Q.constraints={format:"email"},Q}var uz=["http","https","ftp"];function VZ(z){let Z=(z?.protocols??uz).map((j)=>j.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),$=new RegExp(`^(?:${Z}):\\/\\/(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)(?::\\d{1,5})?(?:\\/[^\\s]*)?$`),K=(j)=>{if(typeof j!=="string"||j.length===0)return!1;return $.test(j)};return K.emit=(j,J)=>{return`if (!_re[${J.addRegex($)}].test(${j})) ${J.fail("isURL")};`},K.ruleName="isURL",K.requiresType="string",K.constraints={format:"uri"},K}var f={all:/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,1:/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-1[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/,2:/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-2[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/,3:/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-3[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/,4:/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/,5:/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-5[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/};function GZ(z){let Q=z!=null?f[z]??f.all:f.all,Z=q("isUUID",($)=>Q.test($),($,K)=>{return`if (!_re[${K.addRegex(Q)}].test(${$})) ${K.fail("isUUID")};`});return Z.constraints={format:"uuid"},Z}var A=/^(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/,I=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$|^::(?:[0-9a-fA-F]{1,4}:){0,6}[0-9a-fA-F]{1,4}$|^(?:[0-9a-fA-F]{1,4}:){1,7}:$|^(?:[0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}$|^(?:[0-9a-fA-F]{1,4}:){1,5}(?::[0-9a-fA-F]{1,4}){1,2}$|^(?:[0-9a-fA-F]{1,4}:){1,4}(?::[0-9a-fA-F]{1,4}){1,3}$|^(?:[0-9a-fA-F]{1,4}:){1,3}(?::[0-9a-fA-F]{1,4}){1,4}$|^(?:[0-9a-fA-F]{1,4}:){1,2}(?::[0-9a-fA-F]{1,4}){1,5}$|^[0-9a-fA-F]{1,4}:(?::[0-9a-fA-F]{1,4}){1,6}$|^::$|^::1$|^::(?:ffff(?::0{1,4})?:)?(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$|^(?:[0-9a-fA-F]{1,4}:){1,4}:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/;function XZ(z){let Q=(Z)=>{if(typeof Z!=="string")return!1;if(z===4)return A.test(Z);if(z===6)return I.test(Z);return A.test(Z)||I.test(Z)};return Q.emit=(Z,$)=>{if(z===4)return`if (!_re[${$.addRegex(A)}].test(${Z})) ${$.fail("isIP")};`;if(z===6)return`if (!_re[${$.addRegex(I)}].test(${Z})) ${$.fail("isIP")};`;let K=$.addRegex(A),j=$.addRegex(I);return`if (!_re[${K}].test(${Z}) && !_re[${j}].test(${Z})) ${$.fail("isIP")};`},Q.ruleName="isIP",Q.requiresType="string",Q.constraints={version:z},Q}var i=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,xz=q("isHexColor",(z)=>i.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(i)}].test(${z})) ${Q.fail("isHexColor")};`});xz.constraints={};var c=/^rgb\(\s*(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\s*,\s*(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\s*,\s*(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\s*\)$/,l=/^rgba\(\s*(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\s*,\s*(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\s*,\s*(25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\s*,\s*(0|0?\.\d+|1(\.0+)?)\s*\)$/,n=/^rgba?\(\s*(\d{1,2}|100)%\s*,\s*(\d{1,2}|100)%\s*,\s*(\d{1,2}|100)%(?:\s*,\s*(0|0?\.\d+|1(?:\.0+)?))?\s*\)$/;function FZ(z=!1){let Q=(Z)=>{if(typeof Z!=="string")return!1;if(z)return n.test(Z);return c.test(Z)||l.test(Z)};return Q.emit=(Z,$)=>{if(z)return`if (!_re[${$.addRegex(n)}].test(${Z})) ${$.fail("isRgbColor")};`;let K=$.addRegex(c),j=$.addRegex(l);return`if (!_re[${K}].test(${Z}) && !_re[${j}].test(${Z})) ${$.fail("isRgbColor")};`},Q.ruleName="isRgbColor",Q.requiresType="string",Q.constraints={},Q}var r=/^hsla?\(\s*(360|3[0-5]\d|[12]\d{2}|[1-9]\d|\d)\s*,\s*(100|[1-9]\d|\d)%\s*,\s*(100|[1-9]\d|\d)%(?:\s*,\s*(0|0?\.\d+|1(?:\.0+)?))?\s*\)$/,mz=q("isHSL",(z)=>r.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(r)}].test(${z})) ${Q.fail("isHSL")};`});mz.constraints={};var t=/^[0-9a-fA-F]{2}(?::[0-9a-fA-F]{2}){5}$/,v=/^[0-9a-fA-F]{2}(?:-[0-9a-fA-F]{2}){5}$/,e=/^[0-9a-fA-F]{12}$/;function MZ(z){let Q=(Z)=>{if(typeof Z!=="string")return!1;if(z?.no_separators)return e.test(Z);return t.test(Z)||v.test(Z)};return Q.emit=(Z,$)=>{if(z?.no_separators)return`if (!_re[${$.addRegex(e)}].test(${Z})) ${$.fail("isMACAddress")};`;let K=$.addRegex(t),j=$.addRegex(v);return`if (!_re[${K}].test(${Z}) && !_re[${j}].test(${Z})) ${$.fail("isMACAddress")};`},Q.ruleName="isMACAddress",Q.requiresType="string",Q.constraints={},Q}function a(z){let Q=z.replace(/[-\s]/g,"");if(!/^\d{9}[\dX]$/.test(Q))return!1;let Z=0;for(let K=0;K<9;K++)Z+=(10-K)*(Q.charCodeAt(K)-48);let $=Q[9]==="X"?10:Q.charCodeAt(9)-48;return Z+=$,Z%11===0}function zz(z){let Q=z.replace(/[-\s]/g,"");if(!/^\d{13}$/.test(Q))return!1;let Z=0;for(let K=0;K<12;K++)Z+=(Q.charCodeAt(K)-48)*(K%2===0?1:3);return(10-Z%10)%10===Q.charCodeAt(12)-48}function UZ(z){let Q=(Z)=>{if(typeof Z!=="string")return!1;if(z===10)return a(Z);if(z===13)return zz(Z);return a(Z)||zz(Z)};return Q.emit=(Z,$)=>{return`if (!_refs[${$.addRef(Q)}](${Z})) ${$.fail("isISBN")};`},Q.ruleName="isISBN",Q.requiresType="string",Q.constraints={},Q}var iz=/^[A-Z]{2}[A-Z0-9]{9}[0-9]$/;function Qz(z){if(!iz.test(z))return!1;let Q=z.split("").map((K)=>{let j=K.charCodeAt(0);return j>=65?String(j-55):K}).join(""),Z=0,$=!1;for(let K=Q.length-1;K>=0;K--){let j=parseInt(Q[K],10);if($){if(j*=2,j>9)j-=9}Z+=j,$=!$}return Z%10===0}var cz=q("isISIN",Qz,(z,Q)=>{return`if (!_refs[${Q.addRef(Qz)}](${z})) ${Q.fail("isISIN")};`});cz.constraints={};var o=/^\d{4}(?:-\d{2}(?:-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?)?)?)?$/;function lz(z){if(!o.test(z))return!1;let Q=z.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!Q)return!0;let Z=Number(Q[2]),$=Number(Q[3]);if(Z<1||Z>12)return!1;let K=new Date(Number(Q[1]),Z,0).getDate();return $>=1&&$<=K}function HZ(z){if(z?.strict){let Z=($)=>{if(typeof $!=="string")return!1;return lz($)};return Z.ruleName="isISO8601",Z.emit=($,K)=>{return`if (!_refs[${K.addRef(Z)}](${$})) ${K.fail("isISO8601")};`},Z.constraints={format:"date-time"},Z}let Q=q("isISO8601",(Z)=>o.test(Z),(Z,$)=>{return`if (!_re[${$.addRegex(o)}].test(${Z})) ${$.fail("isISO8601")};`});return Q.constraints={format:"date-time"},Q}var Zz=/^[A-Z]{2}-[A-Z0-9]{3}-\d{2}-\d{5}$|^[A-Z]{2}[A-Z0-9]{3}\d{7}$/,nz=q("isISRC",(z)=>Zz.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(Zz)}].test(${z})) ${Q.fail("isISRC")};`});nz.constraints={};function rz(z,Q){let Z=Q?.requireHyphen!==!1,$=Z?z:z.replace(/-/g,"");if(!(Z?/^\d{4}-\d{3}[\dX]$/:/^\d{7}[\dX]$/).test($))return!1;let j=$.replace(/-/g,""),J=0;for(let Y=0;Y<7;Y++)J+=(8-Y)*(j.charCodeAt(Y)-48);let w=j[7]==="X"?10:j.charCodeAt(7)-48;return J+=w,J%11===0}function BZ(z){let Q=(Z)=>{if(typeof Z!=="string")return!1;return rz(Z,z)};return Q.emit=(Z,$)=>{return`if (!_refs[${$.addRef(Q)}](${Z})) ${$.fail("isISSN")};`},Q.ruleName="isISSN",Q.requiresType="string",Q.constraints={},Q}var $z=/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/,tz=q("isJWT",(z)=>$z.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex($z)}].test(${z})) ${Q.fail("isJWT")};`});tz.constraints={};var Kz=/^[-+]?([1-8]?\d(?:\.\d+)?|90(?:\.0+)?),\s*[-+]?(180(?:\.0+)?|1[0-7]\d(?:\.\d+)?|\d{1,2}(?:\.\d+)?)$/;function DZ(z){let Q=q("isLatLong",(Z)=>Kz.test(Z),(Z,$)=>{return`if (!_re[${$.addRegex(Kz)}].test(${Z})) ${$.fail("isLatLong")};`});return Q.constraints={},Q}var jz=/^[a-zA-Z]{2,3}(?:-[a-zA-Z]{4})?(?:-(?:[a-zA-Z]{2}|\d{3}))?(?:-[a-zA-Z\d]{5,8})*$/,vz=q("isLocale",(z)=>jz.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(jz)}].test(${z})) ${Q.fail("isLocale")};`});vz.constraints={};var Jz=/^data:([a-zA-Z0-9!#$&\-^_]+\/[a-zA-Z0-9!#$&\-^_]+)(?:;[a-zA-Z0-9\-]+=[a-zA-Z0-9\-]+)*(?:;base64)?,[\s\S]*$/,ez=q("isDataURI",(z)=>Jz.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(Jz)}].test(${z})) ${Q.fail("isDataURI")};`});ez.constraints={};function hZ(z){let Q=z?.require_tld!==!1,Z=($)=>{if(typeof $!=="string")return!1;let K=$;if(z?.allow_trailing_dot&&K.endsWith("."))K=K.slice(0,-1);if(K.length===0)return!1;let j=K.split(".");if(Q&&j.length<2)return!1;if(Q){let J=j[j.length-1];if(!J||J.length<2||!/^[a-zA-Z]{2,}$/.test(J))return!1}return j.every((J)=>{if(J.length===0||J.length>63)return!1;if(z?.allow_underscores)return/^[a-zA-Z0-9_-]+$/.test(J);return/^[a-zA-Z0-9-]+$/.test(J)&&!J.startsWith("-")&&!J.endsWith("-")})};return Z.emit=($,K)=>{return`if (!_refs[${K.addRef(Z)}](${$})) ${K.fail("isFQDN")};`},Z.ruleName="isFQDN",Z.requiresType="string",Z.constraints={},Z}var qz=/^(?:6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{1,3}|\d)$/,az=q("isPort",(z)=>qz.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(qz)}].test(${z})) ${Q.fail("isPort")};`});az.constraints={};function wz(z){if(!/^\d{8}$/.test(z)&&!/^\d{13}$/.test(z))return!1;let Q=z.split("").map(Number),Z=Q.length,$=0;for(let j=0;j<Z-1;j++)$+=Q[j]*(Z===8?j%2===0?3:1:j%2===0?1:3);return(10-$%10)%10===Q[Z-1]}var zQ=q("isEAN",wz,(z,Q)=>{return`if (!_refs[${Q.addRef(wz)}](${z})) ${Q.fail("isEAN")};`});zQ.constraints={};var gz=new Set(["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]),B=(z)=>{if(typeof z!=="string")return!1;return gz.has(z.toUpperCase())};B.emit=(z,Q)=>{return`if (!_refs[${Q.addRef(gz)}].has(${z}.toUpperCase())) ${Q.fail("isISO31661Alpha2")};`};B.ruleName="isISO31661Alpha2";B.requiresType="string";B.constraints={};var kZ=B,Lz=new Set(["ABW","AFG","AGO","AIA","ALA","ALB","AND","ANT","ARE","ARG","ARM","ASM","ATA","ATF","ATG","AUS","AUT","AZE","BDI","BEL","BEN","BES","BFA","BGD","BGR","BHR","BHS","BIH","BLM","BLR","BLZ","BMU","BOL","BRA","BRB","BRN","BTN","BVT","BWA","CAF","CAN","CCK","CHE","CHL","CHN","CIV","CMR","COD","COG","COK","COL","COM","CPV","CRI","CUB","CUW","CXR","CYM","CYP","CZE","DEU","DJI","DMA","DNK","DOM","DZA","ECU","EGY","ERI","ESH","ESP","EST","ETH","FIN","FJI","FLK","FRA","FRO","FSM","GAB","GBR","GEO","GGY","GHA","GIB","GIN","GLP","GMB","GNB","GNQ","GRC","GRD","GRL","GTM","GUF","GUM","GUY","HKG","HMD","HND","HRV","HTI","HUN","IDN","IMN","IND","IOT","IRL","IRN","IRQ","ISL","ISR","ITA","JAM","JEY","JOR","JPN","KAZ","KEN","KGZ","KHM","KIR","KNA","KOR","KWT","LAO","LBN","LBR","LBY","LCA","LIE","LKA","LSO","LTU","LUX","LVA","MAC","MAF","MAR","MCO","MDA","MDG","MDV","MEX","MHL","MKD","MLI","MLT","MMR","MNE","MNG","MNP","MOZ","MRT","MSR","MTQ","MUS","MWI","MYS","MYT","NAM","NCL","NER","NFK","NGA","NIC","NIU","NLD","NOR","NPL","NRU","NZL","OMN","PAK","PAN","PCN","PER","PHL","PLW","PNG","POL","PRI","PRK","PRT","PRY","PSE","PYF","QAT","REU","ROU","RUS","RWA","SAU","SDN","SEN","SGP","SGS","SHN","SJM","SLB","SLE","SLV","SMR","SOM","SPM","SRB","SSD","STP","SUR","SVK","SVN","SWE","SWZ","SXM","SYC","SYR","TCA","TCD","TGO","THA","TJK","TKL","TKM","TLS","TON","TTO","TUN","TUR","TUV","TWN","TZA","UGA","UKR","UMI","URY","USA","UZB","VAT","VCT","VEN","VGB","VIR","VNM","VUT","WLF","WSM","YEM","ZAF","ZMB","ZWE"]),D=(z)=>{if(typeof z!=="string")return!1;return Lz.has(z.toUpperCase())};D.emit=(z,Q)=>{return`if (!_refs[${Q.addRef(Lz)}].has(${z}.toUpperCase())) ${Q.fail("isISO31661Alpha3")};`};D.ruleName="isISO31661Alpha3";D.requiresType="string";D.constraints={};var PZ=D,Yz=/^[A-Z]{6}[A-Z0-9]{2}(?:[A-Z0-9]{3})?$/,QQ=q("isBIC",(z)=>Yz.test(z.toUpperCase()),(z,Q)=>{return`if (!_re[${Q.addRegex(Yz)}].test(${z}.toUpperCase())) ${Q.fail("isBIC")};`});QQ.constraints={};var Wz=/^[a-zA-Z0-9_-]{20}$/,ZQ=q("isFirebasePushId",(z)=>Wz.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(Wz)}].test(${z})) ${Q.fail("isFirebasePushId")};`});ZQ.constraints={};var bz=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,$Q=q("isSemVer",(z)=>bz.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(bz)}].test(${z})) ${Q.fail("isSemVer")};`});$Q.constraints={};var Vz=/^[0-9a-fA-F]{24}$/,KQ=q("isMongoId",(z)=>Vz.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(Vz)}].test(${z})) ${Q.fail("isMongoId")};`});KQ.constraints={};var h=(z)=>{if(typeof z!=="string")return!1;try{return JSON.parse(z),!0}catch{return!1}};h.emit=(z,Q)=>{return`if (!_refs[${Q.addRef(($)=>{try{return JSON.parse($),!0}catch{return!1}})}](${z})) ${Q.fail("isJSON")};`};h.ruleName="isJSON";h.requiresType="string";h.constraints={};var CZ=h,jQ=/^[A-Z2-7]+=*$/i;function yZ(z){let Q=jQ,Z=q("isBase32",($)=>{if($.length===0)return!1;if($.length%8!==0)return!1;return Q.test($)},($,K)=>{let j=K.addRegex(Q);return`if (${$}.length === 0 || ${$}.length % 8 !== 0 || !_re[${j}].test(${$})) ${K.fail("isBase32")};`});return Z.constraints={},Z}var Gz=/^[1-9A-HJ-NP-Za-km-z]+$/,JQ=q("isBase58",(z)=>Gz.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(Gz)}].test(${z})) ${Q.fail("isBase58")};`});JQ.constraints={};var qQ=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$/,wQ=/^[A-Za-z0-9_-]+={0,2}$/;function OZ(z){let Q=z?.urlSafe?wQ:qQ,Z=q("isBase64",($)=>{if($.length===0)return!1;return Q.test($)},($,K)=>{let j=K.addRegex(Q);return`if (${$}.length === 0 || !_re[${j}].test(${$})) ${K.fail("isBase64")};`});return Z.constraints={},Z}var Xz=/^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])$/;function TZ(z){let Q=q("isDateString",(Z)=>Xz.test(Z),(Z,$)=>{return`if (!_re[${$.addRegex(Xz)}].test(${Z})) ${$.fail("isDateString")};`});return Q.constraints={},Q}var Fz=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9][a-zA-Z0-9!#$&\-^_.+]*(?:;.+)?$/,YQ=q("isMimeType",(z)=>Fz.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(Fz)}].test(${z})) ${Q.fail("isMimeType")};`});YQ.constraints={};var Mz=/^[-+]?(?:[,.\d]+)(?:[.,]\d{2})?$|^\$?-?(?:\d+|\d{1,3}(?:,\d{3})*)(?:\.\d{1,2})?$/;function gZ(z){let Q=q("isCurrency",(Z)=>{if(Z.length===0)return!1;return Mz.test(Z)},(Z,$)=>{let K=$.addRegex(Mz);return`if (${Z}.length === 0 || !_re[${K}].test(${Z})) ${$.fail("isCurrency")};`});return Q.constraints={},Q}var Uz=/^magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32,40}/i,WQ=q("isMagnetURI",(z)=>Uz.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(Uz)}].test(${z})) ${Q.fail("isMagnetURI")};`});WQ.constraints={};function bQ(z){let Q=z.replace(/[\s-]/g,"");if(Q.length===0||!/^\d+$/.test(Q))return!1;let Z=0,$=!1;for(let K=Q.length-1;K>=0;K--){let j=Q.charCodeAt(K)-48;if($){if(j*=2,j>9)j-=9}Z+=j,$=!$}return Z%10===0}var k=(z)=>{if(typeof z!=="string")return!1;return bQ(z)};k.emit=(z,Q)=>`{
|
|
6
|
-
var _cs=${z}.replace(/[\\s-]/g,'');
|
|
7
|
-
if(_cs.length===0||!/^\\d+$/.test(_cs)){${Q.fail("isCreditCard")}}
|
|
8
|
-
else{var _sum=0,_alt=false;
|
|
9
|
-
for(var _ci=_cs.length-1;_ci>=0;_ci--){var _cn=_cs.charCodeAt(_ci)-48;if(_alt){_cn*=2;if(_cn>9)_cn-=9;}_sum+=_cn;_alt=!_alt;}
|
|
10
|
-
if(_sum%10!==0)${Q.fail("isCreditCard")};}
|
|
11
|
-
}`;k.ruleName="isCreditCard";k.requiresType="string";k.constraints={};var LZ=k,VQ={AD:24,AE:23,AL:28,AT:20,AZ:28,BA:20,BE:16,BG:22,BH:22,BR:29,CH:21,CR:22,CY:28,CZ:24,DE:22,DK:18,DO:28,EE:20,ES:24,FI:18,FO:18,FR:27,GB:22,GE:22,GI:23,GL:18,GR:27,GT:28,HR:21,HU:28,IE:22,IL:23,IS:26,IT:27,JO:30,KW:30,KZ:20,LB:28,LC:32,LI:21,LT:20,LU:20,LV:21,MC:27,MD:24,ME:22,MK:19,MR:27,MT:31,MU:30,NL:18,NO:15,PK:24,PL:28,PS:29,PT:25,QA:29,RO:24,RS:22,SA:24,SC:31,SE:24,SI:19,SK:24,SM:27,ST:25,SV:28,TL:23,TN:24,TR:26,UA:29,VA:22,VG:24,XK:20};function GQ(z,Q){let Z=Q?.allowSpaces?z.replace(/\s/g,""):z;if(Z=Z.toUpperCase(),!/^[A-Z]{2}\d{2}[A-Z0-9]+$/.test(Z))return!1;let $=Z.slice(0,2),K=VQ[$];if(K!==void 0&&Z.length!==K)return!1;let J=(Z.slice(4)+Z.slice(0,4)).replace(/[A-Z]/g,(Y)=>String(Y.charCodeAt(0)-55)),w=0;for(let Y=0;Y<J.length;Y+=7){let W=String(w)+J.slice(Y,Y+7);w=parseInt(W,10)%97}return w===1}function AZ(z){let Q=(Z)=>{if(typeof Z!=="string")return!1;return GQ(Z,z)};return Q.emit=(Z,$)=>{return`if (!_refs[${$.addRef(Q)}](${Z})) ${$.fail("isIBAN")};`},Q.ruleName="isIBAN",Q.requiresType="string",Q.constraints={},Q}function IZ(z,Q){let Z=($)=>{if(typeof $!=="string")return!1;let K=Buffer.byteLength($,"utf8");if(K<z)return!1;if(Q!==void 0&&K>Q)return!1;return!0};return Z.emit=($,K)=>{let j=(w)=>{let Y=Buffer.byteLength(w,"utf8");if(Y<z)return!1;if(Q!==void 0&&Y>Q)return!1;return!0};return`if (!_refs[${K.addRef(j)}](${$})) ${K.fail("isByteLength")};`},Z.ruleName="isByteLength",Z.requiresType="string",Z.constraints={},Z}var XQ={md5:/^[a-f0-9]{32}$/i,md4:/^[a-f0-9]{32}$/i,md2:/^[a-f0-9]{32}$/i,sha1:/^[a-f0-9]{40}$/i,sha256:/^[a-f0-9]{64}$/i,sha384:/^[a-f0-9]{96}$/i,sha512:/^[a-f0-9]{128}$/i,ripemd128:/^[a-f0-9]{32}$/i,ripemd160:/^[a-f0-9]{40}$/i,"tiger128,3":/^[a-f0-9]{32}$/i,"tiger128,4":/^[a-f0-9]{32}$/i,"tiger160,3":/^[a-f0-9]{40}$/i,"tiger160,4":/^[a-f0-9]{40}$/i,"tiger192,3":/^[a-f0-9]{48}$/i,"tiger192,4":/^[a-f0-9]{48}$/i,crc32:/^[a-f0-9]{8}$/i,crc32b:/^[a-f0-9]{8}$/i};function dZ(z){let Q=XQ[z],Z=($)=>{if(typeof $!=="string")return!1;if(!Q)return!1;return Q.test($)};return Z.emit=($,K)=>{if(!Q)return K.fail("isHash")+";";return`if (!_re[${K.addRegex(Q)}].test(${$})) ${K.fail("isHash")};`},Z.ruleName="isHash",Z.requiresType="string",Z.constraints={},Z}var Hz=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/i,FQ=q("isRFC3339",(z)=>Hz.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(Hz)}].test(${z})) ${Q.fail("isRFC3339")};`});FQ.constraints={};var Bz=/^([01]\d|2[0-3]):[0-5]\d$/,MQ=q("isMilitaryTime",(z)=>Bz.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(Bz)}].test(${z})) ${Q.fail("isMilitaryTime")};`});MQ.constraints={};function Az(z){if(typeof z==="number")return z>=-90&&z<=90;if(typeof z==="string"){let Q=parseFloat(z);if(isNaN(Q))return!1;if(String(Q)!==z&&z!==String(Q)){if(!/^-?\d+(\.\d+)?$/.test(z))return!1}return Q>=-90&&Q<=90}return!1}var p=(z)=>Az(z);p.emit=(z,Q)=>{return`if (!_refs[${Q.addRef(Az)}](${z})) ${Q.fail("isLatitude")};`};p.ruleName="isLatitude";p.constraints={};var SZ=p;function Iz(z){if(typeof z==="number")return z>=-180&&z<=180;if(typeof z==="string"){let Q=parseFloat(z);if(isNaN(Q))return!1;if(!/^-?\d+(\.\d+)?$/.test(z))return!1;return Q>=-180&&Q<=180}return!1}var R=(z)=>Iz(z);R.emit=(z,Q)=>{return`if (!_refs[${Q.addRef(Iz)}](${z})) ${Q.fail("isLongitude")};`};R.ruleName="isLongitude";R.constraints={};var pZ=R,Dz=/^0x[0-9a-fA-F]{40}$/,UQ=q("isEthereumAddress",(z)=>Dz.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(Dz)}].test(${z})) ${Q.fail("isEthereumAddress")};`});UQ.constraints={};var hz=/^1[a-km-zA-HJ-NP-Z1-9]{25,34}$/,kz=/^3[a-km-zA-HJ-NP-Z1-9]{25,34}$/,Pz=/^(bc1)[a-z0-9]{6,87}$/,HQ=q("isBtcAddress",(z)=>hz.test(z)||kz.test(z)||Pz.test(z),(z,Q)=>{let Z=Q.addRegex(hz),$=Q.addRegex(kz),K=Q.addRegex(Pz);return`if (!_re[${Z}].test(${z}) && !_re[${$}].test(${z}) && !_re[${K}].test(${z})) ${Q.fail("isBtcAddress")};`});HQ.constraints={};var Cz=new Set(["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HRK","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SLL","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","YER","ZAR","ZMW","ZWL"]),BQ=q("isISO4217CurrencyCode",(z)=>Cz.has(z),(z,Q)=>{return`if (!_refs[${Q.addRef(Cz)}].has(${z})) ${Q.fail("isISO4217CurrencyCode")};`});BQ.constraints={};var yz=/^\+[1-9]\d{6,14}$/,DQ=q("isPhoneNumber",(z)=>yz.test(z),(z,Q)=>{return`if (!_re[${Q.addRegex(yz)}].test(${z})) ${Q.fail("isPhoneNumber")};`});DQ.constraints={};function RZ(z){let Q=z?.minLength??8,Z=z?.minLowercase??1,$=z?.minUppercase??1,K=z?.minNumbers??1,j=z?.minSymbols??1,J=(Y)=>{if(Y.length<Q)return!1;if(Z>0){if((Y.match(/[a-z]/g)||[]).length<Z)return!1}if($>0){if((Y.match(/[A-Z]/g)||[]).length<$)return!1}if(K>0){if((Y.match(/[0-9]/g)||[]).length<K)return!1}if(j>0){if((Y.match(/[^a-zA-Z0-9]/g)||[]).length<j)return!1}return!0},w=(Y)=>{if(typeof Y!=="string")return!1;return J(Y)};return w.emit=(Y,W)=>{return`if (!_refs[${W.addRef(J)}](${Y})) ${W.fail("isStrongPassword")};`},w.ruleName="isStrongPassword",w.requiresType="string",w.constraints={},w}var hQ={US:/^\d{2}-\d{7}$/,KR:/^\d{3}-\d{2}-\d{5}$/,DE:/^\d{11}$/,FR:/^[0-9]{13}$/,GB:/^\d{10}$/,IT:/^[A-Z]{6}\d{2}[A-Z]\d{2}[A-Z]\d{3}[A-Z]$/i,ES:/^[0-9A-Z]\d{7}[0-9A-Z]$/i,AU:/^\d{11}$/,CA:/^\d{9}$/,IN:/^[A-Z]{5}\d{4}[A-Z]$/i};function EZ(z){let Q=hQ[z],Z=($)=>{if(typeof $!=="string")return!1;if(!Q)return!1;return Q.test($)};return Z.emit=($,K)=>{if(!Q)return K.fail("isTaxId")+";";return`if (!_re[${K.addRegex(Q)}].test(${$})) ${K.fail("isTaxId")};`},Z.ruleName="isTaxId",Z.requiresType="string",Z.constraints={},Z}function oZ(z){let Q=(Z)=>{if(!Array.isArray(Z))return!1;return z.every(($)=>Z.includes($))};return Q.emit=(Z,$)=>{return`if (!_refs[${$.addRef(z)}].every(function(v){return ${Z}.indexOf(v)!==-1;})) ${$.fail("arrayContains")};`},Q.ruleName="arrayContains",Q.constraints={values:z},Q}function _Z(z){let Q=(Z)=>{if(!Array.isArray(Z))return!1;return z.every(($)=>!Z.includes($))};return Q.emit=(Z,$)=>{return`if (_refs[${$.addRef(z)}].some(function(v){return ${Z}.indexOf(v)!==-1;})) ${$.fail("arrayNotContains")};`},Q.ruleName="arrayNotContains",Q.constraints={values:z},Q}function NZ(z){let Q=(Z)=>Array.isArray(Z)&&Z.length>=z;return Q.emit=(Z,$)=>`if (${Z}.length < ${z}) ${$.fail("arrayMinSize")};`,Q.ruleName="arrayMinSize",Q.constraints={min:z},Q}function sZ(z){let Q=(Z)=>Array.isArray(Z)&&Z.length<=z;return Q.emit=(Z,$)=>`if (${Z}.length > ${z}) ${$.fail("arrayMaxSize")};`,Q.ruleName="arrayMaxSize",Q.constraints={max:z},Q}function uZ(z){let Q=(Z)=>{if(!Array.isArray(Z))return!1;if(z){let $=Z.map(z);return new Set($).size===$.length}return new Set(Z).size===Z.length};return Q.emit=(Z,$)=>{if(z){let K=$.addRef(z);return`{var _keys=${Z}.map(_refs[${K}]);if(new Set(_keys).size!==_keys.length)${$.fail("arrayUnique")};}`}return`if(new Set(${Z}).size!==${Z}.length)${$.fail("arrayUnique")};`},Q.ruleName="arrayUnique",Q.constraints={},Q}var E=(z)=>Array.isArray(z)&&z.length>0;E.emit=(z,Q)=>`if (${z}.length === 0) ${Q.fail("arrayNotEmpty")};`;E.ruleName="arrayNotEmpty";E.constraints={};var xZ=E;function iZ(z){let Q=(Z)=>{if(Z===null||typeof Z!=="object"||Array.isArray(Z))return!1;let $=Object.keys(Z);if(z?.nullable)return $.some((K)=>Z[K]!=null);return $.length>0};return Q.emit=(Z,$)=>{if(z?.nullable)return`if (!_refs[${$.addRef(Q)}](${Z})) ${$.fail("isNotEmptyObject")};`;return`if (Object.keys(${Z}).length === 0) ${$.fail("isNotEmptyObject")};`},Q.ruleName="isNotEmptyObject",Q.constraints={nullable:z?.nullable},Q}function cZ(z){let Q=(Z)=>Z instanceof z;return Q.emit=(Z,$)=>{let K=$.addRef(z);return`if (!(${Z} instanceof _refs[${K}])) ${$.fail("isInstance")};`},Q.ruleName="isInstance",Q.constraints={type:z.name},Q}var kQ={"ko-KR":/^(\+?82|0)1[016789]\d{7,8}$/,"en-US":/^\+?1?[2-9]\d{2}[2-9]\d{6}$/,"zh-CN":/^(\+?86)?1[3-9]\d{9}$/,"zh-TW":/^(\+?886)?9\d{8}$/,"ja-JP":/^(\+?81)?0?[789]0[0-9]{8}$/,"de-DE":/^(\+?49)?1(5\d|6[0-9]|7[0-9])\d{8}$/,"fr-FR":/^(\+?33)?[67]\d{8}$/,"en-GB":/^(\+?44)?7[1-9]\d{8}$/,"ru-RU":/^(\+?7)?9\d{9}$/,"pt-BR":/^(\+?55)?[1-9]{2}9?\d{8}$/,"in-IN":/^(\+?91)?[6-9]\d{9}$/,"ar-SA":/^(\+?966)?5\d{8}$/,"ar-EG":/^(\+?20)?1[0125]\d{8}$/,"vi-VN":/^(\+?84)?[35789]\d{8}$/,"th-TH":/^(\+?66)?[689]\d{8}$/,"id-ID":/^(\+?62)?8\d{9,11}$/,"ms-MY":/^(\+?60)?1\d{8,9}$/,"nl-NL":/^(\+?31)?6\d{8}$/,"it-IT":/^(\+?39)?3\d{9}$/,"es-ES":/^(\+?34)?[67]\d{8}$/,"pl-PL":/^(\+?48)?[45789]\d{8}$/};function nZ(z){let Q=kQ[z],Z=($)=>{if(typeof $!=="string")return!1;if(!Q)return!1;return Q.test($)};return Z.emit=($,K)=>{if(!Q)return K.fail("isMobilePhone")+";";return`if (!_re[${K.addRegex(Q)}].test(${$})) ${K.fail("isMobilePhone")};`},Z.ruleName="isMobilePhone",Z.requiresType="string",Z.constraints={locale:z},Z}var PQ={AD:/^AD\d{3}$/,AT:/^\d{4}$/,AU:/^\d{4}$/,AZ:/^\d{4}$/,BE:/^\d{4}$/,BG:/^\d{4}$/,BR:/^\d{5}-?\d{3}$/,BY:/^\d{6}$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z] ?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:/^\d{4}$/,CN:/^\d{6}$/,CZ:/^\d{3} ?\d{2}$/,DE:/^\d{5}$/,DK:/^\d{4}$/,EE:/^\d{5}$/,ES:/^\d{5}$/,FI:/^\d{5}$/,FR:/^\d{2} ?\d{3}$/,GB:/^(GIR ?0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]([0-9ABEHMNPRV-Y])?)|[0-9][A-HJKPSTUW]) ?[0-9][ABD-HJLNP-UW-Z]{2})$/i,GR:/^\d{3} ?\d{2}$/,HR:/^\d{5}$/,HU:/^\d{4}$/,ID:/^\d{5}$/,IL:/^\d{5}(\d{2})?$/,IN:/^\d{6}$/,IS:/^\d{3}$/,IT:/^\d{5}$/,JP:/^\d{3}-?\d{4}$/,KR:/^\d{5}$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT-\d{5}$/,LU:/^\d{4}$/,LV:/^LV-\d{4}$/,MX:/^\d{5}$/,MT:/^[A-Z]{3} ?\d{4}$/i,MZ:/^\d{4}$/,NL:/^\d{4} ?[A-Z]{2}$/i,NO:/^\d{4}$/,NP:/^\d{5}$/,NZ:/^\d{4}$/,PH:/^\d{4}$/,PK:/^\d{5}$/,PL:/^\d{2}-\d{3}$/,PR:/^009\d{2}([ -]\d{4})?$/,PT:/^\d{4}-\d{3}$/,RO:/^\d{6}$/,RU:/^\d{6}$/,SE:/^\d{3} ?\d{2}$/,SG:/^\d{6}$/,SI:/^\d{4}$/,SK:/^\d{3} ?\d{2}$/,TH:/^\d{5}$/,TN:/^\d{4}$/,TW:/^\d{3}(\d{2})?$/,UA:/^\d{5}$/,US:/^\d{5}(-\d{4})?$/,ZA:/^\d{4}$/,ZM:/^\d{5}$/};function rZ(z){let Q=PQ[z],Z=($)=>{if(typeof $!=="string")return!1;if(!Q)return!1;return Q.test($)};return Z.emit=($,K)=>{if(!Q)return K.fail("isPostalCode")+";";return`if (!_re[${K.addRegex(Q)}].test(${$})) ${K.fail("isPostalCode")};`},Z.ruleName="isPostalCode",Z.requiresType="string",Z.constraints={locale:z},Z}var CQ={AF:/^\d{8}$/,AL:/^[A-Z]\d{8}[A-Z]$/i,AR:/^\d{7,8}$/,AZ:/^AZE\d{8}$/,BE:/^\d{11}$/,BG:/^\d{10}$/,BR:/^\d{9}$/,BY:/^[A-Z]{2}\d{7}$/i,CA:/^\d{9}$/,CH:/^756\d{10}$/,CN:/^\d{15}(\d{2}[0-9xX])?$/,CY:/^\d{7}[A-Z]$/i,CZ:/^\d{9,10}$/,DE:/^[LI TOUAEVBMNPRSZDFGHCK]{9}$/i,DK:/^\d{10}$/,EE:/^\d{11}$/,ES:/^[0-9X-Z]\d{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/i,FI:/^\d{6}[+-A]\d{3}[0-9A-FHJ-NPR-Y]$/,FR:/^\d{8,9}[0-9\u00C1-\u00FF]{1}$/i,GB:/^[A-Z]{2}\d{6}[A-Z]$/i,GR:/^[A-Z]{2}\d{6}$/i,HR:/^\d{11}$/,HU:/^\d{8}[A-Z]{2}$/i,ID:/^\d{16}$/,IE:/^\d{7}[A-W][A-W]?$/,IL:/^\d{9}$/,IN:/^\d{12}$/,IR:/^\d{10}$/,IS:/^\d{10}$/,IT:/^[A-Z]{6}\d{2}[A-Z]\d{2}[A-Z]\d{3}[A-Z]$/i,JP:/^\d{12}$/,KR:/^\d{6}-\d{7}$/,LT:/^\d{11}$/,LU:/^\d{13}$/,LV:/^\d{6}-\d{5}$/,MK:/^\d{13}$/,MX:/^[A-Z]{4}\d{6}[HM][A-Z]{2}[B-DF-HJ-NP-TV-Z]{3}[A-Z0-9]\d$/i,MT:/^\d{7}[A-Z]$/i,NL:/^\d{9}$/,NO:/^\d{11}$/,PL:/^\d{11}$/,PT:/^[1-9]\d{7}[0-9TV]$/i,RO:/^\d{13}$/,RS:/^\d{13}$/,RU:/^\d{10}$/,SE:/^\d{10,12}$/,SI:/^\d{13}$/,SK:/^\d{9,10}$/,TH:/^\d{13}$/,TR:/^\d{11}$/,TW:/^[A-Z]\d{9}$/i,UA:/^\d{9}$/,US:/^\d{3}-\d{2}-\d{4}$/,ZA:/^\d{13}$/};function tZ(z){let Q=CQ[z],Z=($)=>{if(typeof $!=="string")return!1;if(!Q)return!1;return Q.test($)};return Z.emit=($,K)=>{if(!Q)return K.fail("isIdentityCard")+";";return`if (!_re[${K.addRegex(Q)}].test(${$})) ${K.fail("isIdentityCard")};`},Z.ruleName="isIdentityCard",Z.requiresType="string",Z.constraints={locale:z},Z}var yQ={AM:/^[A-Z]{2}\d{7}$/i,AR:/^[A-Z]{3}\d{6}$/i,AT:/^[A-Z]\d{7}$/i,AU:/^[A-Z]\d{7}$/i,AZ:/^[Aa]\d{8}$/,BE:/^[A-Z]{2}\d{6}$/i,BG:/^\d{9}$/,BH:/^[A-Z]{2}\d{6}$/i,BR:/^[A-Z]{2}\d{6}$/i,BY:/^[A-Z]{2}\d{7}$/i,CA:/^[A-Z]{2}\d{6}$/i,CH:/^[A-Z]\d{7}$/i,CN:/^G\d{8}$/,CY:/^[A-Z](\d{6}|\d{8})$/i,CZ:/^\d{8}$/,DE:/^[CFGHJKLMNPRTVWXYZ0-9]{9}$/i,DK:/^\d{9}$/,EE:/^([A-Z]\d{7}|[A-Z]{2}\d{7})$/i,ES:/^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/i,FI:/^[A-Z]{2}\d{7}$/i,FR:/[A-Z0-9]{9}/i,GB:/^\d{9}$/,GR:/^[A-Z]{2}\d{7}$/i,HR:/^\d{9}$/,HU:/^[A-Z]{2}(\d{6}|\d{7})$/i,ID:/^[A-C]\d{7}$/i,IE:/^[A-Z0-9]{2}\d{7}$/i,IL:/^\d{9}$/,IN:/^[A-Z]\d{7}$/i,IR:/^[A-Z]\d{8}$/i,IS:/^(A)\d{7}$/i,IT:/^[A-Z0-9]{9}$/i,JO:/^[A-Z]{2}\d{7}$/i,JP:/^[A-Z]{2}\d{7}$/i,KR:/^[A-Z][A-Z0-9]\d{7}$/i,KW:/^\d{8}$/,KZ:/^[A-Z]\d{8}$/i,LI:/^[A-Z]\d{6}X$/i,LT:/^[A-Z0-9]{8}$/i,LU:/^[A-Z0-9]{8}$/i,LV:/^[A-Z0-9]{2}\d{7}$/i,LY:/^[A-Z]{2}\d{7}$/i,MA:/^[A-Z0-9]{2}\d{7}$/i,MD:/^[A-Z]{2}\d{7}$/i,ME:/^[A-Z]{2}\d{7}$/i,MK:/^[A-Z]\d{7}$/i,MT:/^\d{7}$/,MX:/^[A-Z]\d{8}$/i,MY:/^[AHK]\d{8}[A-Z]$/i,NL:/^[A-NP-Z]{2}[A-NP-Z0-9]{6}\d$/i,NO:/^\d{9}$/,NZ:/^[A-Z]{2}\d{6}$/i,PH:/^[A-Z]\d{7}[A-Z]$/i,PK:/^[A-Z]{2}\d{7}$/i,PL:/^[A-Z]{2}\d{7}$/i,PT:/^[A-Z]\d{6}$/i,RO:/^\d{8}$/,RS:/^\d{9}$/,RU:/^\d{9}$/,SA:/^[A-Z]\d{8}$/i,SE:/^\d{8}$/,SL:/^(P)[A-Z]\d{7}$/i,SK:/^[0-9A-Z]\d{7}$/i,TH:/^[A-Z]{1,2}\d{6,7}$/i,TN:/^\d{8}$/,TR:/^[A-Z]\d{8}$/i,TW:/^[A-Z]\d{9}$/i,UA:/^[A-Z]{2}\d{6}$/i,US:/^\d{9}$/,ZA:/^[A-Z]\d{8}$/i};function vZ(z){let Q=yQ[z],Z=($)=>{if(typeof $!=="string")return!1;if(!Q)return!1;return Q.test($)};return Z.emit=($,K)=>{if(!Q)return K.fail("isPassportNumber")+";";return`if (!_re[${K.addRegex(Q)}].test(${$})) ${K.fail("isPassportNumber")};`},Z.ruleName="isPassportNumber",Z.requiresType="string",Z.constraints={locale:z},Z}
|
|
12
|
-
export{TQ as jb,gQ as kb,LQ as lb,AQ as mb,IQ as nb,dQ as ob,pQ as pb,RQ as qb,EQ as rb,fQ as sb,oQ as tb,_Q as ub,NQ as vb,sQ as wb,xQ as xb,mQ as yb,iQ as zb,cQ as Ab,lQ as Bb,rQ as Cb,tQ as Db,eQ as Eb,aQ as Fb,zZ as Gb,QZ as Hb,ZZ as Ib,$Z as Jb,KZ as Kb,jZ as Lb,dz as Mb,JZ as Nb,qZ as Ob,wZ as Pb,YZ as Qb,WZ as Rb,Rz as Sb,Ez as Tb,fz as Ub,oz as Vb,_z as Wb,Nz as Xb,sz as Yb,bZ as Zb,VZ as _b,GZ as $b,XZ as ac,xz as bc,FZ as cc,mz as dc,MZ as ec,UZ as fc,cz as gc,HZ as hc,nz as ic,BZ as jc,tz as kc,DZ as lc,vz as mc,ez as nc,hZ as oc,az as pc,zQ as qc,kZ as rc,PZ as sc,QQ as tc,ZQ as uc,$Q as vc,KQ as wc,CZ as xc,yZ as yc,JQ as zc,OZ as Ac,TZ as Bc,YQ as Cc,gZ as Dc,WQ as Ec,LZ as Fc,AZ as Gc,IZ as Hc,dZ as Ic,FQ as Jc,MQ as Kc,SZ as Lc,pZ as Mc,UQ as Nc,HQ as Oc,BQ as Pc,DQ as Qc,RZ as Rc,EZ as Sc,oZ as Tc,_Z as Uc,NZ as Vc,sZ as Wc,uZ as Xc,xZ as Yc,iZ as Zc,cZ as _c,nZ as $c,rZ as ad,tZ as bd,vZ as cd};
|
|
13
|
-
|
|
14
|
-
//# debugId=E66A39A339B7577264756E2164756E21
|
|
15
|
-
//# sourceMappingURL=index-wy5sh2nx.js.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ValidationOptions } from '../interfaces';
|
|
2
|
-
/** 배열이 지정한 모든 값을 포함 */
|
|
3
|
-
export declare function ArrayContains(values: unknown[], options?: ValidationOptions): PropertyDecorator;
|
|
4
|
-
/** 배열이 지정한 값을 포함하지 않음 */
|
|
5
|
-
export declare function ArrayNotContains(values: unknown[], options?: ValidationOptions): PropertyDecorator;
|
|
6
|
-
/** 배열 최소 길이 */
|
|
7
|
-
export declare function ArrayMinSize(min: number, options?: ValidationOptions): PropertyDecorator;
|
|
8
|
-
/** 배열 최대 길이 */
|
|
9
|
-
export declare function ArrayMaxSize(max: number, options?: ValidationOptions): PropertyDecorator;
|
|
10
|
-
/** 배열에 중복 값 없음 */
|
|
11
|
-
export declare function ArrayUnique(identifier?: (o: unknown) => unknown, options?: ValidationOptions): PropertyDecorator;
|
|
12
|
-
/** 배열이 비어있지 않음 */
|
|
13
|
-
export declare function ArrayNotEmpty(options?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { ValidationOptions } from '../interfaces';
|
|
2
|
-
/**
|
|
3
|
-
* undefined/null 불허. groups를 무시하고 항상 적용.
|
|
4
|
-
* @IsDefined와 @IsOptional 동시 선언 시 @IsDefined 우선 (optional 가드 생략).
|
|
5
|
-
*/
|
|
6
|
-
export declare function IsDefined(_options?: ValidationOptions): PropertyDecorator;
|
|
7
|
-
/**
|
|
8
|
-
* undefined/null 허용 — 해당 필드의 전체 validation을 skip.
|
|
9
|
-
* @IsDefined와 동시 선언 시 @IsDefined 우선.
|
|
10
|
-
*/
|
|
11
|
-
export declare function IsOptional(_options?: ValidationOptions): PropertyDecorator;
|
|
12
|
-
/**
|
|
13
|
-
* 조건이 false일 때 해당 필드의 전체 검증을 skip.
|
|
14
|
-
* 조건 함수는 원본 input 객체를 인자로 받는다.
|
|
15
|
-
*/
|
|
16
|
-
export declare function ValidateIf(condition: (obj: any) => boolean): PropertyDecorator;
|
|
17
|
-
/**
|
|
18
|
-
* 중첩 DTO 재귀 검증 트리거. @Type과 함께 사용해야 한다.
|
|
19
|
-
* builder 트리거 조건: meta.type !== null && meta.flags.validateNested === true
|
|
20
|
-
*/
|
|
21
|
-
export declare function ValidateNested(options?: ValidationOptions): PropertyDecorator;
|
|
22
|
-
/**
|
|
23
|
-
* null 허용+할당. undefined는 거부.
|
|
24
|
-
* @IsOptional과 조합 시: null은 할당, undefined는 skip.
|
|
25
|
-
* @IsDefined와 조합 시: Case 3과 동일 (추가 효과 없음).
|
|
26
|
-
*/
|
|
27
|
-
export declare function IsNullable(_options?: ValidationOptions): PropertyDecorator;
|
|
28
|
-
/** value === comparison (strict equality) */
|
|
29
|
-
export declare function Equals(comparison: unknown, options?: ValidationOptions): PropertyDecorator;
|
|
30
|
-
/** value !== comparison (strict inequality) */
|
|
31
|
-
export declare function NotEquals(comparison: unknown, options?: ValidationOptions): PropertyDecorator;
|
|
32
|
-
/** value === undefined | null | '' */
|
|
33
|
-
export declare function IsEmpty(options?: ValidationOptions): PropertyDecorator;
|
|
34
|
-
/** value !== undefined && value !== null && value !== '' */
|
|
35
|
-
export declare function IsNotEmpty(options?: ValidationOptions): PropertyDecorator;
|
|
36
|
-
/** array.indexOf(value) !== -1 */
|
|
37
|
-
export declare function IsIn(array: readonly unknown[], options?: ValidationOptions): PropertyDecorator;
|
|
38
|
-
/** array.indexOf(value) === -1 */
|
|
39
|
-
export declare function IsNotIn(array: readonly unknown[], options?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ValidationOptions } from '../interfaces';
|
|
2
|
-
/** value >= date (inclusive, getTime 비교) */
|
|
3
|
-
export declare function MinDate(date: Date, options?: ValidationOptions): PropertyDecorator;
|
|
4
|
-
/** value <= date (inclusive, getTime 비교) */
|
|
5
|
-
export declare function MaxDate(date: Date, options?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ValidationOptions } from '../interfaces';
|
|
2
|
-
/** 로케일별 모바일 전화번호 */
|
|
3
|
-
export declare function IsMobilePhone(locale: string, options?: ValidationOptions): PropertyDecorator;
|
|
4
|
-
/** 로케일별 우편번호 */
|
|
5
|
-
export declare function IsPostalCode(locale: string, options?: ValidationOptions): PropertyDecorator;
|
|
6
|
-
/** 로케일별 신분증 번호 */
|
|
7
|
-
export declare function IsIdentityCard(locale: string, options?: ValidationOptions): PropertyDecorator;
|
|
8
|
-
/** 로케일별 여권 번호 */
|
|
9
|
-
export declare function IsPassportNumber(locale: string, options?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface NestedOptions {
|
|
2
|
-
discriminator?: {
|
|
3
|
-
property: string;
|
|
4
|
-
subTypes: {
|
|
5
|
-
value: Function;
|
|
6
|
-
name: string;
|
|
7
|
-
}[];
|
|
8
|
-
};
|
|
9
|
-
keepDiscriminatorProperty?: boolean;
|
|
10
|
-
each?: boolean;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @Type(() => X) + @ValidateNested() 통합.
|
|
14
|
-
*
|
|
15
|
-
* discriminator + each 동시 사용 시 SealError throw.
|
|
16
|
-
*/
|
|
17
|
-
export declare function Nested(typeFn: () => new (...args: any[]) => any, options?: NestedOptions): PropertyDecorator;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ValidationOptions } from '../interfaces';
|
|
2
|
-
/** value >= n (exclusive: true → value > n) */
|
|
3
|
-
export declare function Min(n: number, options?: ValidationOptions & {
|
|
4
|
-
exclusive?: boolean;
|
|
5
|
-
}): PropertyDecorator;
|
|
6
|
-
/** value <= n (exclusive: true → value < n) */
|
|
7
|
-
export declare function Max(n: number, options?: ValidationOptions & {
|
|
8
|
-
exclusive?: boolean;
|
|
9
|
-
}): PropertyDecorator;
|
|
10
|
-
/** value > 0 */
|
|
11
|
-
export declare function IsPositive(options?: ValidationOptions): PropertyDecorator;
|
|
12
|
-
/** value < 0 */
|
|
13
|
-
export declare function IsNegative(options?: ValidationOptions): PropertyDecorator;
|
|
14
|
-
/** value % n === 0 */
|
|
15
|
-
export declare function IsDivisibleBy(n: number, options?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IsNotEmptyObjectOptions } from '../rules/object';
|
|
2
|
-
import type { ValidationOptions } from '../interfaces';
|
|
3
|
-
/**
|
|
4
|
-
* 빈 객체가 아님 (최소 1개의 key).
|
|
5
|
-
* nullable: true이면 null/undefined 값을 가진 키를 무시.
|
|
6
|
-
*/
|
|
7
|
-
export declare function IsNotEmptyObject(objectOptions?: IsNotEmptyObjectOptions, options?: ValidationOptions): PropertyDecorator;
|
|
8
|
-
/** value instanceof targetType */
|
|
9
|
-
export declare function IsInstance(targetType: new (...args: any[]) => any, options?: ValidationOptions): PropertyDecorator;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { JsonSchema202012 } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* 객체 리터럴: ClassDecorator & PropertyDecorator.
|
|
4
|
-
* 프로퍼티 레벨에서는 자동 매핑 결과를 오버라이드/보충.
|
|
5
|
-
* 클래스 레벨에서는 루트 스키마에 title, description, $id 등 병합.
|
|
6
|
-
*/
|
|
7
|
-
export declare function Schema(schema: JsonSchema202012): ClassDecorator & PropertyDecorator;
|
|
8
|
-
/**
|
|
9
|
-
* 함수형: PropertyDecorator 전용.
|
|
10
|
-
* `auto` 파라미터로 자동 매핑 결과를 받아 완전한 제어 가능.
|
|
11
|
-
* toJsonSchema() 호출 시점에 실행된다 (데코레이터 시점이 아님).
|
|
12
|
-
*/
|
|
13
|
-
export declare function Schema(fn: (auto: JsonSchema202012) => JsonSchema202012): PropertyDecorator;
|