3 ms·
A nice middleground on your example is renaming during destructure: `import { check as ValidatorCheck } from "validator";` This keeps the context at the expen
by richthegeek 6y ago
A nice middleground on your example is renaming during destructure:
`import { check as ValidatorCheck } from "validator";`
This keeps the context at the expense of a slightly more verbose import.
Although the primary reason I use destructuring is to enable tree-shaking, and that's only really applicable for the frontend. I'm not sure why I'd destructure on the backend.