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
2
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.0.22 to 0.0.23

2

package.json
{
"name": "@angular-devkit/build-optimizer",
"version": "0.0.22",
"version": "0.0.23",
"description": "Angular Build Optimizer",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -19,25 +19,17 @@ "use strict";

const whitelistedAngularModules = [
/[\\\/]node_modules[\\\/]@angular[\\\/]animations[\\\/]/,
/[\\\/]node_modules[\\\/]@angular[\\\/]common[\\\/]/,
/[\\\/]node_modules[\\\/]@angular[\\\/]compiler[\\\/]/,
/[\\\/]node_modules[\\\/]@angular[\\\/]core[\\\/]/,
/[\\\/]node_modules[\\\/]@angular[\\\/]forms[\\\/]/,
/[\\\/]node_modules[\\\/]@angular[\\\/]http[\\\/]/,
/[\\\/]node_modules[\\\/]@angular[\\\/]platform-browser-dynamic[\\\/]/,
/[\\\/]node_modules[\\\/]@angular[\\\/]platform-browser[\\\/]/,
/[\\\/]node_modules[\\\/]@angular[\\\/]platform-webworker-dynamic[\\\/]/,
/[\\\/]node_modules[\\\/]@angular[\\\/]platform-webworker[\\\/]/,
/[\\\/]node_modules[\\\/]@angular[\\\/]router[\\\/]/,
/[\\\/]node_modules[\\\/]@angular[\\\/]upgrade[\\\/]/,
/[\\\/]node_modules[\\\/]@angular[\\\/]material[\\\/]/,
/[\\\/]node_modules[\\\/]@angular[\\\/]cdk[\\\/]/,
/(\\|\/)node_modules(\\|\/)@angular(\\|\/)animations(\\|\/)/,
/(\\|\/)node_modules(\\|\/)@angular(\\|\/)common(\\|\/)/,
/(\\|\/)node_modules(\\|\/)@angular(\\|\/)compiler(\\|\/)/,
/(\\|\/)node_modules(\\|\/)@angular(\\|\/)core(\\|\/)/,
/(\\|\/)node_modules(\\|\/)@angular(\\|\/)forms(\\|\/)/,
/(\\|\/)node_modules(\\|\/)@angular(\\|\/)http(\\|\/)/,
/(\\|\/)node_modules(\\|\/)@angular(\\|\/)platform-browser-dynamic(\\|\/)/,
/(\\|\/)node_modules(\\|\/)@angular(\\|\/)platform-browser(\\|\/)/,
/(\\|\/)node_modules(\\|\/)@angular(\\|\/)platform-webworker-dynamic(\\|\/)/,
/(\\|\/)node_modules(\\|\/)@angular(\\|\/)platform-webworker(\\|\/)/,
/(\\|\/)node_modules(\\|\/)@angular(\\|\/)router(\\|\/)/,
/(\\|\/)node_modules(\\|\/)@angular(\\|\/)upgrade(\\|\/)/,
/(\\|\/)node_modules(\\|\/)@angular(\\|\/)material(\\|\/)/,
/(\\|\/)node_modules(\\|\/)@angular(\\|\/)cdk(\\|\/)/,
];
const es5AngularModules = [
// Angular 4 packaging format has .es5.js as the extension.
/.es5.js$/,
// Angular 5 has esm5 folders.
/[\\\/]node_modules[\\\/]@angular[\\\/][^\\/][\\\/]esm5[\\\/]/,
// All Angular versions have UMD with es5.
/.umd.js$/,
];
function buildOptimizer(options) {

@@ -64,6 +56,5 @@ const { inputFilePath } = options;

if (inputFilePath
&& whitelistedAngularModules.some((re) => re.test(inputFilePath))
&& es5AngularModules.some((re) => re.test(inputFilePath))) {
&& whitelistedAngularModules.some((re) => re.test(inputFilePath))) {
getTransforms.push(
// getPrefixFunctionsTransformer is rather dangerous, apply only to known pure es5 modules.
// getPrefixFunctionsTransformer is rather dangerous, apply only to known pure modules.
// It will mark both `require()` calls and `console.log(stuff)` as pure.

@@ -80,2 +71,2 @@ // We only apply it to whitelisted modules, since we know they are safe.

exports.buildOptimizer = buildOptimizer;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQtb3B0aW1pemVyLmpzIiwic291cmNlUm9vdCI6Ii9Vc2Vycy9oYW5zbC9Tb3VyY2VzL2RldmtpdC8iLCJzb3VyY2VzIj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29udGVudCkpIHtcbiAgICBnZXRUcmFuc2Zvcm1zLnB1c2goXG4gICAgICBnZXRTY3J1YkZpbGVUcmFuc2Zvcm1lcixcbiAgICAgIGdldEZvbGRGaWxlVHJhbnNmb3JtZXIsXG4gICAgKTtcbiAgfVxuXG4gIHJldHVybiB0cmFuc2Zvcm1KYXZhc2NyaXB0KHsgLi4ub3B0aW9ucywgZ2V0VHJhbnNmb3JtcywgY29udGVudCB9KTtcbn1cbiJdfQ==

@@ -203,4 +203,3 @@ "use strict";

}
if (expr.right.kind !== ts.SyntaxKind.FunctionExpression
&& expr.right.kind !== ts.SyntaxKind.ArrowFunction) {
if (expr.right.kind !== ts.SyntaxKind.FunctionExpression) {
return false;

@@ -295,2 +294,2 @@ }

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NydWItZmlsZS5qcyIsInNvdXJjZVJvb3QiOiIvVXNlcnMvaGFuc2wvU291cmNlcy9kZXZraXQvIiwic291cmNlcyI6WyJwYWNrYWdlcy9hbmd1bGFyX2RldmtpdC9idWlsZF9vcHRpbWl6ZXIvc3JjL3RyYW5zZm9ybXMvc2NydWItZmlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBOzs7Ozs7R0FNRztBQUNILGlDQUFpQztBQUNqQyxvREFBd0Q7QUFHeEQsdUJBQThCLE9BQWU7SUFDM0MsTUFBTSxPQUFPLEdBQUc7UUFDZCxZQUFZO1FBQ1osZ0JBQWdCO1FBQ2hCLGdCQUFnQjtLQUNqQixDQUFDO0lBRUYsTUFBTSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxNQUFNLEtBQUssT0FBTyxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ2xFLENBQUM7QUFSRCxzQ0FRQztBQUVELDRDQUE0QztBQUM1QyxNQUFNLGlCQUFpQixHQUFHO0lB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WxFbGVtZW50KTogYm9vbGVhbiB7XG4gIGlmIChwcm9wLmtpbmQgIT09IHRzLlN5bnRheEtpbmQuUHJvcGVydHlBc3NpZ25tZW50KSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG4gIGNvbnN0IGFzc2lnbm1lbnQgPSBwcm9wIGFzIHRzLlByb3BlcnR5QXNzaWdubWVudDtcbiAgaWYgKGFzc2lnbm1lbnQubmFtZS5raW5kICE9PSB0cy5TeW50YXhLaW5kLklkZW50aWZpZXIpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cbiAgY29uc3QgbmFtZSA9IGFzc2lnbm1lbnQubmFtZSBhcyB0cy5JZGVudGlmaWVyO1xuXG4gIHJldHVybiBuYW1lLnRleHQgPT09ICd0eXBlJztcbn1cblxuLy8gQ2hlY2sgaWYgYW4gaWRlbnRpZmllciBpcyBwYXJ0IG9mIHRoZSBrbm93biBBbmd1bGFyIE1ldGFkYXRhLlxuZnVuY3Rpb24gaWRlbnRpZmllcklzTWV0YWRhdGEoXG4gIGlkOiB0cy5JZGVudGlmaWVyLFxuICBtZXRhZGF0YTogdHMuTm9kZVtdLFxuICBjaGVja2VyOiB0cy5UeXBlQ2hlY2tlcixcbik6IGJvb2xlYW4ge1xuICBjb25zdCBzeW1ib2wgPSBjaGVja2VyLmdldFN5bWJvbEF0TG9jYXRpb24oaWQpO1xuICBpZiAoIXN5bWJvbCB8fCAhc3ltYm9sLmRlY2xhcmF0aW9ucyB8fCAhc3ltYm9sLmRlY2xhcmF0aW9ucy5sZW5ndGgpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICByZXR1cm4gc3ltYm9sXG4gICAgLmRlY2xhcmF0aW9uc1xuICAgIC5zb21lKChzcGVjKSA9PiBtZXRhZGF0YS5pbmRleE9mKHNwZWMpICE9PSAtMSk7XG59XG4iXX0=
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