From 3f3cfded9f60e5a6cfd67a831cbb7b3c98aa3ec7 Mon Sep 17 00:00:00 2001 From: Lionel Date: Wed, 13 Mar 2024 19:54:32 +0100 Subject: [PATCH 1/4] fix(docs): modify broken reflection example --- .../pages/documentation/runtime-types/getting-started.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/src/pages/documentation/runtime-types/getting-started.md b/website/src/pages/documentation/runtime-types/getting-started.md index 058ba6402..5da7afffa 100644 --- a/website/src/pages/documentation/runtime-types/getting-started.md +++ b/website/src/pages/documentation/runtime-types/getting-started.md @@ -33,20 +33,20 @@ Write your first code with runtime type information: _File: app.ts_ ```typescript -import { cast, MinLength, ReflectionClass } from '@deepkit/type'; +import { cast, MinLength, ReflectionClass, typeOf } from '@deepkit/type'; interface User { username: string & MinLength<3>; birthDate?: Date; } -const user = cast(User, { +const user = cast({ username: 'Peter', birthDate: '2010-10-10T00:00:00Z' }); console.log(user); -const reflection = ReflectionClass.from(User); +const reflection = ReflectionClass.from(typeOf()); console.log(reflection.getProperty('username').type); ``` From d67e7c94cd1280cfb12a377ad3c743c874d71da3 Mon Sep 17 00:00:00 2001 From: Lionel Date: Thu, 11 Jul 2024 12:39:56 +0200 Subject: [PATCH 2/4] fix(docs): modify broken reflection example --- .../src/pages/documentation/runtime-types/getting-started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/pages/documentation/runtime-types/getting-started.md b/website/src/pages/documentation/runtime-types/getting-started.md index 5da7afffa..319576ae2 100644 --- a/website/src/pages/documentation/runtime-types/getting-started.md +++ b/website/src/pages/documentation/runtime-types/getting-started.md @@ -33,7 +33,7 @@ Write your first code with runtime type information: _File: app.ts_ ```typescript -import { cast, MinLength, ReflectionClass, typeOf } from '@deepkit/type'; +import { cast, MinLength, ReflectionClass } from '@deepkit/type'; interface User { username: string & MinLength<3>; @@ -46,7 +46,7 @@ const user = cast({ }); console.log(user); -const reflection = ReflectionClass.from(typeOf()); +const reflection = ReflectionClass.from(); console.log(reflection.getProperty('username').type); ``` From 766975ce2032d90bdf4ab6028fd0f6d118301213 Mon Sep 17 00:00:00 2001 From: Lionel Date: Thu, 11 Jul 2024 12:49:04 +0200 Subject: [PATCH 3/4] Revert "fix(docs): modify broken reflection example" This reverts commit d67e7c94cd1280cfb12a377ad3c743c874d71da3. --- .../src/pages/documentation/runtime-types/getting-started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/pages/documentation/runtime-types/getting-started.md b/website/src/pages/documentation/runtime-types/getting-started.md index 319576ae2..5da7afffa 100644 --- a/website/src/pages/documentation/runtime-types/getting-started.md +++ b/website/src/pages/documentation/runtime-types/getting-started.md @@ -33,7 +33,7 @@ Write your first code with runtime type information: _File: app.ts_ ```typescript -import { cast, MinLength, ReflectionClass } from '@deepkit/type'; +import { cast, MinLength, ReflectionClass, typeOf } from '@deepkit/type'; interface User { username: string & MinLength<3>; @@ -46,7 +46,7 @@ const user = cast({ }); console.log(user); -const reflection = ReflectionClass.from(); +const reflection = ReflectionClass.from(typeOf()); console.log(reflection.getProperty('username').type); ``` From ea4aa851011baf96f4acf3452299f9915ba902b2 Mon Sep 17 00:00:00 2001 From: Lionel Date: Thu, 11 Jul 2024 12:49:46 +0200 Subject: [PATCH 4/4] fix(website): modify broken reflection example --- .../src/pages/documentation/runtime-types/getting-started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/pages/documentation/runtime-types/getting-started.md b/website/src/pages/documentation/runtime-types/getting-started.md index 5da7afffa..319576ae2 100644 --- a/website/src/pages/documentation/runtime-types/getting-started.md +++ b/website/src/pages/documentation/runtime-types/getting-started.md @@ -33,7 +33,7 @@ Write your first code with runtime type information: _File: app.ts_ ```typescript -import { cast, MinLength, ReflectionClass, typeOf } from '@deepkit/type'; +import { cast, MinLength, ReflectionClass } from '@deepkit/type'; interface User { username: string & MinLength<3>; @@ -46,7 +46,7 @@ const user = cast({ }); console.log(user); -const reflection = ReflectionClass.from(typeOf()); +const reflection = ReflectionClass.from(); console.log(reflection.getProperty('username').type); ```