Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Await values before passing them to mapper, refactor TS definition to CJS compatible export #12

Merged
merged 1 commit into from
Apr 29, 2019
Merged

Conversation

BendingBender
Copy link
Contributor

Fixes #10.

I have question here: A Map can have Promises as values but also as keys. Should I handle the possibility of keys as Promises and resolve them before passing to mapper? If yes, should the resulting Map contain the resolved values as keys or the original Promises?

@sindresorhus
Copy link
Owner

We should not await any keys that are promises. Only the values.

@sindresorhus
Copy link
Owner

Is this good to merge now?

@BendingBender
Copy link
Contributor Author

Yes.

@sindresorhus
Copy link
Owner

Sorry, forgot to ask. Is this a breaking change?

@BendingBender
Copy link
Contributor Author

Yes, for TS and for JS users alike.

@sindresorhus sindresorhus changed the title Await for element values before passing them to mapper, refactor TS definition to CJS compatible export Await values before passing them to mapper, refactor TS definition to CJS compatible export Apr 29, 2019
@sindresorhus sindresorhus merged commit 3cbe259 into sindresorhus:master Apr 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mapper receives unresolved element value
2 participants