3.0.0 • Published 9 days ago

ts-decoder v3.0.0

Weekly downloads
18
License
MIT
Repository
github
Last release
9 days ago

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.
3.0.0

9 days ago

2.0.0

6 months ago

1.1.0

9 months ago

1.0.0

2 years ago

0.4.1

2 years ago

0.3.0

3 years ago

0.4.0

3 years ago

0.2.7

3 years ago

0.2.8

3 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.1.1

4 years ago

0.0.1

4 years ago