News for hackers. Stuff that matters.
Re:A one-line package broke `npm create-react-app` by ufo on Saturday April 25, 2020 @04:35PM (#22981221)
Does anyone know if it really needs the !!obj&& at the start? Isn't that redundant with checking that the type is either "object" or "function"?

And is there a reason to use '!!' inside a conditional? Wouldn't obj&& do basically the same thing?

Re:A one-line package broke `npm create-react-app` by acemarke on Saturday April 25, 2020 @04:49PM (#22981342)
Unfortunately, that's not redundant, because `typeof null` returns "object":

https://2ality.com/2013/10/typeof-null.html

Re:A one-line package broke `npm create-react-app` by megous on Saturday April 25, 2020 @05:07PM (#22981497)

    !!null && false   === false
    null && false     === null