@angular/tsc-wrapped
Advanced tools
Comparing version 4.4.0-RC.0 to 4.4.1
{ | ||
"name": "@angular/tsc-wrapped", | ||
"version": "4.4.0-RC.0", | ||
"version": "4.4.1", | ||
"description": "Wraps the tsc CLI, allowing extensions.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/angular/angular/blob/master/tools/@angular/tsc-wrapped", |
@@ -188,5 +188,7 @@ "use strict"; | ||
exportedSymbols.forEach(function (symbol) { return _this.convertSymbol(symbol); }); | ||
var symbolsMap = new Map(); | ||
Array.from(this.symbolMap.values()).forEach(function (symbol) { | ||
if (symbol.referenced && !symbol.reexport) { | ||
var name_3 = symbol.name; | ||
var declaredName = symbol.declaration.name; | ||
if (symbol.isPrivate && !symbol.privateName) { | ||
@@ -196,5 +198,28 @@ name_3 = newPrivateName(); | ||
} | ||
if (symbolsMap.has(declaredName)) { | ||
var names = symbolsMap.get(declaredName); | ||
names.push(name_3); | ||
} | ||
else { | ||
symbolsMap.set(declaredName, [name_3]); | ||
} | ||
result[name_3] = symbol.value; | ||
} | ||
}); | ||
// check for duplicated entries | ||
symbolsMap.forEach(function (names, declaredName) { | ||
if (names.length > 1) { | ||
// prefer the export that uses the declared name (if any) | ||
var reference_1 = names.indexOf(declaredName); | ||
if (reference_1 === -1) { | ||
reference_1 = 0; | ||
} | ||
// keep one entry and replace the others by references | ||
names.forEach(function (name, i) { | ||
if (i !== reference_1) { | ||
result[name] = { __symbolic: 'reference', name: names[reference_1] }; | ||
} | ||
}); | ||
} | ||
}); | ||
return result; | ||
@@ -201,0 +226,0 @@ }; |
@@ -124,2 +124,19 @@ "use strict"; | ||
}); | ||
it('should be able to de-duplicate symbols of re-exported modules', function () { | ||
var host = new MockStringBundlerHost('/', { | ||
'public-api.ts': "\n export {A as A2, A, B as B1, B as B2} from './src/core';\n ", | ||
'src': { | ||
'core.ts': "\n export class A {}\n export class B {}\n ", | ||
} | ||
}); | ||
var bundler = new bundler_1.MetadataBundler('/public-api', undefined, host); | ||
var result = bundler.getMetadataBundle(); | ||
var _a = result.metadata.metadata, A = _a.A, A2 = _a.A2, B1 = _a.B1, B2 = _a.B2; | ||
expect(A.__symbolic).toEqual('class'); | ||
expect(A2.__symbolic).toEqual('reference'); | ||
expect(A2.name).toEqual('A'); | ||
expect(B1.__symbolic).toEqual('class'); | ||
expect(B2.__symbolic).toEqual('reference'); | ||
expect(B2.name).toEqual('B1'); | ||
}); | ||
}); | ||
@@ -126,0 +143,0 @@ var MockStringBundlerHost = (function () { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
673347
5313
1