Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@deepkit/type

deepkit32.7kMIT1.0.5TypeScript support: included

@deepkit/type, the fastest universal TypeScript serializer and validator with JIT engine for frontend, backend, http-transport, RPC, and database, with built-in validations, for Browser/NodeJS.

readme







Discord npm CI

Deepkit Framework is a new high-performance and real-time TypeScript framework for enterprise TypeScript applications. Standalone TypeScript libraries and a framework that brings everything together.

Docs

Check out the Deepkit Documentation to get started.

Getting started

To create a Deepkit app with Deepkit Framework from scratch, you can use NPM init:

npm init @deepkit/app@latest my-deepkit-app

Community Packages

Examples

Contributing

If you are interested in contributing to the development of Deepkit, check out the Development Docs to learn more about setting up your local development environment.

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.0.5 (2025-04-02)

Features

  • run: new @deepkit/run package to run typescript easily (0b9246e)

1.0.3 (2025-03-13)

Features

  • rpc: automatically garbage collect observables + new event system + stats collection (d727232)

1.0.2 (2025-02-24)

Bug Fixes

  • type-compiler: make sure not annotated properties get unknown as type (b262534)

1.0.1 (2025-02-24)

Note: Version bump only for package @deepkit/type

1.0.1-alpha.160 (2025-02-18)

Bug Fixes

  • type: make typeAnnotation backwards compatible to metaAnnotation (8be8b5e)

1.0.1-alpha.158 (2025-02-15)

Note: Version bump only for package @deepkit/type

1.0.1-alpha.157 (2025-02-15)

