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

The published version appears to be CommonJS only:

    $ node index.mjs
    import { isString } from 'super-utils-plus'
             ^^^^^^^^
    SyntaxError: Named export 'isString' not found. The requested module 'super-utils-plus' is 
    a CommonJS module, which may not support all module.exports as named exports.
You might also need to update some of your type checks to handle wrapper objects like new String() - Object.prototype.toString.call(...) is your friend.


> You might also need to update some of your type checks to handle wrapper objects like new String()

There’s genuinely never a reason to use new String(). You should treat non-primitive String instances as bugs.


Can you explain a little? I've never heard this.




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

Search: