millify icon indicating copy to clipboard operation
millify copied to clipboard

Types don't match code when this library is used in ESM

Open kaiyoma opened this issue 1 year ago • 1 comments

This library is CJS, so when used from an ESM module, you have to do this:

import millify from 'millify';

millify.default(...)

However, this doesn't match up with the published types, which expect the default export to be used directly.

kaiyoma avatar May 25 '23 23:05 kaiyoma

Hmm, I'm having trouble getting this library to work in all scenarios when using ESM. Sometimes it needs .default and sometimes it doesn't. Publishing an ESM version of this library would probably fix this, or maybe switch the API so the default export is a namespace rather than a function?

kaiyoma avatar May 25 '23 23:05 kaiyoma