Skip to content

discoverTypings should look at typingSafelist.json values #16277

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

Merged
merged 2 commits into from
Jun 6, 2017

Conversation

minestarks
Copy link
Member

The npm package names in typingSafeList.json were getting ignored, breaking type acquisition for packages where file name != package name

@minestarks minestarks requested review from billti and a user June 5, 2017 22:58
Copy link
Contributor

@mhegazy mhegazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a unit test to harness\unittests\typingsInstaller.ts

@@ -192,7 +192,7 @@ namespace ts.JsTyping {
const cleanedTypingNames = map(inferredTypingNames, f => f.replace(/((?:\.|-)min(?=\.|$))|((?:-|\.)\d+)/g, ""));

if (safeList !== EmptySafeList) {
mergeTypings(filter(cleanedTypingNames, f => safeList.has(f)));
mergeTypings(map(filter(cleanedTypingNames, f => safeList.has(f)), (f => safeList.get(f))));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good candidate to use ts.mapDefined(cleanedTypingNames, f => safeList.get(f)).

@minestarks minestarks merged commit 52e867c into microsoft:master Jun 6, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants