TypeScript Version:
1.8.0
Code
constenumAsNonBlank{}exportfunctionisNonBlank(value: string) : value is string&AsNonBlank{return!/^\s*$/g.test(value);}letvalue: string;if(isNonBlank(value)){doThis(value);// expected value to be string & AsNonBlank, actual: string}else{doThat(value);}functiondoThis(value: string&AsNonBlank): void{}functiondoThat(value: string) : void{}Expected behavior:
value should either be string & AsNonBlank
or there must be a message saying that the type guard is invalid or something
Actual behavior:
value is a string
TypeScript Version:
1.8.0
Code
Expected behavior:
value should either be
string & AsNonBlankor there must be a message saying that the type guard is invalid or something
Actual behavior:
value is a
string