1.0.1 • Published 5 years ago
@sharyn/util.inlinethrow v1.0.1
🌹 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