Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
triple,
tuple,
} from "tiny-decoders";
function use(value: unknown) {
return void value;
}
// $ExpectType boolean
boolean(undefined);
// $ExpectType number
number(undefined);
// $ExpectType string
string(undefined);
// $ExpectType readonly unknown[]
mixedArray(undefined);
// $ExpectType { readonly [key: string]: unknown; }
mixedDict(undefined);
// $ExpectType true
constant(true)(undefined);
// $ExpectType false
constant(false)(undefined);
// $ExpectType 0
constant(0)(undefined);
// $ExpectType "const"
constant("const")(undefined);
// $ExpectType undefined
constant(undefined)(undefined);
// $ExpectType null
constant(null)(undefined);
// $ExpectType string[]
array(string)(undefined);