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

Add pMapSkip as an acceptable return value in Mapper type #60

Merged
merged 1 commit into from
Jun 9, 2022
Merged

Add pMapSkip as an acceptable return value in Mapper type #60

merged 1 commit into from
Jun 9, 2022

Conversation

furudean
Copy link
Contributor

@furudean furudean commented Jun 8, 2022

This is a convenience for those using the Mapper type

import { pMapSkip } from "p-map"

/** @type {Mapper<any, string>} */
async function mapper(...) {
  // Type 'pMapSkip' is not assignable to type 'string'
  return pMapSkip
}

You'd have to add | typeof pMapSkip this to make this work currently:

/** @type {Mapper<any, string | typeof pMapSkip>} */

@furudean furudean changed the title Add pMapSkip as an acceptable return value in Mapper type Add pMapSkip as an acceptable return value in Mapper type Jun 8, 2022
@furudean furudean changed the title Add pMapSkip as an acceptable return value in Mapper type Add pMapSkip as an acceptable return value in Mapper type Jun 8, 2022
@sindresorhus sindresorhus merged commit b58fc26 into sindresorhus:main Jun 9, 2022
@furudean furudean deleted the skip-in-type branch June 9, 2022 17:48
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.

2 participants