Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@angular-devkit/build-optimizer

Package Overview
Dependencies
Maintainers
3
Versions
481
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular-devkit/build-optimizer - npm Package Compare versions

Comparing version 0.1300.0-next.6 to 0.1300.0-next.7

4

package.json
{
"name": "@angular-devkit/build-optimizer",
"version": "0.1300.0-next.6",
"version": "0.1300.0-next.7",
"description": "Angular Build Optimizer",

@@ -14,3 +14,3 @@ "experimental": true,

"tslib": "2.3.1",
"typescript": "4.3.5"
"typescript": "4.4.3"
},

@@ -17,0 +17,0 @@ "peerDependencies": {

@@ -57,3 +57,3 @@ "use strict";

if (content === undefined) {
content = fs_1.readFileSync(inputFilePath, 'UTF-8');
content = (0, fs_1.readFileSync)(inputFilePath, 'UTF-8');
}

@@ -83,9 +83,9 @@ if (!content) {

}
else if (prefix_classes_1.testPrefixClasses(content)) {
else if ((0, prefix_classes_1.testPrefixClasses)(content)) {
// This is only relevant if prefix functions is not used since prefix functions will prefix IIFE wrapped classes.
getTransforms.unshift(prefix_classes_1.getPrefixClassesTransformer);
}
if (scrub_file_1.testScrubFile(content)) {
if ((0, scrub_file_1.testScrubFile)(content)) {
// Always test as these require the type checker
getTransforms.push(scrub_file_1.createScrubFileTransformerFactory(isAngularCoreFile));
getTransforms.push((0, scrub_file_1.createScrubFileTransformerFactory)(isAngularCoreFile));
typeCheck = true;

@@ -103,4 +103,4 @@ }

};
return transform_javascript_1.transformJavascript(transformJavascriptOpts);
return (0, transform_javascript_1.transformJavascript)(transformJavascriptOpts);
}
exports.buildOptimizer = buildOptimizer;

@@ -31,5 +31,5 @@ #!/usr/bin/env node

const outputFile = process.argv[3] || inputFile.replace(tsOrJsRegExp, (subStr) => `.bo${subStr}`);
const boOutput = build_optimizer_1.buildOptimizer({
inputFilePath: path_1.join(currentDir, inputFile),
outputFilePath: path_1.join(currentDir, outputFile),
const boOutput = (0, build_optimizer_1.buildOptimizer)({
inputFilePath: (0, path_1.join)(currentDir, inputFile),
outputFilePath: (0, path_1.join)(currentDir, outputFile),
emitSourceMap: true,

@@ -41,4 +41,4 @@ });

else {
fs_1.writeFileSync(path_1.join(currentDir, outputFile), boOutput.content);
fs_1.writeFileSync(path_1.join(currentDir, `${outputFile}.map`), JSON.stringify(boOutput.sourceMap));
(0, fs_1.writeFileSync)((0, path_1.join)(currentDir, outputFile), boOutput.content);
(0, fs_1.writeFileSync)((0, path_1.join)(currentDir, `${outputFile}.map`), JSON.stringify(boOutput.sourceMap));
console.log('Emitted:');

@@ -45,0 +45,0 @@ console.log(` ${outputFile}`);

@@ -50,3 +50,3 @@ "use strict";

options.angularCoreModules.some((m) => normalizedId.indexOf(m) >= 0);
const { content: code, sourceMap: map } = build_optimizer_1.buildOptimizer({
const { content: code, sourceMap: map } = (0, build_optimizer_1.buildOptimizer)({
content,

@@ -53,0 +53,0 @@ inputFilePath: id,

@@ -25,3 +25,3 @@ "use strict";

const options = (this.getOptions() || {});
const boOutput = build_optimizer_1.buildOptimizer({
const boOutput = (0, build_optimizer_1.buildOptimizer)({
content,

@@ -28,0 +28,0 @@ originalFilePath: this.resourcePath,

@@ -31,8 +31,8 @@ "use strict";

function getScrubFileTransformer(program) {
return scrub_file_1.createScrubFileTransformerFactory(false)(program);
return (0, scrub_file_1.createScrubFileTransformerFactory)(false)(program);
}
exports.getScrubFileTransformer = getScrubFileTransformer;
function getScrubFileTransformerForCore(program) {
return scrub_file_1.createScrubFileTransformerFactory(true)(program);
return (0, scrub_file_1.createScrubFileTransformerFactory)(true)(program);
}
exports.getScrubFileTransformerForCore = getScrubFileTransformerForCore;

@@ -75,3 +75,3 @@ "use strict";

const newNode = ts.updateVariableStatement(node, node.modifiers, ts.updateVariableDeclarationList(node.declarationList, [
ts.updateVariableDeclaration(varDecl, varDecl.name, varDecl.type, ast_utils_1.addPureComment(varInitializer)),
ts.updateVariableDeclaration(varDecl, varDecl.name, varDecl.type, (0, ast_utils_1.addPureComment)(varInitializer)),
]));

@@ -78,0 +78,0 @@ // Replace node with modified one.

@@ -39,3 +39,3 @@ "use strict";

if (topLevelFunctions.has(node)) {
const newNode = ast_utils_1.addPureComment(node);
const newNode = (0, ast_utils_1.addPureComment)(node);
// Replace node with modified one.

@@ -68,7 +68,7 @@ return ts.visitEachChild(newNode, visitor, context);

}
let noPureComment = !ast_utils_1.hasPureComment(node);
let noPureComment = !(0, ast_utils_1.hasPureComment)(node);
let innerNode = node;
while (innerNode && ts.isParenthesizedExpression(innerNode)) {
innerNode = innerNode.expression;
noPureComment = noPureComment && !ast_utils_1.hasPureComment(innerNode);
noPureComment = noPureComment && !(0, ast_utils_1.hasPureComment)(innerNode);
}

@@ -91,3 +91,3 @@ if (!innerNode) {

let expression = innerNode.expression;
if (ts.isIdentifier(expression) && ast_utils_1.getCleanHelperName(expression.text)) {
if (ts.isIdentifier(expression) && (0, ast_utils_1.getCleanHelperName)(expression.text)) {
return;

@@ -94,0 +94,0 @@ }

@@ -115,3 +115,3 @@ "use strict";

if (isAngularCoreImport(importDecl, isAngularCoreFile)) {
specs.push(...ast_utils_1.collectDeepNodes(importDecl, ts.SyntaxKind.ImportSpecifier));
specs.push(...(0, ast_utils_1.collectDeepNodes)(importDecl, ts.SyntaxKind.ImportSpecifier));
}

@@ -118,0 +118,0 @@ }

@@ -306,3 +306,3 @@ "use strict";

const updatedIife = nodeFactory.updateCallExpression(iife, nodeFactory.updateParenthesizedExpression(iife.expression, updatedFunction), iife.typeArguments, [arg]);
let value = ast_utils_1.addPureComment(updatedIife);
let value = (0, ast_utils_1.addPureComment)(updatedIife);
if (exportAssignment) {

@@ -319,3 +319,3 @@ value = nodeFactory.createBinaryExpression(exportAssignment, ts.SyntaxKind.FirstAssignment, updatedIife);

}
const pureIife = ast_utils_1.addPureComment(nodeFactory.createImmediatelyInvokedArrowFunction([
const pureIife = (0, ast_utils_1.addPureComment)(nodeFactory.createImmediatelyInvokedArrowFunction([
...updatedStatements,

@@ -322,0 +322,0 @@ nodeFactory.createReturnStatement(nodeFactory.createIdentifier(name)),

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