New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More ā†’
Socket
Sign inDemoInstall
Socket

typia

Package Overview
Dependencies
Maintainers
0
Versions
659
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typia

Superfast runtime validators with only one line

7.0.0-dev.20241111
Source
npm
Version published
Weekly downloads
683K
2.71%
Maintainers
0
Weekly downloads
Ā 
Created

What is typia?

Typia is a TypeScript library that provides runtime type checking, validation, and serialization/deserialization capabilities. It aims to enhance type safety and runtime validation for TypeScript applications.

What are typia's main functionalities?

Runtime Type Checking

This feature allows you to perform runtime type checking to ensure that a value matches a specified TypeScript type. The code sample demonstrates how to check if a value is a string at runtime.

const isString = typia.is<string>(value);

Validation

Typia provides validation capabilities to ensure that data conforms to a specified type. The code sample shows how to validate an object against a TypeScript type, returning a result that indicates whether the data is valid.

const validationResult = typia.validate<MyType>(data);

Serialization/Deserialization

Typia can serialize TypeScript objects to JSON strings and deserialize JSON strings back to TypeScript objects, ensuring type safety throughout the process. The code sample demonstrates both serialization and deserialization.

const jsonString = typia.stringify<MyType>(data); const dataObject = typia.parse<MyType>(jsonString);

Other packages similar to typia

Keywords

fast

FAQs

Package last updated on 10 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts