angular / clutz

Closure to TypeScript `.d.ts` generator
MIT License
162 stars 60 forks source link

Properly emit renaming named imports from TS. #995

Closed tsjs-copybara-bot closed 4 years ago

tsjs-copybara-bot commented 4 years ago

Properly emit renaming named imports from TS.

Previously, we would translate incorrectly:

const {a: b} = goog.require('tsprefix.a.b.c');

to

import {a} from 'a/b/c';

Now this is fixed to be

import {a as b} from 'a/b/c';

The fix was already there but there was a needless duplication between the code that handled imports from already migrated TS, and imports from code that is co-migrating in the same migrants run.

The common code is now extracted.