Type Predicates help to narrow down types. Before this change:
const value: Decimal | string = "123";
if (Decimal.isDecimal(value)) {
// do something
} else {
// Typescript still thinks value can be a Decimal or string
}
After:
const value: Decimal | string = "123";
if (Decimal.isDecimal(value)) {
// do something
} else {
// Typescript now knows value is a string
}
Type Predicates help to narrow down types. Before this change:
After: