Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
samchon authored May 25, 2024
2 parents a116c4a + 34a94c6 commit fe14467
Show file tree
Hide file tree
Showing 28 changed files with 244 additions and 3,356 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Root Install
run: npm install
- name: Build
working-directory: website
run: npm install && npm run build
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Typia is a transformer library supporting below features:
- Protocol Buffer encoder and decoder
- Random data generator

> **Note**
>
> [!NOTE]
>
> - **Only one line** required, with pure TypeScript type
> - Runtime validator is **20,000x faster** than `class-validator`
> - JSON serialization is **200x faster** than `class-transformer`
Expand Down Expand Up @@ -92,6 +92,7 @@ Check out the document in the [website](https://typia.io/docs/):
- [Miscellaneous](https://typia.io/docs/misc/)

### 🔗 Appendix
- [API Documents](https://typia.io/api)
- Utillization Cases
- [NestJS](https://typia.io/docs/utilization/nestjs/)
- [Prisma](https://typia.io/docs/utilization/prisma/)
Expand Down
6 changes: 3 additions & 3 deletions benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"source-map-support": "^0.5.21",
"suppress-warnings": "^1.0.2",
"tstl": "^3.0.0",
"typia": "D:\\github\\samchon\\typia\\typia-6.0.3.tgz",
"uuid": "^9.0.1"
"uuid": "^9.0.1",
"typia": "../typia-6.0.4.tgz"
}
}
}
5 changes: 1 addition & 4 deletions deploy/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import chalk from "chalk";
import cp from "child_process";
import fs from "fs";
import path from "path";

import { ReplicaPublisher } from "./internal/ReplicaPublisher";

Expand Down Expand Up @@ -57,9 +56,7 @@ const test =

const pack: any = JSON.parse(fs.readFileSync("package.json", "utf8"));
pack.dependencies ??= {};
pack.dependencies.typia = path.resolve(
`${__dirname}/../typia-${version}.tgz`,
);
pack.dependencies.typia = `../typia-${version}.tgz`;
fs.writeFileSync("package.json", JSON.stringify(pack, null, 2), "utf8");

if (commands.length) {
Expand Down
2 changes: 1 addition & 1 deletion errors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"typescript": "^5.3.2"
},
"dependencies": {
"typia": "D:\\github\\samchon\\typia\\typia-6.0.3.tgz"
"typia": "../typia-6.0.4.tgz"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typia",
"version": "6.0.3",
"version": "6.0.4",
"description": "Superfast runtime validators with only one line",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -65,7 +65,7 @@
},
"homepage": "https://typia.io",
"dependencies": {
"@samchon/openapi": "^0.1.20",
"@samchon/openapi": "^0.1.21",
"commander": "^10.0.0",
"comment-json": "^4.2.3",
"inquirer": "^8.2.5",
Expand Down
5 changes: 3 additions & 2 deletions packages/typescript-json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Typia is a transformer library supporting below features:
- Protocol Buffer encoder and decoder
- Random data generator

> **Note**
>
> [!NOTE]
>
> - **Only one line** required, with pure TypeScript type
> - Runtime validator is **20,000x faster** than `class-validator`
> - JSON serialization is **200x faster** than `class-transformer`
Expand Down Expand Up @@ -95,6 +95,7 @@ Check out the document in the [website](https://typia.io/docs/):
- [Miscellaneous](https://typia.io/docs/misc/)

### 🔗 Appendix
- [API Documents](https://typia.io/api)
- Utillization Cases
- [NestJS](https://typia.io/docs/utilization/nestjs/)
- [Prisma](https://typia.io/docs/utilization/prisma/)
Expand Down
4 changes: 2 additions & 2 deletions packages/typescript-json/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typescript-json",
"version": "6.0.3",
"version": "6.0.4",
"description": "Superfast runtime validators with only one line",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -62,7 +62,7 @@
},
"homepage": "https://typia.io",
"dependencies": {
"typia": "6.0.3"
"typia": "6.0.4"
},
"peerDependencies": {
"typescript": ">=4.8.0 <5.5.0"
Expand Down
8 changes: 5 additions & 3 deletions src/tags/internal/FormatCheatSheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ export const FormatCheatSheet = {
),

// TIMESTAMPS
"date-time": `!isNaN(new Date($input).getTime())`,
date: RegexCall(`/^(\\d{4})-(\\d{2})-(\\d{2})$/`),
"date-time": RegexCall(
`/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(T|\\s)([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\\.[0-9]{1,9})?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$/i`,
),
date: RegexCall(`/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/`),
time: RegexCall(
`/^(\\d\\d):(\\d\\d):(\\d\\d(?:\\.\\d+)?)(z|([+-])(\\d\\d)(?::?(\\d\\d))?)?$/i`,
`/^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\\.[0-9]{1,9})?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$/i`,
),
duration: RegexCall(
`/^P(?!$)((\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?|(\\d+W)?)$/`,
Expand Down
3 changes: 1 addition & 2 deletions src/utils/RandomGenerator/RandomGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ export const date = (min?: number, max?: number) =>
new Date(number(min ?? 0, max ?? Date.now() * 2))
.toISOString()
.substring(0, 10);
export const time = () =>
new Date(number(0, DAY)).toISOString().substring(11, 23);
export const time = () => new Date(number(0, DAY)).toISOString().substring(11);
export const duration = () => {
const period: string = durate([
["Y", integer(0, 100)],
Expand Down
4 changes: 2 additions & 2 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
"typescript": "^5.4.5"
},
"dependencies": {
"@samchon/openapi": "^0.1.19",
"@samchon/openapi": "^0.1.21",
"cli": "^1.0.1",
"protobufjs": "^7.2.5",
"randexp": "^0.5.3",
"source-map-support": "^0.5.21",
"suppress-warnings": "^1.0.2",
"tstl": "^3.0.0",
"uuid": "^9.0.1",
"typia": "D:\\github\\samchon\\typia\\typia-6.0.3.tgz"
"typia": "../typia-6.0.4.tgz"
}
}
6 changes: 3 additions & 3 deletions test/schemas/reflect/metadata/CommentTagFormat.json
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@
"name": "Format<\"date-time\">",
"kind": "format",
"value": "date-time",
"validate": "!isNaN(new Date($input).getTime())",
"validate": "/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(T|\\s)([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\\.[0-9]{1,9})?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$/i.test($input)",
"exclusive": true,
"schema": {
"format": "date-time"
Expand Down Expand Up @@ -1432,7 +1432,7 @@
"name": "Format<\"date\">",
"kind": "format",
"value": "date",
"validate": "/^(\\d{4})-(\\d{2})-(\\d{2})$/.test($input)",
"validate": "/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.test($input)",
"exclusive": true,
"schema": {
"format": "date"
Expand Down Expand Up @@ -1512,7 +1512,7 @@
"name": "Format<\"time\">",
"kind": "format",
"value": "time",
"validate": "/^(\\d\\d):(\\d\\d):(\\d\\d(?:\\.\\d+)?)(z|([+-])(\\d\\d)(?::?(\\d\\d))?)?$/i.test($input)",
"validate": "/^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\\.[0-9]{1,9})?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$/i.test($input)",
"exclusive": true,
"schema": {
"format": "time"
Expand Down
6 changes: 3 additions & 3 deletions test/schemas/reflect/metadata/ObjectDate.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
"name": "Format<\"date\">",
"kind": "format",
"value": "date",
"validate": "/^(\\d{4})-(\\d{2})-(\\d{2})$/.test($input)",
"validate": "/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.test($input)",
"exclusive": [
"format",
"pattern"
Expand Down Expand Up @@ -242,7 +242,7 @@
"name": "Format<\"date-time\">",
"kind": "format",
"value": "date-time",
"validate": "!isNaN(new Date($input).getTime())",
"validate": "/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(T|\\s)([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\\.[0-9]{1,9})?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$/i.test($input)",
"exclusive": [
"format",
"pattern"
Expand Down Expand Up @@ -315,7 +315,7 @@
"name": "Format<\"time\">",
"kind": "format",
"value": "time",
"validate": "/^(\\d\\d):(\\d\\d):(\\d\\d(?:\\.\\d+)?)(z|([+-])(\\d\\d)(?::?(\\d\\d))?)?$/i.test($input)",
"validate": "/^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\\.[0-9]{1,9})?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$/i.test($input)",
"exclusive": [
"format",
"pattern"
Expand Down
6 changes: 3 additions & 3 deletions test/schemas/reflect/metadata/TypeTagFormat.json
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@
"name": "Format<\"date-time\">",
"kind": "format",
"value": "date-time",
"validate": "!isNaN(new Date($input).getTime())",
"validate": "/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(T|\\s)([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\\.[0-9]{1,9})?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$/i.test($input)",
"exclusive": [
"format",
"pattern"
Expand Down Expand Up @@ -1313,7 +1313,7 @@
"name": "Format<\"date\">",
"kind": "format",
"value": "date",
"validate": "/^(\\d{4})-(\\d{2})-(\\d{2})$/.test($input)",
"validate": "/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.test($input)",
"exclusive": [
"format",
"pattern"
Expand Down Expand Up @@ -1386,7 +1386,7 @@
"name": "Format<\"time\">",
"kind": "format",
"value": "time",
"validate": "/^(\\d\\d):(\\d\\d):(\\d\\d(?:\\.\\d+)?)(z|([+-])(\\d\\d)(?::?(\\d\\d))?)?$/i.test($input)",
"validate": "/^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\\.[0-9]{1,9})?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$/i.test($input)",
"exclusive": [
"format",
"pattern"
Expand Down
2 changes: 1 addition & 1 deletion test/src/structures/ObjectDate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export namespace ObjectDate {
classDate: new Date(),
date: new Date().toISOString().substring(0, 10),
datetime: new Date().toISOString(),
time: new Date().toISOString().substring(11, 23),
time: new Date().toISOString().substring(11),
duration: TestRandomGenerator.duration(),
};
}
Expand Down
2 changes: 1 addition & 1 deletion test/src/structures/TypeTagFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export namespace TypeTagFormat {
// TIMESTAMPS
datetime: new Date().toISOString(),
date: new Date().toISOString().substring(0, 10),
time: new Date().toISOString().substring(11, 23),
time: new Date().toISOString().substring(11),
duration: TestRandomGenerator.duration(),
// POINTERS
jsonPointer: "/components/schemas/ObjectSimple.IPoint3D",
Expand Down
5 changes: 5 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ node_modules/
out/
raw/

public/api/
public/compilers/
public/robots.txt
public/sitemap*.xml

!package-lock.json
7 changes: 7 additions & 0 deletions website/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ const withNextra = require("nextra")({
/** @type {import('next').NextConfig} */
const config = {
...withNextra(),
output: "export",
exportTrailingSlash: true,
images: {
unoptimized: true,
},
rewrites: async () => [
{
source: "/api",
destination: "/api/index.html",
},
],
};
module.exports = config;
Loading

0 comments on commit fe14467

Please sign in to comment.