Skip to content

Instantly share code, notes, and snippets.

@MichalZalecki MichalZalecki/io-ts.ts Secret
Created Apr 23, 2019

What would you like to do?
const isString = (u: unknown): u is string => typeof u === "string";
// Type<A, O, I>
const string = new t.Type<string, string, unknown>(
(input, context) => isString(input) ? t.success(input) : t.failure(input, context),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.