Skip to content
New issue

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

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

Already on GitHub? # to your account

Throw aggregate error for npmName.many() #38

Merged
merged 6 commits into from
Feb 22, 2020

Conversation

baile320
Copy link
Contributor

Fixes #29

@baile320
Copy link
Contributor Author

baile320 commented Feb 21, 2020

Hmm... there's an error:

  index.test-d.ts:14:33
  ✖  14:33  Top-level await expressions are only allowed when the module option is set to esnext or system, and the target option is set to es2017 or higher.

I get this when running locally on the master branch as well. I'm not what the preferred fix is. Wrapping the code in index.test-d.ts in an IIFE resolves the issue. Any preferences?

to be clear, I mean:

+(async function() {
	const manyResult = npmName.many(['chalk', '@sindresorhus/is', 'abc123']);
	expectType<Promise<Map<'chalk' | '@sindresorhus/is' | 'abc123', boolean>>>(
		manyResult
	);
	expectType<boolean | undefined>((await manyResult).get('chalk'));
	
	new InvalidNameError('foo') instanceof InvalidNameError;
+})()

index.js Outdated Show resolved Hide resolved
test.js Outdated Show resolved Hide resolved
test.js Outdated Show resolved Hide resolved
test.js Outdated Show resolved Hide resolved
@sindresorhus sindresorhus changed the title allow npm-name to throw iterable aggregate-errors using pmap Throw aggregate error for npmName.many() Feb 22, 2020
@sindresorhus
Copy link
Owner

I get this when running locally on the master branch as well. I'm not what the preferred fix is. Wrapping the code in index.test-d.ts in an IIFE resolves the issue. Any preferences?

Just ignore that. It will be fixed when I upgrade dependencies after this is merged.

@baile320
Copy link
Contributor Author

I made those changes. Let me know if you have any other comments... thanks for your patience!

@sindresorhus sindresorhus merged commit 6fb0e67 into sindresorhus:master Feb 22, 2020
@sindresorhus
Copy link
Owner

Looks good. Thanks :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npmName.many error
2 participants