Bug Fixes

  • tsconfig and tsc build (ac71e83)
  • type: convert TypeAnnotation into intrinsic type (#629) (4d1a13e), closes #626
  • type: ensure union check in deserialize mode to handle property with default value correctly (11c2116), closes #623
  • type: remove debug code (fefd9a3)

Features

  • type-compiler: support trivially inferred types (087b60a)
  • update to angular 19 and typescript 5.7.3, new @deepkit/angular-ssr package (#627) (52333a7)

1.0.1-alpha.156 (2025-01-30)

Bug Fixes

  • type: make sure forwarded type arguments reset Ω at the origin (3138671), closes #619

1.0.1-alpha.155 (2024-10-30)

Bug Fixes

  • type: add executeTypeArgumentAsArray + custom iterable example with manual implementation (0781a1a)
  • type: symbols as method names (2be4ce6)

1.0.1-alpha.154 (2024-09-06)

Bug Fixes

  • type: add scope in setter code to prevent variable already declared #603 (#606) (9af344f)

Features

  • type: support enum in pathResolver/resolvePath (78d7df0)

1.0.1-alpha.153 (2024-06-06)

Bug Fixes

  • orm: correctly resolve reference class schemas (e193325)

Features

  • orm: support passing type to Database.persistAs/Database.removeAs, DatabaseSession.addAs (6679aba), closes #571
  • type: automatically assign .path to SerializationError in TemplateState.convert() errors (23781a1)

1.0.1-alpha.151 (2024-05-14)

Features

1.0.1-alpha.150 (2024-05-09)

Bug Fixes

  • rpc: ensure data is not chunked twice in server->client controllers (6c59f9b)
  • type-compiler: support ReceiveType in arrow function with body expression (3c66064)

Features

  • type-compiler: allow to use T from ReceiveType<T> in function body as type reference (4d24c8b), closes #565

1.0.1-alpha.149 (2024-05-07)

Bug Fixes

  • type-compiler: make sure type reference resolving skips parameter names (16ba17d), closes #566

1.0.1-alpha.148 (2024-05-04)

Features

  • type: new TemplateState.touch and isTypeClassOf (cdf3272)
  • type: support lower/mixed case as identifier for enum values (ce0166e)
  • type: support mixed case enum member in union resolver (96dd2d8)

1.0.1-alpha.147 (2024-05-04)

Bug Fixes

  • type: make sure handled constructor properties are not set twice (2e82eb6)
  • type: resolve global classes as shallow TypeClass (d976024)

1.0.1-alpha.146 (2024-04-17)

Note: Version bump only for package @deepkit/type

1.0.1-alpha.145 (2024-04-08)

Bug Fixes

  • type guard handing of empty Map/Set (da4cf82)

1.0.1-alpha.143 (2024-03-17)

Bug Fixes

  • type: union expansions in intersections (332b26e), closes #556

1.0.1-alpha.142 (2024-03-06)

Note: Version bump only for package @deepkit/type

1.0.1-alpha.141 (2024-03-05)

Bug Fixes

  • type: handle Function correctly in type comparisons (16f0c1d)

1.0.1-alpha.140 (2024-03-02)

Features

  • sql: support per-field name remapping (63b8aaf)

1.0.1-alpha.139 (2024-02-29)

Bug Fixes

  • type: better error message when fast path type resolution fails due to undefined symbols (0ef082d)

1.0.1-alpha.138 (2024-02-27)

Bug Fixes

  • type: make sure methods are not part of deserialization/type guard union resolver (eb08a73)

1.0.1-alpha.137 (2024-02-26)

Bug Fixes

  • type: correctly type guard null in optional properties (c0adcb0)

1.0.1-alpha.132 (2024-02-10)

Bug Fixes

  • type: intersection of two different primitive types always return never (#549) (20d3dc8)

1.0.1-alpha.131 (2024-02-09)

Bug Fixes

  • type: make sure cast<string> throws when null/undefined is passed (1bb3641)

1.0.1-alpha.124 (2024-02-04)

Bug Fixes

  • type: handle more circular types (5f6bd12), closes #477

1.0.1-alpha.123 (2024-02-02)

Note: Version bump only for package @deepkit/type

1.0.1-alpha.121 (2024-01-31)

Note: Version bump only for package @deepkit/type

1.0.1-alpha.120 (2024-01-29)

Features

  • type: preserve modifiers in homomorphic mapped types (f2091d0), closes #515 #514

1.0.1-alpha.119 (2024-01-28)

Features

  • type: provide parent types in serializer template state (d65dfc0)

1.0.1-alpha.117 (2024-01-26)

Bug Fixes

  • type: correct type guard (272cff9)

Features

  • type-compiler: support local export syntax + improve logging (993cffa)

1.0.1-alpha.116 (2024-01-22)

Features

  • type: refactor typeName embedding (48a2994)

1.0.1-alpha.114 (2024-01-21)

Note: Version bump only for package @deepkit/type

1.0.1-alpha.113 (2024-01-17)

Note: Version bump only for package @deepkit/type

1.0.1-alpha.112 (2024-01-16)

Features

1.0.1-alpha.111 (2024-01-15)

Features

  • type: add new fast path to resolveReceiveType and made it 5x faster on average use case. (45d656c)

1.0.1-alpha.110 (2024-01-11)

Note: Version bump only for package @deepkit/type

1.0.1-alpha.109 (2024-01-10)

Bug Fixes

  • http: use default values of route parameters if no http value was provided. (fa74d16), closes #529
  • orm: snapshot type any correctly (4898e9b)
  • type-compiler: arrow function receive type (#521) (6bfb246)
  • type: make serializer API consistent (5870005)

1.0.1-alpha.108 (2023-11-21)

Bug Fixes

  • injector: make sure type cache is used when finding matching provider. (8c79e4b)
  • type: correctly check X extends Date and print validation errors with caused value. (fde795e)
  • type: correctly materialize Promise in runtime checks. (aa66460), closes #495
  • type: make sure typeof x expression doesn't return the original type (7206e7e)
  • type: make sure inline returns a ref to the correct type program (dc5d6dd)

Features

  • type-compiler: emit typeName for type only imports (#501) (318d091)

1.0.1-alpha.105 (2023-10-23)

Bug Fixes

  • type: do not interfere with type checking when intersecting multiple type annotations. (af85f1f)
  • type: test (c335466)