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

Allow leaving an empty value #38

Closed
Richienb opened this issue Jun 25, 2021 · 1 comment · Fixed by #39
Closed

Allow leaving an empty value #38

Richienb opened this issue Jun 25, 2021 · 1 comment · Fixed by #39

Comments

@Richienb
Copy link
Contributor

For example:

await pMap(["example.com", "notawebsite.invalid", "google.com"], async url => {
	try {
		return await got(url)
	} catch {
		return pMap.hole()
	}
})
//=> ["<example.com contents>", "<google.com contents>"]
@sindresorhus
Copy link
Owner

Do you actually want a whole? Holes in arrays are usually discouraged. How about pMap.skip instead?

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 a pull request may close this issue.

2 participants