TehShrike / deepmerge

A library for deep (recursive) merging of Javascript objects
MIT License
2.75k stars 216 forks source link

fix type definition #121

Closed nataly87s closed 5 years ago

nataly87s commented 5 years ago

fixes issue #120 remove default export

msssk commented 5 years ago

I don't see how this is a fix.

How is

import * as merge from 'deepmerge';

better than

import merge from 'deepmerge';

I get that there's room for personal taste (personally, I find import * as very distasteful), but are there objective downsides to import merge?

TehShrike commented 5 years ago

@msssk it is not a matter of taste, import * is semantically different from import identifier. The first imports everything that is exposed by the module, the second imports only the default export.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Description