sindresorhus / p-map

Map over promises concurrently
MIT License
1.29k stars 58 forks source link

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

Closed furudean closed 2 years ago

furudean commented 2 years ago

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>} */