Skip to content

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

Open

Description

@kaiyoma

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.

Activity

  1. kaiyoma commented on May 25, 2023

    @kaiyoma
    Author

    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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions