🌹 inlineThrow
inlineThrow
is a function that throw
s its argument. Unlike a regular throw
, it's an expression and can be used anywhere.
const number = isNan(string) ? inlineThrow(Error('Not a number')) : parseInt(string)
inlineThrow
is part of @sharyn/util