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

fix(import-tkn)!: preserve named imports #258

Merged
merged 1 commit into from
Sep 22, 2022
Merged

Conversation

idoros
Copy link
Collaborator

@idoros idoros commented Aug 25, 2022

This PR fix an issue with named imports overriding each other in case of 2 with identical origin name (for example: import [x, x as y] from 'abc' ). This resolves #256 .

This PR is a breaking change as it changes the ImportValue interface named and tagged fields from containing a map from "origin to local" to a "list of tuples with from and to":

// old
interface ImportValue {
  named: Record<string, string> | undefined;
  tagged: Record<string, Record<string, string>> | undefined;
  ...
}

// new
type NamedMapping = [from: string, to: string];
interface ImportValue {
  named: NamedMapping[] | undefined;
  tagged: Record<string, NamedMapping[] | undefined>;
  ...
}

@idoros idoros added the bug Something isn't working label Aug 25, 2022
@idoros idoros requested a review from barak007 August 25, 2022 06:59
@idoros idoros self-assigned this Aug 25, 2022
@idoros idoros merged commit 6088f59 into master Sep 22, 2022
@idoros idoros deleted the ido/fix-named-as-mapping branch September 22, 2022 08:50
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

import parser loses override local keys
2 participants