Socket
Socket
Sign inDemoInstall

@angular/tsc-wrapped

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular/tsc-wrapped - npm Package Compare versions

Comparing version 4.4.0-RC.0 to 4.4.1

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc