MCPcopy Index your code
hub / github.com/samchon/typia

github.com/samchon/typia @v12.1.1

repository ↗ · DeepWiki ↗ · release v12.1.1 ↗ · + Follow
4,366 symbols 11,198 edges 2,227 files 122 documented · 3% 2 cross-repo links updated todayv12.1.1 · 2026-05-06★ 5,8473 open issues
README

Typia

Typia Logo

GitHub license NPM Version NPM Downloads Build Status Guide Documents Gurubase Discord Badge

// RUNTIME VALIDATORS
export function is<T>(input: unknown): input is T; // returns boolean
export function assert<T>(input: unknown): T; // throws TypeGuardError
export function assertGuard<T>(input: unknown): asserts input is T;
export function validate<T>(input: unknown): IValidation<T>; // detailed

// JSON FUNCTIONS
export namespace json {
  export function schema<T>(): IJsonSchemaUnit<T>; // JSON schema
  export function assertParse<T>(input: string): T; // type safe parser
  export function assertStringify<T>(input: T): string; // safe and faster
}

// AI FUNCTION CALLING HARNESS
export namespace llm {
  // collection of function calling schemas + validators/parsers
  export function application<Class>(): ILlmApplication<Class>;
  export function structuredOutput

(): ILlmStructuredOutput;
  // lenient json parser + type coercion
  export function parse<T>(str: string): T;
}

// PROTOCOL BUFFER
export namespace protobuf {
  export function message<T>(): string; // Protocol Buffer message
  export function assertDecode<T>(buffer: Uint8Array): T; // safe decoder
  export function assertEncode<T>(input: T): Uint8Array; // safe encoder
}

// RANDOM GENERATOR
export function random<T>(g?: Partial<IRandomGenerator>): T;

typia is a transformer library supporting below features:

  • Super-fast Runtime Validators
  • Enhanced JSON schema and serde functions
  • LLM function calling harness
  • Protocol Buffer encoder and decoder
  • Random data generator

[!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
  • LLM function calling harness turns 6.75% → 100% accuracy

Transformation

If you call typia function, it would be compiled like below.

This is the key concept of typia, transforming TypeScript type to a runtime function. The typia.is<T>() function is transformed to a dedicated type checker by analyzing the target type T in the compilation level.

This feature enables developers to ensure type safety in their applications, leveraging TypeScript's static typing while also providing runtime validation. Instead of defining additional schemas, you can simply utilize the pure TypeScript type itself.

//----
// examples/checkString.ts
//----
import typia, { tags } from "typia";
export const checkString = typia.createIs<string>();

//----
// examples/checkString.js
//----
import typia from "typia";
export const checkString = (() => {
  return (input) => "string" === typeof input;
})();

Sponsors

Thanks for your support.

Your donation encourages typia development.

Also, typia is re-distributing quarter of donations to nonara/ts-patch.

Sponsors

Playground

You can experience how typia works by playground website:

  • 💻 https://typia.io/playground

Guide Documents

Check out the document in the website:

🏠 Home

📖 Features

🔗 Appendix

References

Extension points exported contracts — how you extend this code

IJsonable (Interface)
(no doc) [26 implementers]
packages/interface/src/typings/Primitive.ts
_IProtobufWriter (Interface)
(no doc) [4 implementers]
packages/typia/src/internal/_IProtobufWriter.ts
ISuperfluous (Interface)
@internal
packages/core/src/programmers/iterate/json_schema_object.ts
Something (Interface)
Something interface.
tests/test-utils/src/features/llm/schema/test_llm_schema_reference_escaped_description_of_namespace.ts
IBbsArticle (Interface)
* Article entity. * * `IBbsArticle` is an entity representing an article in the BBS (Bulletin Board * System).
examples/src/llm/application-description.ts
IParentReference (Interface)
(no doc)
packages/utils/src/utils/internal/JsonDescriptor.ts
IToolEntry (Interface)
(no doc)
packages/mcp/src/internal/McpControllerRegistrar.ts
ITransformProps (Interface)
(no doc)
packages/transform/src/ITransformProps.ts

Core symbols most depended-on inside this repo

parse
called by 745
packages/utils/src/utils/internal/parseLenientJson.ts
array
called by 217
tests/debug/src/index.ts
string
called by 207
packages/typia/src/internal/_IProtobufWriter.ts
integer
called by 172
packages/interface/src/utils/IRandomGenerator.ts
NoTransformConfigurationError
called by 149
packages/typia/src/transformers/NoTransformConfigurationError.ts
number
called by 125
packages/interface/src/utils/IRandomGenerator.ts
create
called by 110
examples/src/llm/namespace.ts
get
called by 100
packages/utils/src/utils/Singleton.ts

Shape

Function 2,690
Interface 1,122
Method 377
Class 170
Enum 7

Languages

TypeScript100%

Modules by API surface

packages/interface/src/openapi/OpenApiV3_2.ts40 symbols
packages/interface/src/openapi/OpenApiV3_1.ts39 symbols
packages/core/src/programmers/internal/CheckerProgrammer.ts38 symbols
packages/interface/src/openapi/OpenApi.ts37 symbols
packages/interface/src/openapi/OpenApiV3.ts36 symbols
packages/utils/src/utils/internal/OpenApiTypeCheckerBase.ts33 symbols
packages/interface/src/utils/IRandomGenerator.ts31 symbols
packages/interface/src/openapi/SwaggerV2.ts29 symbols
packages/core/src/programmers/json/JsonStringifyProgrammer.ts27 symbols
packages/core/src/programmers/RandomProgrammer.ts27 symbols
packages/core/src/factories/ProtobufFactory.ts27 symbols
packages/typia/src/http.ts26 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

Dependencies from manifests, versioned

@ai-sdk/openai-compatible2.0.35 · 1×
@autobe/interfacelatest · 1×
@emotion/react11.10.6 · 1×
@emotion/styled11.10.6 · 1×
@fastify/type-provider-typebox3.5.0 · 1×
@langchain/core1.1.31 · 1×
@langchain/openai1.2.12 · 1×
@modelcontextprotocol/sdk1.26.0 · 1×
@monaco-editor/react4.6.0 · 1×
@mui/icons-material5.15.4 · 1×
@mui/material5.12.0 · 1×
@nestia/e2ecatalog:utils · 1×

For agents

$ claude mcp add typia \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact