Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "YesNoBool"

Index

Type aliases

Variables

Type aliases

TYesNoBool

TYesNoBool: io.TypeOf<Type>

Variables

Const YesNoBool

YesNoBool: Type<boolean, string, unknown> = new io.Type<boolean, string, unknown>('YesNoBool',(u): u is boolean => typeof u === "boolean",(u, c) => {const s = io.string.validate(u, c);if(isLeft(s))return io.failure(u,c)const yesNoLowercased = s.right.toLocaleLowerCase()if(yesNoLowercased === "yes")return io.success(true)if(yesNoLowercased === "no")return io.success(false)elsereturn io.failure(u, c, `yes|no boolean cannot be: ${yesNoLowercased}`)},a => a ? "yes" : "no")

Generated using TypeDoc