generated from unplugin/unplugin-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
572 additions
and
317 deletions.
There are no files selected for viewing
78 changes: 31 additions & 47 deletions
78
packages/unplugin-typia/tests/fixtures/__snapshots__/alias.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/is.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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({}); |
50 changes: 14 additions & 36 deletions
50
packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/random.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); |
33 changes: 18 additions & 15 deletions
33
packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/validate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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({}); |
Oops, something went wrong.