Skip to content

Commit

Permalink
Working well
Browse files Browse the repository at this point in the history
  • Loading branch information
samchon committed Dec 6, 2023
1 parent c196396 commit c20b9a0
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 9 deletions.
72 changes: 69 additions & 3 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
const typia_1 = __importDefault(require("typia"));
console.log((input => {
return "object" === typeof input && null !== input && ("number" === typeof input.id && "string" === typeof input.name);
return "object" === typeof input && null !== input && ("number" === typeof input.id && (Math.floor(input.id) === input.id && 0 <= input.id && input.id <= 4294967295 && 1 <= input.id) && ("string" === typeof input.name && 2 <= input.name.length));
}).toString(), JSON.stringify({
schemas: [
{
Expand All @@ -18,14 +18,80 @@ console.log((input => {
type: "object",
properties: {
id: {
description: "Primary Key.",
"x-typia-jsDocTags": [
{
name: "type",
text: [
{
text: "uint",
kind: "text"
}
]
},
{
name: "minimum",
text: [
{
text: "1",
kind: "text"
}
]
}
],
"x-typia-required": true,
"x-typia-optional": false,
type: "number"
type: "integer",
minimum: 1,
"x-typia-typeTags": [
{
target: "number",
name: "Type<\"uint32\">",
kind: "type",
value: "uint32",
validate: "Math.floor($input) === $input && 0 <= $input && $input <= 4294967295",
exclusive: true
},
{
target: "number",
name: "Minimum<1>",
kind: "minimum",
value: 1,
validate: "1 <= $input",
exclusive: [
"minimum",
"exclusiveMinimum"
]
}
]
},
name: {
description: "Name of the member.",
"x-typia-jsDocTags": [
{
name: "minLength",
text: [
{
text: "2",
kind: "text"
}
]
}
],
"x-typia-required": true,
"x-typia-optional": false,
type: "string"
type: "string",
minLength: 2,
"x-typia-typeTags": [
{
target: "string",
name: "MinLength<2>",
kind: "minLength",
value: 2,
validate: "2 <= $input.length",
exclusive: true
}
]
}
},
nullable: false,
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"license": "ISC",
"devDependencies": {
"ts-node": "^10.9.1",
"ts-patch": "^3.0.2",
"ts-patch": "^3.1.0",
"typescript": "^5.3.2",
"typescript-transform-paths": "^3.4.6",
"typia": "^5.3.4-dev.20231205"
Expand Down

0 comments on commit c20b9a0

Please sign in to comment.