Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This actually taps into something I really like about npm. For things that "should be easy/obvious", there are usually edge cases, _especially_ around how `Object` is handled.

The real answer is for Node to have built-ins that handle this (which they now do for `isInteger`, but absent that, I love that there are these specific packages that have unit tests and a simple API. People scoff at things at `isPromise`[1], but it's reliably filling a super important niche that the language doesn't handle.

[1]: https://github.com/then/is-promise/blob/1d547300e780a4eca391...



Maybe we should adopt these packages into es262 and make the shims available by default directly with the language?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: