@sharyn/util.inlinethrow
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

🌹 inlineThrow

inlineThrow is a function that throws 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

Readme

Keywords

none

Package Sidebar

Install

npm i @sharyn/util.inlinethrow

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

947 B

Total Files

5

Last publish

Collaborators

  • sharyn