diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/alias.ts b/packages/unplugin-typia/tests/fixtures/__snapshots__/alias.ts index ac0d5974..8a542169 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/alias.ts +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/alias.ts @@ -1,83 +1,67 @@ +import * as __typia_transform__isFormatEmail from "typia/lib/internal/_isFormatEmail.js"; +import * as __typia_transform__isFormatUuid from "typia/lib/internal/_isFormatUuid.js"; +import * as __typia_transform__isTypeUint32 from "typia/lib/internal/_isTypeUint32.js"; +import * as __typia_transform__randomFormatEmail from "typia/lib/internal/_randomFormatEmail.js"; +import * as __typia_transform__randomFormatUuid from "typia/lib/internal/_randomFormatUuid.js"; +import * as __typia_transform__randomInteger from "typia/lib/internal/_randomInteger.js"; +import * as __typia_transform__validateReport from "typia/lib/internal/_validateReport.js"; import type { IMember } from '@/type.js'; import typia from 'typia'; -const is = (() => { const $io0 = (input: any): boolean => "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) && ("string" === typeof input.id && /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id)) && ("number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 && 19 < input.age && input.age <= 100)); return (input: any): input is IMember => "object" === typeof input && null !== input && $io0(input); })(); -const random = (() => { const $generator = (typia.createRandom as any).generator; const $ro0 = (_recursive: boolean = false, _depth: number = 0): any => ({ - email: (_generator?.customs ?? $generator.customs)?.string?.([ - { - name: "Format<\"email\">", - kind: "format", - value: "email" - } - ]) ?? (_generator?.email ?? $generator.email)(), - id: (_generator?.customs ?? $generator.customs)?.string?.([ - { - name: "Format<\"uuid\">", - kind: "format", - value: "uuid" - } - ]) ?? (_generator?.uuid ?? $generator.uuid)(), - age: (_generator?.customs ?? $generator.customs)?.number?.([ - { - name: "Type<\"uint32\">", - kind: "type", - value: "uint32" - }, - { - name: "ExclusiveMinimum<19>", - kind: "exclusiveMinimum", - value: 19 - }, - { - name: "Maximum<100>", - kind: "maximum", - value: 100 - } - ]) ?? (_generator?.integer ?? $generator.integer)(20, 100) -}); let _generator: any; return (generator?: Partial): import("typia").Resolved => { +const is = (() => { const _io0 = (input: any): boolean => "string" === typeof input.email && __typia_transform__isFormatEmail._isFormatEmail(input.email) && ("string" === typeof input.id && __typia_transform__isFormatUuid._isFormatUuid(input.id)) && ("number" === typeof input.age && (__typia_transform__isTypeUint32._isTypeUint32(input.age) && 19 < input.age && input.age <= 100)); return (input: any): input is IMember => "object" === typeof input && null !== input && _io0(input); })(); +const random = (() => { const _ro0 = (_recursive: boolean = false, _depth: number = 0): any => ({ + email: (_generator?.email ?? __typia_transform__randomFormatEmail._randomFormatEmail)(), + id: (_generator?.uuid ?? __typia_transform__randomFormatUuid._randomFormatUuid)(), + age: (_generator?.integer ?? __typia_transform__randomInteger._randomInteger)({ + type: "integer", + exclusiveMinimum: true, + minimum: 19, + maximum: 100 + }) +}); let _generator: Partial | undefined; return (generator?: Partial): import("typia").Resolved => { _generator = generator; - return $ro0(); + return _ro0(); }; })(); -const validate = (() => { const $io0 = (input: any): boolean => "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) && ("string" === typeof input.id && /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id)) && ("number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 && 19 < input.age && input.age <= 100)); const $vo0 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["string" === typeof input.email && (/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) || $report(_exceptionable, { +const validate = (() => { const _io0 = (input: any): boolean => "string" === typeof input.email && __typia_transform__isFormatEmail._isFormatEmail(input.email) && ("string" === typeof input.id && __typia_transform__isFormatUuid._isFormatUuid(input.id)) && ("number" === typeof input.age && (__typia_transform__isTypeUint32._isTypeUint32(input.age) && 19 < input.age && input.age <= 100)); const _vo0 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["string" === typeof input.email && (__typia_transform__isFormatEmail._isFormatEmail(input.email) || _report(_exceptionable, { path: _path + ".email", expected: "string & Format<\"email\">", value: input.email - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".email", expected: "(string & Format<\"email\">)", value: input.email - }), "string" === typeof input.id && (/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id) || $report(_exceptionable, { + }), "string" === typeof input.id && (__typia_transform__isFormatUuid._isFormatUuid(input.id) || _report(_exceptionable, { path: _path + ".id", expected: "string & Format<\"uuid\">", value: input.id - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".id", expected: "(string & Format<\"uuid\">)", value: input.id - }), "number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 || $report(_exceptionable, { + }), "number" === typeof input.age && (__typia_transform__isTypeUint32._isTypeUint32(input.age) || _report(_exceptionable, { path: _path + ".age", expected: "number & Type<\"uint32\">", value: input.age - })) && (19 < input.age || $report(_exceptionable, { + })) && (19 < input.age || _report(_exceptionable, { path: _path + ".age", expected: "number & ExclusiveMinimum<19>", value: input.age - })) && (input.age <= 100 || $report(_exceptionable, { + })) && (input.age <= 100 || _report(_exceptionable, { path: _path + ".age", expected: "number & Maximum<100>", value: input.age - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".age", expected: "(number & Type<\"uint32\"> & ExclusiveMinimum<19> & Maximum<100>)", value: input.age - })].every((flag: boolean) => flag); const __is = (input: any): input is IMember => "object" === typeof input && null !== input && $io0(input); let errors: any; let $report: any; return (input: any): typia.IValidation => { + })].every((flag: boolean) => flag); const __is = (input: any): input is IMember => "object" === typeof input && null !== input && _io0(input); let errors: any; let _report: any; return (input: any): import("typia").IValidation => { if (false === __is(input)) { errors = []; - $report = (typia.createValidate as any).report(errors); - ((input: any, _path: string, _exceptionable: boolean = true) => ("object" === typeof input && null !== input || $report(true, { + _report = (__typia_transform__validateReport._validateReport as any)(errors); + ((input: any, _path: string, _exceptionable: boolean = true) => ("object" === typeof input && null !== input || _report(true, { path: _path + "", expected: "IMember", value: input - })) && $vo0(input, _path + "", true) || $report(true, { + })) && _vo0(input, _path + "", true) || _report(true, { path: _path + "", expected: "IMember", value: input diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/alias.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/alias.js index b896ecf9..26b9673a 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/alias.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/alias.js @@ -1,4 +1,4 @@ -import typia from "typia"; +import * as __typia_transform__validateReport from "typia/lib/internal/_validateReport.js"; const is = /* @__PURE__ */ (() => { return (input) => true; })(); @@ -12,11 +12,11 @@ const random = /* @__PURE__ */ (() => { const validate = /* @__PURE__ */ (() => { const __is = (input) => true; let errors; - let $report; + let _report; return (input) => { if (false === __is(input)) { errors = []; - $report = typia.createValidate.report(errors); + _report = __typia_transform__validateReport._validateReport(errors); /* @__PURE__ */ ((input2, _path, _exceptionable = true) => true)(input, "$input", true); const success = 0 === errors.length; return { diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/is.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/is.js index 69ce862a..adfbec39 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/is.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/is.js @@ -1,5 +1,8 @@ +import * as __typia_transform__isFormatEmail from "typia/lib/internal/_isFormatEmail.js"; +import * as __typia_transform__isFormatUuid from "typia/lib/internal/_isFormatUuid.js"; +import * as __typia_transform__isTypeUint32 from "typia/lib/internal/_isTypeUint32.js"; const is = /* @__PURE__ */ (() => { - const $io0 = (input) => "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) && ("string" === typeof input.id && /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id)) && ("number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 && 19 < input.age && input.age <= 100)); - return (input) => "object" === typeof input && null !== input && $io0(input); + const _io0 = (input) => "string" === typeof input.email && __typia_transform__isFormatEmail._isFormatEmail(input.email) && ("string" === typeof input.id && __typia_transform__isFormatUuid._isFormatUuid(input.id)) && ("number" === typeof input.age && (__typia_transform__isTypeUint32._isTypeUint32(input.age) && 19 < input.age && input.age <= 100)); + return (input) => "object" === typeof input && null !== input && _io0(input); })(); is({}); diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/random.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/random.js index 00d46d1f..3cbed8b1 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/random.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/random.js @@ -1,43 +1,21 @@ -import typia from "typia"; -const random = (() => { - const $generator = typia.createRandom.generator; - const $ro0 = (_recursive = false, _depth = 0) => ({ - email: (_generator?.customs ?? $generator.customs)?.string?.([ - { - name: 'Format<"email">', - kind: "format", - value: "email" - } - ]) ?? (_generator?.email ?? $generator.email)(), - id: (_generator?.customs ?? $generator.customs)?.string?.([ - { - name: 'Format<"uuid">', - kind: "format", - value: "uuid" - } - ]) ?? (_generator?.uuid ?? $generator.uuid)(), - age: (_generator?.customs ?? $generator.customs)?.number?.([ - { - name: 'Type<"uint32">', - kind: "type", - value: "uint32" - }, - { - name: "ExclusiveMinimum<19>", - kind: "exclusiveMinimum", - value: 19 - }, - { - name: "Maximum<100>", - kind: "maximum", - value: 100 - } - ]) ?? (_generator?.integer ?? $generator.integer)(20, 100) +import * as __typia_transform__randomFormatEmail from "typia/lib/internal/_randomFormatEmail.js"; +import * as __typia_transform__randomFormatUuid from "typia/lib/internal/_randomFormatUuid.js"; +import * as __typia_transform__randomInteger from "typia/lib/internal/_randomInteger.js"; +const random = /* @__PURE__ */ (() => { + const _ro0 = (_recursive = false, _depth = 0) => ({ + email: (_generator?.email ?? __typia_transform__randomFormatEmail._randomFormatEmail)(), + id: (_generator?.uuid ?? __typia_transform__randomFormatUuid._randomFormatUuid)(), + age: (_generator?.integer ?? __typia_transform__randomInteger._randomInteger)({ + type: "integer", + exclusiveMinimum: true, + minimum: 19, + maximum: 100 + }) }); let _generator; return (generator) => { _generator = generator; - return $ro0(); + return _ro0(); }; })(); random(); diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/validate.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/validate.js index eb844603..2d0b97fe 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/validate.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/validate.js @@ -1,51 +1,54 @@ -import typia from "typia"; +import * as __typia_transform__isFormatEmail from "typia/lib/internal/_isFormatEmail.js"; +import * as __typia_transform__isFormatUuid from "typia/lib/internal/_isFormatUuid.js"; +import * as __typia_transform__isTypeUint32 from "typia/lib/internal/_isTypeUint32.js"; +import * as __typia_transform__validateReport from "typia/lib/internal/_validateReport.js"; const validate = /* @__PURE__ */ (() => { - const $io0 = (input) => "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) && ("string" === typeof input.id && /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id)) && ("number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 && 19 < input.age && input.age <= 100)); - const $vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.email && (/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) || $report(_exceptionable, { + const _io0 = (input) => "string" === typeof input.email && __typia_transform__isFormatEmail._isFormatEmail(input.email) && ("string" === typeof input.id && __typia_transform__isFormatUuid._isFormatUuid(input.id)) && ("number" === typeof input.age && (__typia_transform__isTypeUint32._isTypeUint32(input.age) && 19 < input.age && input.age <= 100)); + const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.email && (__typia_transform__isFormatEmail._isFormatEmail(input.email) || _report(_exceptionable, { path: _path + ".email", expected: 'string & Format<"email">', value: input.email - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".email", expected: '(string & Format<"email">)', value: input.email - }), "string" === typeof input.id && (/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id) || $report(_exceptionable, { + }), "string" === typeof input.id && (__typia_transform__isFormatUuid._isFormatUuid(input.id) || _report(_exceptionable, { path: _path + ".id", expected: 'string & Format<"uuid">', value: input.id - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".id", expected: '(string & Format<"uuid">)', value: input.id - }), "number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 || $report(_exceptionable, { + }), "number" === typeof input.age && (__typia_transform__isTypeUint32._isTypeUint32(input.age) || _report(_exceptionable, { path: _path + ".age", expected: 'number & Type<"uint32">', value: input.age - })) && (19 < input.age || $report(_exceptionable, { + })) && (19 < input.age || _report(_exceptionable, { path: _path + ".age", expected: "number & ExclusiveMinimum<19>", value: input.age - })) && (input.age <= 100 || $report(_exceptionable, { + })) && (input.age <= 100 || _report(_exceptionable, { path: _path + ".age", expected: "number & Maximum<100>", value: input.age - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".age", expected: '(number & Type<"uint32"> & ExclusiveMinimum<19> & Maximum<100>)', value: input.age })].every((flag) => flag); - const __is = (input) => "object" === typeof input && null !== input && $io0(input); + const __is = (input) => "object" === typeof input && null !== input && _io0(input); let errors; - let $report; + let _report; return (input) => { if (false === __is(input)) { errors = []; - $report = typia.createValidate.report(errors); - ((input2, _path, _exceptionable = true) => ("object" === typeof input2 && null !== input2 || $report(true, { + _report = __typia_transform__validateReport._validateReport(errors); + ((input2, _path, _exceptionable = true) => ("object" === typeof input2 && null !== input2 || _report(true, { path: _path + "", expected: "IMember", value: input2 - })) && $vo0(input2, _path + "", true) || $report(true, { + })) && _vo0(input2, _path + "", true) || _report(true, { path: _path + "", expected: "IMember", value: input2 diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/is.ts b/packages/unplugin-typia/tests/fixtures/__snapshots__/is.ts index 4d70e445..26974b89 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/is.ts +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/is.ts @@ -1,4 +1,7 @@ +import * as __typia_transform__isFormatEmail from "typia/lib/internal/_isFormatEmail.js"; +import * as __typia_transform__isFormatUuid from "typia/lib/internal/_isFormatUuid.js"; +import * as __typia_transform__isTypeUint32 from "typia/lib/internal/_isTypeUint32.js"; import typia from 'typia'; import type { IMember } from './type.js'; -const is = (() => { const $io0 = (input: any): boolean => "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) && ("string" === typeof input.id && /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id)) && ("number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 && 19 < input.age && input.age <= 100)); return (input: any): input is IMember => "object" === typeof input && null !== input && $io0(input); })(); +const is = (() => { const _io0 = (input: any): boolean => "string" === typeof input.email && __typia_transform__isFormatEmail._isFormatEmail(input.email) && ("string" === typeof input.id && __typia_transform__isFormatUuid._isFormatUuid(input.id)) && ("number" === typeof input.age && (__typia_transform__isTypeUint32._isTypeUint32(input.age) && 19 < input.age && input.age <= 100)); return (input: any): input is IMember => "object" === typeof input && null !== input && _io0(input); })(); is({}); diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/random.ts b/packages/unplugin-typia/tests/fixtures/__snapshots__/random.ts index 54c2c0bb..c78edf7d 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/random.ts +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/random.ts @@ -1,39 +1,19 @@ +import * as __typia_transform__randomFormatEmail from "typia/lib/internal/_randomFormatEmail.js"; +import * as __typia_transform__randomFormatUuid from "typia/lib/internal/_randomFormatUuid.js"; +import * as __typia_transform__randomInteger from "typia/lib/internal/_randomInteger.js"; import typia from 'typia'; import type { IMember } from './type.js'; -const random = (() => { const $generator = (typia.createRandom as any).generator; const $ro0 = (_recursive: boolean = false, _depth: number = 0): any => ({ - email: (_generator?.customs ?? $generator.customs)?.string?.([ - { - name: "Format<\"email\">", - kind: "format", - value: "email" - } - ]) ?? (_generator?.email ?? $generator.email)(), - id: (_generator?.customs ?? $generator.customs)?.string?.([ - { - name: "Format<\"uuid\">", - kind: "format", - value: "uuid" - } - ]) ?? (_generator?.uuid ?? $generator.uuid)(), - age: (_generator?.customs ?? $generator.customs)?.number?.([ - { - name: "Type<\"uint32\">", - kind: "type", - value: "uint32" - }, - { - name: "ExclusiveMinimum<19>", - kind: "exclusiveMinimum", - value: 19 - }, - { - name: "Maximum<100>", - kind: "maximum", - value: 100 - } - ]) ?? (_generator?.integer ?? $generator.integer)(20, 100) -}); let _generator: any; return (generator?: Partial): import("typia").Resolved => { +const random = (() => { const _ro0 = (_recursive: boolean = false, _depth: number = 0): any => ({ + email: (_generator?.email ?? __typia_transform__randomFormatEmail._randomFormatEmail)(), + id: (_generator?.uuid ?? __typia_transform__randomFormatUuid._randomFormatUuid)(), + age: (_generator?.integer ?? __typia_transform__randomInteger._randomInteger)({ + type: "integer", + exclusiveMinimum: true, + minimum: 19, + maximum: 100 + }) +}); let _generator: Partial | undefined; return (generator?: Partial): import("typia").Resolved => { _generator = generator; - return $ro0(); + return _ro0(); }; })(); random(); diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/alias.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/alias.js index 13483461..9fded5a7 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/alias.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/alias.js @@ -1,5 +1,5 @@ // alias.js -import typia from 'typia'; +import * as __typia_transform__validateReport from 'typia/lib/internal/_validateReport.js'; const random = /* @__PURE__ */ (() => { let _generator; @@ -14,7 +14,7 @@ const validate = /* @__PURE__ */ (() => { return (input) => { if (false === __is()) { errors = []; - typia.createValidate.report(errors); + __typia_transform__validateReport._validateReport(errors); const success = 0 === errors.length; return { success, diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/is.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/is.js index d87b6bd5..14a5665d 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/is.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/is.js @@ -1,6 +1,10 @@ // is.js +import * as __typia_transform__isFormatEmail from 'typia/lib/internal/_isFormatEmail.js'; +import * as __typia_transform__isFormatUuid from 'typia/lib/internal/_isFormatUuid.js'; +import * as __typia_transform__isTypeUint32 from 'typia/lib/internal/_isTypeUint32.js'; + const is = /* @__PURE__ */ (() => { - const $io0 = (input) => "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) && ("string" === typeof input.id && /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id)) && ("number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 && 19 < input.age && input.age <= 100)); - return (input) => "object" === typeof input && null !== input && $io0(input); + const _io0 = (input) => "string" === typeof input.email && __typia_transform__isFormatEmail._isFormatEmail(input.email) && ("string" === typeof input.id && __typia_transform__isFormatUuid._isFormatUuid(input.id)) && ("number" === typeof input.age && (__typia_transform__isTypeUint32._isTypeUint32(input.age) && 19 < input.age && input.age <= 100)); + return (input) => "object" === typeof input && null !== input && _io0(input); })(); is({}); diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/random.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/random.js index 5dd0bc9e..f264f644 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/random.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/random.js @@ -1,45 +1,23 @@ // random.js -import typia from 'typia'; +import * as __typia_transform__randomFormatEmail from 'typia/lib/internal/_randomFormatEmail.js'; +import * as __typia_transform__randomFormatUuid from 'typia/lib/internal/_randomFormatUuid.js'; +import * as __typia_transform__randomInteger from 'typia/lib/internal/_randomInteger.js'; -const random = (() => { - const $generator = typia.createRandom.generator; - const $ro0 = (_recursive = false, _depth = 0) => ({ - email: (_generator?.customs ?? $generator.customs)?.string?.([ - { - name: 'Format<"email">', - kind: "format", - value: "email" - } - ]) ?? (_generator?.email ?? $generator.email)(), - id: (_generator?.customs ?? $generator.customs)?.string?.([ - { - name: 'Format<"uuid">', - kind: "format", - value: "uuid" - } - ]) ?? (_generator?.uuid ?? $generator.uuid)(), - age: (_generator?.customs ?? $generator.customs)?.number?.([ - { - name: 'Type<"uint32">', - kind: "type", - value: "uint32" - }, - { - name: "ExclusiveMinimum<19>", - kind: "exclusiveMinimum", - value: 19 - }, - { - name: "Maximum<100>", - kind: "maximum", - value: 100 - } - ]) ?? (_generator?.integer ?? $generator.integer)(20, 100) +const random = /* @__PURE__ */ (() => { + const _ro0 = (_recursive = false, _depth = 0) => ({ + email: (_generator?.email ?? __typia_transform__randomFormatEmail._randomFormatEmail)(), + id: (_generator?.uuid ?? __typia_transform__randomFormatUuid._randomFormatUuid)(), + age: (_generator?.integer ?? __typia_transform__randomInteger._randomInteger)({ + type: "integer", + exclusiveMinimum: true, + minimum: 19, + maximum: 100 + }) }); let _generator; return (generator) => { _generator = generator; - return $ro0(); + return _ro0(); }; })(); random(); diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/validate.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/validate.js index f35aa117..3fea3afb 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/validate.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/validate.js @@ -1,53 +1,56 @@ // validate.js -import typia from 'typia'; +import * as __typia_transform__isFormatEmail from 'typia/lib/internal/_isFormatEmail.js'; +import * as __typia_transform__isFormatUuid from 'typia/lib/internal/_isFormatUuid.js'; +import * as __typia_transform__isTypeUint32 from 'typia/lib/internal/_isTypeUint32.js'; +import * as __typia_transform__validateReport from 'typia/lib/internal/_validateReport.js'; const validate = /* @__PURE__ */ (() => { - const $io0 = (input) => "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) && ("string" === typeof input.id && /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id)) && ("number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 && 19 < input.age && input.age <= 100)); - const $vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.email && (/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) || $report(_exceptionable, { + const _io0 = (input) => "string" === typeof input.email && __typia_transform__isFormatEmail._isFormatEmail(input.email) && ("string" === typeof input.id && __typia_transform__isFormatUuid._isFormatUuid(input.id)) && ("number" === typeof input.age && (__typia_transform__isTypeUint32._isTypeUint32(input.age) && 19 < input.age && input.age <= 100)); + const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.email && (__typia_transform__isFormatEmail._isFormatEmail(input.email) || _report(_exceptionable, { path: _path + ".email", expected: 'string & Format<"email">', value: input.email - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".email", expected: '(string & Format<"email">)', value: input.email - }), "string" === typeof input.id && (/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id) || $report(_exceptionable, { + }), "string" === typeof input.id && (__typia_transform__isFormatUuid._isFormatUuid(input.id) || _report(_exceptionable, { path: _path + ".id", expected: 'string & Format<"uuid">', value: input.id - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".id", expected: '(string & Format<"uuid">)', value: input.id - }), "number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 || $report(_exceptionable, { + }), "number" === typeof input.age && (__typia_transform__isTypeUint32._isTypeUint32(input.age) || _report(_exceptionable, { path: _path + ".age", expected: 'number & Type<"uint32">', value: input.age - })) && (19 < input.age || $report(_exceptionable, { + })) && (19 < input.age || _report(_exceptionable, { path: _path + ".age", expected: "number & ExclusiveMinimum<19>", value: input.age - })) && (input.age <= 100 || $report(_exceptionable, { + })) && (input.age <= 100 || _report(_exceptionable, { path: _path + ".age", expected: "number & Maximum<100>", value: input.age - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".age", expected: '(number & Type<"uint32"> & ExclusiveMinimum<19> & Maximum<100>)', value: input.age })].every((flag) => flag); - const __is = (input) => "object" === typeof input && null !== input && $io0(input); + const __is = (input) => "object" === typeof input && null !== input && _io0(input); let errors; - let $report; + let _report; return (input) => { if (false === __is(input)) { errors = []; - $report = typia.createValidate.report(errors); - ((input2, _path, _exceptionable = true) => ("object" === typeof input2 && null !== input2 || $report(true, { + _report = __typia_transform__validateReport._validateReport(errors); + ((input2, _path, _exceptionable = true) => ("object" === typeof input2 && null !== input2 || _report(true, { path: _path + "", expected: "IMember", value: input2 - })) && $vo0(input2, _path + "", true) || $report(true, { + })) && _vo0(input2, _path + "", true) || _report(true, { path: _path + "", expected: "IMember", value: input2 diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/validate.ts b/packages/unplugin-typia/tests/fixtures/__snapshots__/validate.ts index 39d9db81..c675e946 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/validate.ts +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/validate.ts @@ -1,46 +1,50 @@ +import * as __typia_transform__isFormatEmail from "typia/lib/internal/_isFormatEmail.js"; +import * as __typia_transform__isFormatUuid from "typia/lib/internal/_isFormatUuid.js"; +import * as __typia_transform__isTypeUint32 from "typia/lib/internal/_isTypeUint32.js"; +import * as __typia_transform__validateReport from "typia/lib/internal/_validateReport.js"; import typia from 'typia'; import type { IMember } from './type.js'; -const validate = (() => { const $io0 = (input: any): boolean => "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) && ("string" === typeof input.id && /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id)) && ("number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 && 19 < input.age && input.age <= 100)); const $vo0 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["string" === typeof input.email && (/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) || $report(_exceptionable, { +const validate = (() => { const _io0 = (input: any): boolean => "string" === typeof input.email && __typia_transform__isFormatEmail._isFormatEmail(input.email) && ("string" === typeof input.id && __typia_transform__isFormatUuid._isFormatUuid(input.id)) && ("number" === typeof input.age && (__typia_transform__isTypeUint32._isTypeUint32(input.age) && 19 < input.age && input.age <= 100)); const _vo0 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["string" === typeof input.email && (__typia_transform__isFormatEmail._isFormatEmail(input.email) || _report(_exceptionable, { path: _path + ".email", expected: "string & Format<\"email\">", value: input.email - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".email", expected: "(string & Format<\"email\">)", value: input.email - }), "string" === typeof input.id && (/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id) || $report(_exceptionable, { + }), "string" === typeof input.id && (__typia_transform__isFormatUuid._isFormatUuid(input.id) || _report(_exceptionable, { path: _path + ".id", expected: "string & Format<\"uuid\">", value: input.id - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".id", expected: "(string & Format<\"uuid\">)", value: input.id - }), "number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 || $report(_exceptionable, { + }), "number" === typeof input.age && (__typia_transform__isTypeUint32._isTypeUint32(input.age) || _report(_exceptionable, { path: _path + ".age", expected: "number & Type<\"uint32\">", value: input.age - })) && (19 < input.age || $report(_exceptionable, { + })) && (19 < input.age || _report(_exceptionable, { path: _path + ".age", expected: "number & ExclusiveMinimum<19>", value: input.age - })) && (input.age <= 100 || $report(_exceptionable, { + })) && (input.age <= 100 || _report(_exceptionable, { path: _path + ".age", expected: "number & Maximum<100>", value: input.age - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".age", expected: "(number & Type<\"uint32\"> & ExclusiveMinimum<19> & Maximum<100>)", value: input.age - })].every((flag: boolean) => flag); const __is = (input: any): input is IMember => "object" === typeof input && null !== input && $io0(input); let errors: any; let $report: any; return (input: any): typia.IValidation => { + })].every((flag: boolean) => flag); const __is = (input: any): input is IMember => "object" === typeof input && null !== input && _io0(input); let errors: any; let _report: any; return (input: any): import("typia").IValidation => { if (false === __is(input)) { errors = []; - $report = (typia.createValidate as any).report(errors); - ((input: any, _path: string, _exceptionable: boolean = true) => ("object" === typeof input && null !== input || $report(true, { + _report = (__typia_transform__validateReport._validateReport as any)(errors); + ((input: any, _path: string, _exceptionable: boolean = true) => ("object" === typeof input && null !== input || _report(true, { path: _path + "", expected: "IMember", value: input - })) && $vo0(input, _path + "", true) || $report(true, { + })) && _vo0(input, _path + "", true) || _report(true, { path: _path + "", expected: "IMember", value: input diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/alias.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/alias.js index 28723f17..dd0e5fcf 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/alias.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/alias.js @@ -1,99 +1,237 @@ -import typia from "typia"; -const is = /* @__PURE__ */ (() => { - const $io0 = (input) => "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) && ("string" === typeof input.id && /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id)) && ("number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 && 19 < input.age && input.age <= 100)); - return (input) => "object" === typeof input && null !== input && $io0(input); -})(); -const random = (() => { - const $generator = typia.createRandom.generator; - const $ro0 = (_recursive = false, _depth = 0) => { - var _a, _b, _c, _d, _e, _f; - return { - email: ((_b = (_a = (_generator == null ? void 0 : _generator.customs) ?? $generator.customs) == null ? void 0 : _a.string) == null ? void 0 : _b.call(_a, [ - { - name: 'Format<"email">', - kind: "format", - value: "email" - } - ])) ?? ((_generator == null ? void 0 : _generator.email) ?? $generator.email)(), - id: ((_d = (_c = (_generator == null ? void 0 : _generator.customs) ?? $generator.customs) == null ? void 0 : _c.string) == null ? void 0 : _d.call(_c, [ - { - name: 'Format<"uuid">', - kind: "format", - value: "uuid" - } - ])) ?? ((_generator == null ? void 0 : _generator.uuid) ?? $generator.uuid)(), - age: ((_f = (_e = (_generator == null ? void 0 : _generator.customs) ?? $generator.customs) == null ? void 0 : _e.number) == null ? void 0 : _f.call(_e, [ - { - name: 'Type<"uint32">', - kind: "type", - value: "uint32" - }, - { - name: "ExclusiveMinimum<19>", - kind: "exclusiveMinimum", - value: 19 - }, - { - name: "Maximum<100>", - kind: "maximum", - value: 100 - } - ])) ?? ((_generator == null ? void 0 : _generator.integer) ?? $generator.integer)(20, 100) +var _isFormatEmail = {}; +var hasRequired_isFormatEmail; +function require_isFormatEmail() { + if (hasRequired_isFormatEmail) return _isFormatEmail; + hasRequired_isFormatEmail = 1; + Object.defineProperty(_isFormatEmail, "__esModule", { value: true }); + _isFormatEmail._isFormatEmail = void 0; + const _isFormatEmail$1 = (str) => PATTERN.test(str); + _isFormatEmail._isFormatEmail = _isFormatEmail$1; + const PATTERN = /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i; + return _isFormatEmail; +} +var _isFormatEmailExports = /* @__PURE__ */ require_isFormatEmail(); +var _isFormatUuid = {}; +var hasRequired_isFormatUuid; +function require_isFormatUuid() { + if (hasRequired_isFormatUuid) return _isFormatUuid; + hasRequired_isFormatUuid = 1; + Object.defineProperty(_isFormatUuid, "__esModule", { value: true }); + _isFormatUuid._isFormatUuid = void 0; + const _isFormatUuid$1 = (str) => PATTERN.test(str); + _isFormatUuid._isFormatUuid = _isFormatUuid$1; + const PATTERN = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; + return _isFormatUuid; +} +var _isFormatUuidExports = /* @__PURE__ */ require_isFormatUuid(); +var _isTypeUint32 = {}; +var hasRequired_isTypeUint32; +function require_isTypeUint32() { + if (hasRequired_isTypeUint32) return _isTypeUint32; + hasRequired_isTypeUint32 = 1; + Object.defineProperty(_isTypeUint32, "__esModule", { value: true }); + _isTypeUint32._isTypeUint32 = void 0; + const _isTypeUint32$1 = (value) => Math.floor(value) === value && MINIMUM <= value && value <= MAXIMUM; + _isTypeUint32._isTypeUint32 = _isTypeUint32$1; + const MINIMUM = 0; + const MAXIMUM = Math.pow(2, 32) - 1; + return _isTypeUint32; +} +var _isTypeUint32Exports = /* @__PURE__ */ require_isTypeUint32(); +var _randomFormatEmail = {}; +var _randomString = {}; +var _randomInteger = {}; +var hasRequired_randomInteger; +function require_randomInteger() { + if (hasRequired_randomInteger) return _randomInteger; + hasRequired_randomInteger = 1; + Object.defineProperty(_randomInteger, "__esModule", { value: true }); + _randomInteger._randomInteger = void 0; + const _randomInteger$1 = (props) => { + var _a, _b, _c, _d; + let minimum = (_a = props.minimum) !== null && _a !== void 0 ? _a : ((_b = props.multipleOf) !== null && _b !== void 0 ? _b : 1) * (props.maximum === void 0 ? 0 : props.maximum - 100); + if (props.minimum !== void 0 && props.exclusiveMinimum === true) + minimum++; + let maximum = (_c = props.maximum) !== null && _c !== void 0 ? _c : ((_d = props.multipleOf) !== null && _d !== void 0 ? _d : 1) * (props.minimum === void 0 ? 100 : props.minimum + 100); + if (props.maximum !== void 0 && props.exclusiveMaximum === true) + maximum--; + if (minimum > maximum) + throw new Error("Minimum value is greater than maximum value."); + return props.multipleOf === void 0 ? scalar({ + minimum, + maximum + }) : multiple({ + minimum, + maximum, + multipleOf: props.multipleOf + }); + }; + _randomInteger._randomInteger = _randomInteger$1; + const scalar = (p) => Math.floor(Math.random() * (p.maximum - p.minimum + 1)) + p.minimum; + const multiple = (p) => { + const minimum = Math.ceil(p.minimum / p.multipleOf) * p.multipleOf; + const maximum = Math.floor(p.maximum / p.multipleOf) * p.multipleOf; + if (minimum > maximum) + throw new Error("The range of the integer is smaller than the multipleOf value."); + const value = scalar({ + minimum, + maximum + }); + return value - value % p.multipleOf; + }; + return _randomInteger; +} +var hasRequired_randomString; +function require_randomString() { + if (hasRequired_randomString) return _randomString; + hasRequired_randomString = 1; + Object.defineProperty(_randomString, "__esModule", { value: true }); + _randomString._randomString = void 0; + const _randomInteger_1 = /* @__PURE__ */ require_randomInteger(); + const _randomString$1 = (props) => { + var _a; + const length = (0, _randomInteger_1._randomInteger)({ + type: "integer", + minimum: (_a = props.minLength) !== null && _a !== void 0 ? _a : 0, + maximum: props.maxLength + }); + return new Array(length).fill(0).map(() => ALPHABETS[random2()]).join(""); + }; + _randomString._randomString = _randomString$1; + const ALPHABETS = "abcdefghijklmnopqrstuvwxyz"; + const random2 = () => (0, _randomInteger_1._randomInteger)({ + type: "integer", + minimum: 0, + maximum: ALPHABETS.length - 1 + }); + return _randomString; +} +var hasRequired_randomFormatEmail; +function require_randomFormatEmail() { + if (hasRequired_randomFormatEmail) return _randomFormatEmail; + hasRequired_randomFormatEmail = 1; + Object.defineProperty(_randomFormatEmail, "__esModule", { value: true }); + _randomFormatEmail._randomFormatEmail = void 0; + const _randomString_1 = /* @__PURE__ */ require_randomString(); + const _randomFormatEmail$1 = () => `${random2(10)}@${random2(10)}.${random2(3)}`; + _randomFormatEmail._randomFormatEmail = _randomFormatEmail$1; + const random2 = (length) => (0, _randomString_1._randomString)({ + type: "string", + minLength: length, + maxLength: length + }); + return _randomFormatEmail; +} +var _randomFormatEmailExports = /* @__PURE__ */ require_randomFormatEmail(); +var _randomFormatUuid = {}; +var hasRequired_randomFormatUuid; +function require_randomFormatUuid() { + if (hasRequired_randomFormatUuid) return _randomFormatUuid; + hasRequired_randomFormatUuid = 1; + Object.defineProperty(_randomFormatUuid, "__esModule", { value: true }); + _randomFormatUuid._randomFormatUuid = void 0; + const _randomFormatUuid$1 = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => { + const r = Math.random() * 16 | 0; + const v = c === "x" ? r : r & 3 | 8; + return v.toString(16); + }); + _randomFormatUuid._randomFormatUuid = _randomFormatUuid$1; + return _randomFormatUuid; +} +var _randomFormatUuidExports = /* @__PURE__ */ require_randomFormatUuid(); +var _randomIntegerExports = /* @__PURE__ */ require_randomInteger(); +var _validateReport = {}; +var hasRequired_validateReport; +function require_validateReport() { + if (hasRequired_validateReport) return _validateReport; + hasRequired_validateReport = 1; + Object.defineProperty(_validateReport, "__esModule", { value: true }); + _validateReport._validateReport = void 0; + const _validateReport$1 = (array) => { + const reportable = (path) => { + if (array.length === 0) + return true; + const last = array[array.length - 1].path; + return path.length > last.length || last.substring(0, path.length) !== path; + }; + return (exceptable, error) => { + if (exceptable && reportable(error.path)) + array.push(error); + return false; }; }; + _validateReport._validateReport = _validateReport$1; + return _validateReport; +} +var _validateReportExports = /* @__PURE__ */ require_validateReport(); +const is = /* @__PURE__ */ (() => { + const _io0 = (input) => "string" === typeof input.email && _isFormatEmailExports._isFormatEmail(input.email) && ("string" === typeof input.id && _isFormatUuidExports._isFormatUuid(input.id)) && ("number" === typeof input.age && (_isTypeUint32Exports._isTypeUint32(input.age) && 19 < input.age && input.age <= 100)); + return (input) => "object" === typeof input && null !== input && _io0(input); +})(); +const random = /* @__PURE__ */ (() => { + const _ro0 = (_recursive = false, _depth = 0) => ({ + email: ((_generator == null ? void 0 : _generator.email) ?? _randomFormatEmailExports._randomFormatEmail)(), + id: ((_generator == null ? void 0 : _generator.uuid) ?? _randomFormatUuidExports._randomFormatUuid)(), + age: ((_generator == null ? void 0 : _generator.integer) ?? _randomIntegerExports._randomInteger)({ + type: "integer", + exclusiveMinimum: true, + minimum: 19, + maximum: 100 + }) + }); let _generator; return (generator) => { _generator = generator; - return $ro0(); + return _ro0(); }; })(); const validate = /* @__PURE__ */ (() => { - const $io0 = (input) => "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) && ("string" === typeof input.id && /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id)) && ("number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 && 19 < input.age && input.age <= 100)); - const $vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.email && (/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) || $report(_exceptionable, { + const _io0 = (input) => "string" === typeof input.email && _isFormatEmailExports._isFormatEmail(input.email) && ("string" === typeof input.id && _isFormatUuidExports._isFormatUuid(input.id)) && ("number" === typeof input.age && (_isTypeUint32Exports._isTypeUint32(input.age) && 19 < input.age && input.age <= 100)); + const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.email && (_isFormatEmailExports._isFormatEmail(input.email) || _report(_exceptionable, { path: _path + ".email", expected: 'string & Format<"email">', value: input.email - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".email", expected: '(string & Format<"email">)', value: input.email - }), "string" === typeof input.id && (/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id) || $report(_exceptionable, { + }), "string" === typeof input.id && (_isFormatUuidExports._isFormatUuid(input.id) || _report(_exceptionable, { path: _path + ".id", expected: 'string & Format<"uuid">', value: input.id - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".id", expected: '(string & Format<"uuid">)', value: input.id - }), "number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 || $report(_exceptionable, { + }), "number" === typeof input.age && (_isTypeUint32Exports._isTypeUint32(input.age) || _report(_exceptionable, { path: _path + ".age", expected: 'number & Type<"uint32">', value: input.age - })) && (19 < input.age || $report(_exceptionable, { + })) && (19 < input.age || _report(_exceptionable, { path: _path + ".age", expected: "number & ExclusiveMinimum<19>", value: input.age - })) && (input.age <= 100 || $report(_exceptionable, { + })) && (input.age <= 100 || _report(_exceptionable, { path: _path + ".age", expected: "number & Maximum<100>", value: input.age - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".age", expected: '(number & Type<"uint32"> & ExclusiveMinimum<19> & Maximum<100>)', value: input.age })].every((flag) => flag); - const __is = (input) => "object" === typeof input && null !== input && $io0(input); + const __is = (input) => "object" === typeof input && null !== input && _io0(input); let errors; - let $report; + let _report; return (input) => { if (false === __is(input)) { errors = []; - $report = typia.createValidate.report(errors); - ((input2, _path, _exceptionable = true) => ("object" === typeof input2 && null !== input2 || $report(true, { + _report = _validateReportExports._validateReport(errors); + ((input2, _path, _exceptionable = true) => ("object" === typeof input2 && null !== input2 || _report(true, { path: _path + "", expected: "IMember", value: input2 - })) && $vo0(input2, _path + "", true) || $report(true, { + })) && _vo0(input2, _path + "", true) || _report(true, { path: _path + "", expected: "IMember", value: input2 diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/is.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/is.js index 69ce862a..4f6df48f 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/is.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/is.js @@ -1,5 +1,45 @@ +var _isFormatEmail = {}; +var hasRequired_isFormatEmail; +function require_isFormatEmail() { + if (hasRequired_isFormatEmail) return _isFormatEmail; + hasRequired_isFormatEmail = 1; + Object.defineProperty(_isFormatEmail, "__esModule", { value: true }); + _isFormatEmail._isFormatEmail = void 0; + const _isFormatEmail$1 = (str) => PATTERN.test(str); + _isFormatEmail._isFormatEmail = _isFormatEmail$1; + const PATTERN = /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i; + return _isFormatEmail; +} +var _isFormatEmailExports = /* @__PURE__ */ require_isFormatEmail(); +var _isFormatUuid = {}; +var hasRequired_isFormatUuid; +function require_isFormatUuid() { + if (hasRequired_isFormatUuid) return _isFormatUuid; + hasRequired_isFormatUuid = 1; + Object.defineProperty(_isFormatUuid, "__esModule", { value: true }); + _isFormatUuid._isFormatUuid = void 0; + const _isFormatUuid$1 = (str) => PATTERN.test(str); + _isFormatUuid._isFormatUuid = _isFormatUuid$1; + const PATTERN = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; + return _isFormatUuid; +} +var _isFormatUuidExports = /* @__PURE__ */ require_isFormatUuid(); +var _isTypeUint32 = {}; +var hasRequired_isTypeUint32; +function require_isTypeUint32() { + if (hasRequired_isTypeUint32) return _isTypeUint32; + hasRequired_isTypeUint32 = 1; + Object.defineProperty(_isTypeUint32, "__esModule", { value: true }); + _isTypeUint32._isTypeUint32 = void 0; + const _isTypeUint32$1 = (value) => Math.floor(value) === value && MINIMUM <= value && value <= MAXIMUM; + _isTypeUint32._isTypeUint32 = _isTypeUint32$1; + const MINIMUM = 0; + const MAXIMUM = Math.pow(2, 32) - 1; + return _isTypeUint32; +} +var _isTypeUint32Exports = /* @__PURE__ */ require_isTypeUint32(); const is = /* @__PURE__ */ (() => { - const $io0 = (input) => "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) && ("string" === typeof input.id && /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id)) && ("number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 && 19 < input.age && input.age <= 100)); - return (input) => "object" === typeof input && null !== input && $io0(input); + const _io0 = (input) => "string" === typeof input.email && _isFormatEmailExports._isFormatEmail(input.email) && ("string" === typeof input.id && _isFormatUuidExports._isFormatUuid(input.id)) && ("number" === typeof input.age && (_isTypeUint32Exports._isTypeUint32(input.age) && 19 < input.age && input.age <= 100)); + return (input) => "object" === typeof input && null !== input && _io0(input); })(); is({}); diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/random.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/random.js index 60cb68df..88285d52 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/random.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/random.js @@ -1,46 +1,120 @@ -import typia from "typia"; -const random = (() => { - const $generator = typia.createRandom.generator; - const $ro0 = (_recursive = false, _depth = 0) => { - var _a, _b, _c, _d, _e, _f; - return { - email: ((_b = (_a = (_generator == null ? void 0 : _generator.customs) ?? $generator.customs) == null ? void 0 : _a.string) == null ? void 0 : _b.call(_a, [ - { - name: 'Format<"email">', - kind: "format", - value: "email" - } - ])) ?? ((_generator == null ? void 0 : _generator.email) ?? $generator.email)(), - id: ((_d = (_c = (_generator == null ? void 0 : _generator.customs) ?? $generator.customs) == null ? void 0 : _c.string) == null ? void 0 : _d.call(_c, [ - { - name: 'Format<"uuid">', - kind: "format", - value: "uuid" - } - ])) ?? ((_generator == null ? void 0 : _generator.uuid) ?? $generator.uuid)(), - age: ((_f = (_e = (_generator == null ? void 0 : _generator.customs) ?? $generator.customs) == null ? void 0 : _e.number) == null ? void 0 : _f.call(_e, [ - { - name: 'Type<"uint32">', - kind: "type", - value: "uint32" - }, - { - name: "ExclusiveMinimum<19>", - kind: "exclusiveMinimum", - value: 19 - }, - { - name: "Maximum<100>", - kind: "maximum", - value: 100 - } - ])) ?? ((_generator == null ? void 0 : _generator.integer) ?? $generator.integer)(20, 100) - }; +var _randomFormatEmail = {}; +var _randomString = {}; +var _randomInteger = {}; +var hasRequired_randomInteger; +function require_randomInteger() { + if (hasRequired_randomInteger) return _randomInteger; + hasRequired_randomInteger = 1; + Object.defineProperty(_randomInteger, "__esModule", { value: true }); + _randomInteger._randomInteger = void 0; + const _randomInteger$1 = (props) => { + var _a, _b, _c, _d; + let minimum = (_a = props.minimum) !== null && _a !== void 0 ? _a : ((_b = props.multipleOf) !== null && _b !== void 0 ? _b : 1) * (props.maximum === void 0 ? 0 : props.maximum - 100); + if (props.minimum !== void 0 && props.exclusiveMinimum === true) + minimum++; + let maximum = (_c = props.maximum) !== null && _c !== void 0 ? _c : ((_d = props.multipleOf) !== null && _d !== void 0 ? _d : 1) * (props.minimum === void 0 ? 100 : props.minimum + 100); + if (props.maximum !== void 0 && props.exclusiveMaximum === true) + maximum--; + if (minimum > maximum) + throw new Error("Minimum value is greater than maximum value."); + return props.multipleOf === void 0 ? scalar({ + minimum, + maximum + }) : multiple({ + minimum, + maximum, + multipleOf: props.multipleOf + }); }; + _randomInteger._randomInteger = _randomInteger$1; + const scalar = (p) => Math.floor(Math.random() * (p.maximum - p.minimum + 1)) + p.minimum; + const multiple = (p) => { + const minimum = Math.ceil(p.minimum / p.multipleOf) * p.multipleOf; + const maximum = Math.floor(p.maximum / p.multipleOf) * p.multipleOf; + if (minimum > maximum) + throw new Error("The range of the integer is smaller than the multipleOf value."); + const value = scalar({ + minimum, + maximum + }); + return value - value % p.multipleOf; + }; + return _randomInteger; +} +var hasRequired_randomString; +function require_randomString() { + if (hasRequired_randomString) return _randomString; + hasRequired_randomString = 1; + Object.defineProperty(_randomString, "__esModule", { value: true }); + _randomString._randomString = void 0; + const _randomInteger_1 = /* @__PURE__ */ require_randomInteger(); + const _randomString$1 = (props) => { + var _a; + const length = (0, _randomInteger_1._randomInteger)({ + type: "integer", + minimum: (_a = props.minLength) !== null && _a !== void 0 ? _a : 0, + maximum: props.maxLength + }); + return new Array(length).fill(0).map(() => ALPHABETS[random2()]).join(""); + }; + _randomString._randomString = _randomString$1; + const ALPHABETS = "abcdefghijklmnopqrstuvwxyz"; + const random2 = () => (0, _randomInteger_1._randomInteger)({ + type: "integer", + minimum: 0, + maximum: ALPHABETS.length - 1 + }); + return _randomString; +} +var hasRequired_randomFormatEmail; +function require_randomFormatEmail() { + if (hasRequired_randomFormatEmail) return _randomFormatEmail; + hasRequired_randomFormatEmail = 1; + Object.defineProperty(_randomFormatEmail, "__esModule", { value: true }); + _randomFormatEmail._randomFormatEmail = void 0; + const _randomString_1 = /* @__PURE__ */ require_randomString(); + const _randomFormatEmail$1 = () => `${random2(10)}@${random2(10)}.${random2(3)}`; + _randomFormatEmail._randomFormatEmail = _randomFormatEmail$1; + const random2 = (length) => (0, _randomString_1._randomString)({ + type: "string", + minLength: length, + maxLength: length + }); + return _randomFormatEmail; +} +var _randomFormatEmailExports = /* @__PURE__ */ require_randomFormatEmail(); +var _randomFormatUuid = {}; +var hasRequired_randomFormatUuid; +function require_randomFormatUuid() { + if (hasRequired_randomFormatUuid) return _randomFormatUuid; + hasRequired_randomFormatUuid = 1; + Object.defineProperty(_randomFormatUuid, "__esModule", { value: true }); + _randomFormatUuid._randomFormatUuid = void 0; + const _randomFormatUuid$1 = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => { + const r = Math.random() * 16 | 0; + const v = c === "x" ? r : r & 3 | 8; + return v.toString(16); + }); + _randomFormatUuid._randomFormatUuid = _randomFormatUuid$1; + return _randomFormatUuid; +} +var _randomFormatUuidExports = /* @__PURE__ */ require_randomFormatUuid(); +var _randomIntegerExports = /* @__PURE__ */ require_randomInteger(); +const random = /* @__PURE__ */ (() => { + const _ro0 = (_recursive = false, _depth = 0) => ({ + email: ((_generator == null ? void 0 : _generator.email) ?? _randomFormatEmailExports._randomFormatEmail)(), + id: ((_generator == null ? void 0 : _generator.uuid) ?? _randomFormatUuidExports._randomFormatUuid)(), + age: ((_generator == null ? void 0 : _generator.integer) ?? _randomIntegerExports._randomInteger)({ + type: "integer", + exclusiveMinimum: true, + minimum: 19, + maximum: 100 + }) + }); let _generator; return (generator) => { _generator = generator; - return $ro0(); + return _ro0(); }; })(); random(); diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/validate.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/validate.js index eb844603..a4a35424 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/validate.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/validate.js @@ -1,51 +1,114 @@ -import typia from "typia"; +var _isFormatEmail = {}; +var hasRequired_isFormatEmail; +function require_isFormatEmail() { + if (hasRequired_isFormatEmail) return _isFormatEmail; + hasRequired_isFormatEmail = 1; + Object.defineProperty(_isFormatEmail, "__esModule", { value: true }); + _isFormatEmail._isFormatEmail = void 0; + const _isFormatEmail$1 = (str) => PATTERN.test(str); + _isFormatEmail._isFormatEmail = _isFormatEmail$1; + const PATTERN = /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i; + return _isFormatEmail; +} +var _isFormatEmailExports = /* @__PURE__ */ require_isFormatEmail(); +var _isFormatUuid = {}; +var hasRequired_isFormatUuid; +function require_isFormatUuid() { + if (hasRequired_isFormatUuid) return _isFormatUuid; + hasRequired_isFormatUuid = 1; + Object.defineProperty(_isFormatUuid, "__esModule", { value: true }); + _isFormatUuid._isFormatUuid = void 0; + const _isFormatUuid$1 = (str) => PATTERN.test(str); + _isFormatUuid._isFormatUuid = _isFormatUuid$1; + const PATTERN = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; + return _isFormatUuid; +} +var _isFormatUuidExports = /* @__PURE__ */ require_isFormatUuid(); +var _isTypeUint32 = {}; +var hasRequired_isTypeUint32; +function require_isTypeUint32() { + if (hasRequired_isTypeUint32) return _isTypeUint32; + hasRequired_isTypeUint32 = 1; + Object.defineProperty(_isTypeUint32, "__esModule", { value: true }); + _isTypeUint32._isTypeUint32 = void 0; + const _isTypeUint32$1 = (value) => Math.floor(value) === value && MINIMUM <= value && value <= MAXIMUM; + _isTypeUint32._isTypeUint32 = _isTypeUint32$1; + const MINIMUM = 0; + const MAXIMUM = Math.pow(2, 32) - 1; + return _isTypeUint32; +} +var _isTypeUint32Exports = /* @__PURE__ */ require_isTypeUint32(); +var _validateReport = {}; +var hasRequired_validateReport; +function require_validateReport() { + if (hasRequired_validateReport) return _validateReport; + hasRequired_validateReport = 1; + Object.defineProperty(_validateReport, "__esModule", { value: true }); + _validateReport._validateReport = void 0; + const _validateReport$1 = (array) => { + const reportable = (path) => { + if (array.length === 0) + return true; + const last = array[array.length - 1].path; + return path.length > last.length || last.substring(0, path.length) !== path; + }; + return (exceptable, error) => { + if (exceptable && reportable(error.path)) + array.push(error); + return false; + }; + }; + _validateReport._validateReport = _validateReport$1; + return _validateReport; +} +var _validateReportExports = /* @__PURE__ */ require_validateReport(); const validate = /* @__PURE__ */ (() => { - const $io0 = (input) => "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) && ("string" === typeof input.id && /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id)) && ("number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 && 19 < input.age && input.age <= 100)); - const $vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.email && (/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) || $report(_exceptionable, { + const _io0 = (input) => "string" === typeof input.email && _isFormatEmailExports._isFormatEmail(input.email) && ("string" === typeof input.id && _isFormatUuidExports._isFormatUuid(input.id)) && ("number" === typeof input.age && (_isTypeUint32Exports._isTypeUint32(input.age) && 19 < input.age && input.age <= 100)); + const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.email && (_isFormatEmailExports._isFormatEmail(input.email) || _report(_exceptionable, { path: _path + ".email", expected: 'string & Format<"email">', value: input.email - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".email", expected: '(string & Format<"email">)', value: input.email - }), "string" === typeof input.id && (/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id) || $report(_exceptionable, { + }), "string" === typeof input.id && (_isFormatUuidExports._isFormatUuid(input.id) || _report(_exceptionable, { path: _path + ".id", expected: 'string & Format<"uuid">', value: input.id - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".id", expected: '(string & Format<"uuid">)', value: input.id - }), "number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 || $report(_exceptionable, { + }), "number" === typeof input.age && (_isTypeUint32Exports._isTypeUint32(input.age) || _report(_exceptionable, { path: _path + ".age", expected: 'number & Type<"uint32">', value: input.age - })) && (19 < input.age || $report(_exceptionable, { + })) && (19 < input.age || _report(_exceptionable, { path: _path + ".age", expected: "number & ExclusiveMinimum<19>", value: input.age - })) && (input.age <= 100 || $report(_exceptionable, { + })) && (input.age <= 100 || _report(_exceptionable, { path: _path + ".age", expected: "number & Maximum<100>", value: input.age - })) || $report(_exceptionable, { + })) || _report(_exceptionable, { path: _path + ".age", expected: '(number & Type<"uint32"> & ExclusiveMinimum<19> & Maximum<100>)', value: input.age })].every((flag) => flag); - const __is = (input) => "object" === typeof input && null !== input && $io0(input); + const __is = (input) => "object" === typeof input && null !== input && _io0(input); let errors; - let $report; + let _report; return (input) => { if (false === __is(input)) { errors = []; - $report = typia.createValidate.report(errors); - ((input2, _path, _exceptionable = true) => ("object" === typeof input2 && null !== input2 || $report(true, { + _report = _validateReportExports._validateReport(errors); + ((input2, _path, _exceptionable = true) => ("object" === typeof input2 && null !== input2 || _report(true, { path: _path + "", expected: "IMember", value: input2 - })) && $vo0(input2, _path + "", true) || $report(true, { + })) && _vo0(input2, _path + "", true) || _report(true, { path: _path + "", expected: "IMember", value: input2