sindresorhus / ts-extras

Essential utilities for TypeScript projects
MIT License
587 stars 15 forks source link

Add `assertDefined` #6

Closed alita-moore closed 2 years ago

alita-moore commented 3 years ago

please ignore the name of this branch

alita-moore commented 3 years ago

Btw this may be confusing because there are other falsey values. So maybe assertNotNull be better

sindresorhus commented 3 years ago

Btw this may be confusing because there are other falsey values. So maybe assertNotNull be better

"Non-defined" does not imply falsy though. Although, we could consider naming it assertNonNullable? That might be clearer. If so, we should rename isDefined to isNonNullable too.

sindresorhus commented 2 years ago

Closing for lack of activity.

https://github.com/sindresorhus/ts-extras/issues/43