-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Labels
Description
tl;dr:
(param: Any) => not String
// shorthand
(param: Any) => !String
// union case
(param: Any) => not(String | Array)
// short hand
(param: Any) => !(String | Array)
Sometimes it's way easier and convenient to define the type by discarding one or several.
There's also the possibility to define it as a substraction—e.g. Any - String
—but that would not be very conventional.
TypeScript approaches
renewooller, ndbroadbent, shovon and DannyNemer