Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { exact, object, pojo, string } from 'decoders';
// $ExpectType Decoder<{ foo: string; bar: { qux: string; }; }, unknown>
object({
foo: string,
bar: object({ qux: string }),
});
// $ExpectType Decoder<{ foo: string; bar: { qux: string; }; }, unknown>
exact({
foo: string,
bar: object({ qux: string }),
});
// $ExpectType Decoder<{ [key: string]: unknown; }, unknown>
pojo;
import { instanceOf } from 'decoders';
// $ExpectType Decoder
instanceOf(Error);
// $ExpectType Decoder
instanceOf(TypeError);
// $ExpectType Decoder
instanceOf(RegExp);
// $ExpectType Decoder, unknown>
instanceOf>(Promise);
// $ExpectError
instanceOf>(Set);
import { instanceOf } from 'decoders';
// $ExpectType Decoder
instanceOf(Error);
// $ExpectType Decoder
instanceOf(TypeError);
// $ExpectType Decoder
instanceOf(RegExp);
// $ExpectType Decoder, unknown>
instanceOf>(Promise);
// $ExpectError
instanceOf>(Set);
import { instanceOf } from 'decoders';
// $ExpectType Decoder
instanceOf(Error);
// $ExpectType Decoder
instanceOf(TypeError);
// $ExpectType Decoder
instanceOf(RegExp);
// $ExpectType Decoder, unknown>
instanceOf>(Promise);
// $ExpectError
instanceOf>(Set);
import { instanceOf } from 'decoders';
// $ExpectType Decoder
instanceOf(Error);
// $ExpectType Decoder
instanceOf(TypeError);
// $ExpectType Decoder
instanceOf(RegExp);
// $ExpectType Decoder, unknown>
instanceOf>(Promise);
// $ExpectError
instanceOf>(Set);
import { instanceOf } from 'decoders';
// $ExpectType Decoder
instanceOf(Error);
// $ExpectType Decoder
instanceOf(TypeError);
// $ExpectType Decoder
instanceOf(RegExp);
// $ExpectType Decoder, unknown>
instanceOf>(Promise);
// $ExpectError
instanceOf>(Set);
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
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
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
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