New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

ts-decoder

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-decoder

Typesafe decoder for TypeScript

latest
Source
npmnpm
Version
3.0.0
Version published
Maintainers
1
Created
Source

ts-decoder A functional, opinionated, TypeScript library for decoding arbitrary inputs into type-safe objects

Some features of ts-decoder:

  • Functional-style: no classes except for DecodeError, all operations are data-last for easier composition
  • Built in decoders for basic types: boolean, number, string and date
  • Support for typed array and iterable decoding
  • Support for object decoding
  • Provides a base DecoderError class to distinguish decoding errors from any other error
  • Provides a very simple Decoder TS interface (type Decoder<T> = (input: any) => T). Bulding a custom decoder is very easy.
  • Supports decoding nested array, iterable and object structure either fully or partially.
  • Provides a mechanism for collecting decoding errors on nested structures without aborting the decoding process (functional-style error bubbling).
  • Strict or forced decoding. Strict mode checks for types to be exactly as expected. Forced decoding attempts to map the input to the output type.

Keywords

typescript

FAQs

Package last updated on 30 Apr 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