How to use the decoders.nullable function in decoders

To help you get started, we’ve selected a few decoders examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nvie / decoders / src / types / optional-tests.ts View on Github external
import { maybe, nullable, optional, string } from 'decoders';

optional(string); // $ExpectType Decoder
optional(optional(string)); // $ExpectType Decoder

nullable(string); // $ExpectType Decoder
nullable(nullable(string)); // $ExpectType Decoder

maybe(string); // $ExpectType Decoder
maybe(maybe(string)); // $ExpectType Decoder
github nvie / decoders / src / types / optional-tests.ts View on Github external
import { maybe, nullable, optional, string } from 'decoders';

optional(string); // $ExpectType Decoder
optional(optional(string)); // $ExpectType Decoder

nullable(string); // $ExpectType Decoder
nullable(nullable(string)); // $ExpectType Decoder

maybe(string); // $ExpectType Decoder
maybe(maybe(string)); // $ExpectType Decoder