0.5.6 • Published 12 months ago

@fmtk/decoders v0.5.6

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@fmtk/decoders

Lightweight, composable validation and serialization library.

What's it for?

Typescript lets you check your own code and nothing more. This library lets you check data flowing in and out of code that is under your control.

Show me the code!

The following code creates a validator for an object then prints the results of a validation.

const myModel = object({
  greeting: text,
  name: text,
  age: optional(integer),
});

const result = myModel(getValueFromSomewhere());

if (result.ok) {
  console.log(value);
} else {
  console.error(result.error);
}

Documentation

See documentation.

Influences

This project is the successor to the @fmtk/validation package which has seen use in numerous Futurematik projects. I wanted to make an API that was a bit clearer in intent compared to the original validation package.

The design of this project has been influenced by the decoders package which I discovered early in the build. I considered abandoning this project in favour of the latter, but I decided I wanted to build a Typescript implementation.

0.5.6

12 months ago

0.5.5

12 months ago

0.5.4

1 year ago

0.5.3

1 year ago

0.5.0

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.3.1

3 years ago

0.2.6

3 years ago

0.2.5

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

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago