-
-
Save MichalZalecki/1c86538f56ae7f9e7c3ed31b3bdbfd17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isString = (u: unknown): u is string => typeof u === "string"; | |
// Type<A, O, I> | |
const string = new t.Type<string, string, unknown>( | |
"string", | |
isString, | |
(input, context) => isString(input) ? t.success(input) : t.failure(input, context), | |
t.identity, | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment