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.6.0 to 0.6.1

2

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

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

@@ -106,5 +106,3 @@ "use strict";

}
if (wrap_enums_1.testWrapEnums(content)) {
getTransforms.unshift(wrap_enums_1.getWrapEnumsTransformer);
}
getTransforms.unshift(wrap_enums_1.getWrapEnumsTransformer);
const transformJavascriptOpts = {

@@ -122,2 +120,2 @@ content: content,

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

@@ -18,2 +18,6 @@ /**

export { getScrubFileTransformer, testScrubFile } from './transforms/scrub-file';
export { getWrapEnumsTransformer, testWrapEnums } from './transforms/wrap-enums';
export { getWrapEnumsTransformer } from './transforms/wrap-enums';
/**
* @deprecated since version 6.0
*/
export declare function testWrapEnums(_content: string): boolean;

@@ -35,3 +35,9 @@ "use strict";

exports.getWrapEnumsTransformer = wrap_enums_1.getWrapEnumsTransformer;
exports.testWrapEnums = wrap_enums_1.testWrapEnums;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiLi8iLCJzb3VyY2VzIjpbInBhY2thZ2VzL2FuZ3VsYXJfZGV2a2l0L2J1aWxkX29wdGltaXplci9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQTs7Ozs7O0dBTUc7QUFDSCxtRUFBbUY7QUFBMUUsZ0RBQUEsT0FBTyxDQUF3QjtBQUN4QyxxRUFBbUU7QUFBMUQsMkNBQUEsY0FBYyxDQUFBO0FBRXZCLDBEQUF1RDtBQUE5Qyx3Q0FBQSxZQUFZLENBQUE7QUFDckIsMENBQXlDO0FBQWhDLDBCQUFBLE1BQU0sQ0FBQTtBQUVmLHVFQUFxRTtBQUE1RCxxREFBQSxtQkFBbUIsQ0FBQTtBQUU1QixzREFBaUU7QUFBeEQsOENBQUEsc0JBQXNCLENBQUE7QUFDL0IsMERBQXVGO0FBQTlFLG1EQUFBLHlCQUF5QixDQUFBO0FBQUUseUNBQUEsZUFBZSxDQUFBO0FBQ25ELDhEQUE2RjtBQUFwRix1REFBQSwyQkFBMkIsQ0FBQTtBQUFFLDZDQUFBLGlCQUFpQixDQUFBO0FBQ3ZELGtFQUE4RTtBQUFyRSwyREFBQSw2QkFBNkIsQ0FBQTtBQUN0QyxzREFBaUY7QUFBeEUsK0NBQUEsdUJBQXVCLENBQUE7QUFBRSxxQ0FBQSxhQUFhLENBQUE7QUFDL0Msc0RBQWlGO0FBQXhFLCtDQUFBLHVCQUF1QixDQUFBO0FBQUUscUNBQUEsYUFBYSxDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBJbmMuIE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m9tICcuL3RyYW5zZm9ybXMvcHJlZml4LWZ1bmN0aW9ucyc7XG5leHBvcnQgeyBnZXRTY3J1YkZpbGVUcmFuc2Zvcm1lciwgdGVzdFNjcnViRmlsZSB9IGZyb20gJy4vdHJhbnNmb3Jtcy9zY3J1Yi1maWxlJztcbmV4cG9ydCB7IGdldFdyYXBFbnVtc1RyYW5zZm9ybWVyLCB0ZXN0V3JhcEVudW1zIH0gZnJvbSAnLi90cmFuc2Zvcm1zL3dyYXAtZW51bXMnO1xuIl19
/**
* @deprecated since version 6.0
*/
function testWrapEnums(_content) {
return true;
}
exports.testWrapEnums = testWrapEnums;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiLi8iLCJzb3VyY2VzIjpbInBhY2thZ2VzL2FuZ3VsYXJfZGV2a2l0L2J1aWxkX29wdGltaXplci9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQTs7Ozs7O0dBTUc7QUFDSCxtRUFBbUY7QUFBMUUsZ0RBQUEsT0FBTyxDQUF3QjtBQUN4QyxxRUFBbUU7QUFBMUQsMkNBQUEsY0FBYyxDQUFBO0FBRXZCLDBEQUF1RDtBQUE5Qyx3Q0FBQSxZQUFZLENBQUE7QUFDckIsMENBQXlDO0FBQWhDLDBCQUFBLE1BQU0sQ0FBQTtBQUVmLHVFQUFxRTtBQUE1RCxxREFBQSxtQkFBbUIsQ0FBQTtBQUU1QixzREFBaUU7QUFBeEQsOENBQUEsc0JBQXNCLENBQUE7QUFDL0IsMERBQXVGO0FBQTlFLG1EQUFBLHlCQUF5QixDQUFBO0FBQUUseUNBQUEsZUFBZSxDQUFBO0FBQ25ELDhEQUE2RjtBQUFwRix1REFBQSwyQkFBMkIsQ0FBQTtBQUFFLDZDQUFBLGlCQUFpQixDQUFBO0FBQ3ZELGtFQUE4RTtBQUFyRSwyREFBQSw2QkFBNkIs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9jbGFzcy1mb2xkJztcbmV4cG9ydCB7IGdldEltcG9ydFRzbGliVHJhbnNmb3JtZXIsIHRlc3RJbXBvcnRUc2xpYiB9IGZyb20gJy4vdHJhbnNmb3Jtcy9pbXBvcnQtdHNsaWInO1xuZXhwb3J0IHsgZ2V0UHJlZml4Q2xhc3Nlc1RyYW5zZm9ybWVyLCB0ZXN0UHJlZml4Q2xhc3NlcyB9IGZyb20gJy4vdHJhbnNmb3Jtcy9wcmVmaXgtY2xhc3Nlcyc7XG5leHBvcnQgeyBnZXRQcmVmaXhGdW5jdGlvbnNUcmFuc2Zvcm1lciB9IGZyb20gJy4vdHJhbnNmb3Jtcy9wcmVmaXgtZnVuY3Rpb25zJztcbmV4cG9ydCB7IGdldFNjcnViRmlsZVRyYW5zZm9ybWVyLCB0ZXN0U2NydWJGaWxlIH0gZnJvbSAnLi90cmFuc2Zvcm1zL3NjcnViLWZpbGUnO1xuZXhwb3J0IHsgZ2V0V3JhcEVudW1zVHJhbnNmb3JtZXIgfSBmcm9tICcuL3RyYW5zZm9ybXMvd3JhcC1lbnVtcyc7XG5cbi8qKlxuICogQGRlcHJlY2F0ZWQgc2luY2UgdmVyc2lvbiA2LjBcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIHRlc3RXcmFwRW51bXMoX2NvbnRlbnQ6IHN0cmluZykge1xuICByZXR1cm4gdHJ1ZTtcbn1cbiJdfQ==

@@ -9,3 +9,2 @@ /**

import * as ts from 'typescript';
export declare function testWrapEnums(content: string): boolean;
export declare function getWrapEnumsTransformer(): ts.TransformerFactory<ts.SourceFile>;

@@ -11,8 +11,2 @@ "use strict";

const ts = require("typescript");
const ast_utils_1 = require("../helpers/ast-utils");
function testWrapEnums(content) {
// TODO: remove this method, it's not doing anything anymore.
return true;
}
exports.testWrapEnums = testWrapEnums;
function isBlockLike(node) {

@@ -142,51 +136,84 @@ return node.kind === ts.SyntaxKind.Block

function findTs2_3EnumIife(name, statement) {
if (!ts.isExpressionStatement(statement) || !ts.isCallExpression(statement.expression)) {
if (!ts.isExpressionStatement(statement)) {
return null;
}
const funcExpr = ast_utils_1.drilldownNodes(statement, [
{ prop: null, kind: ts.SyntaxKind.ExpressionStatement },
{ prop: 'expression', kind: ts.SyntaxKind.CallExpression },
{ prop: 'expression', kind: ts.SyntaxKind.ParenthesizedExpression },
{ prop: 'expression', kind: ts.SyntaxKind.FunctionExpression },
]);
if (funcExpr === null) {
let expression = statement.expression;
while (ts.isParenthesizedExpression(expression)) {
expression = expression.expression;
}
if (!expression || !ts.isCallExpression(expression) || expression.arguments.length !== 1) {
return null;
}
if (!(funcExpr.parameters.length === 1
&& funcExpr.parameters[0].name.kind === ts.SyntaxKind.Identifier
&& funcExpr.parameters[0].name.text === name)) {
const callExpression = expression;
let argument = expression.arguments[0];
if (!ts.isBinaryExpression(argument)) {
return null;
}
if (!ts.isIdentifier(argument.left) || argument.left.text !== name) {
return null;
}
if (argument.operatorToken.kind === ts.SyntaxKind.FirstAssignment) {
if (!ts.isBinaryExpression(argument.right)
|| argument.right.operatorToken.kind !== ts.SyntaxKind.BarBarToken) {
return null;
}
argument = argument.right;
}
if (!ts.isBinaryExpression(argument)) {
return null;
}
if (argument.operatorToken.kind !== ts.SyntaxKind.BarBarToken) {
return null;
}
expression = expression.expression;
while (ts.isParenthesizedExpression(expression)) {
expression = expression.expression;
}
if (!expression || !ts.isFunctionExpression(expression) || expression.parameters.length !== 1) {
return null;
}
const parameter = expression.parameters[0];
if (!ts.isIdentifier(parameter.name) || parameter.name.text !== name) {
return null;
}
// In TS 2.3 enums, the IIFE contains only expressions with a certain format.
// If we find any that is different, we ignore the whole thing.
for (const innerStmt of funcExpr.body.statements) {
const innerBinExpr = ast_utils_1.drilldownNodes(innerStmt, [
{ prop: null, kind: ts.SyntaxKind.ExpressionStatement },
{ prop: 'expression', kind: ts.SyntaxKind.BinaryExpression },
]);
if (innerBinExpr === null) {
for (let bodyIndex = 0; bodyIndex < expression.body.statements.length; ++bodyIndex) {
const bodyStatement = expression.body.statements[bodyIndex];
if (!ts.isExpressionStatement(bodyStatement) || !bodyStatement.expression) {
return null;
}
if (!(innerBinExpr.operatorToken.kind === ts.SyntaxKind.FirstAssignment
&& innerBinExpr.left.kind === ts.SyntaxKind.ElementAccessExpression)) {
if (!ts.isBinaryExpression(bodyStatement.expression)
|| bodyStatement.expression.operatorToken.kind !== ts.SyntaxKind.FirstAssignment) {
return null;
}
const innerElemAcc = innerBinExpr.left;
if (!(innerElemAcc.expression.kind === ts.SyntaxKind.Identifier
&& innerElemAcc.expression.text === name
&& innerElemAcc.argumentExpression
&& innerElemAcc.argumentExpression.kind === ts.SyntaxKind.BinaryExpression)) {
const assignment = bodyStatement.expression.left;
const value = bodyStatement.expression.right;
if (!ts.isElementAccessExpression(assignment) || !ts.isStringLiteral(value)) {
return null;
}
const innerArgBinExpr = innerElemAcc.argumentExpression;
if (innerArgBinExpr.left.kind !== ts.SyntaxKind.ElementAccessExpression) {
if (!ts.isIdentifier(assignment.expression) || assignment.expression.text !== name) {
return null;
}
const innerArgElemAcc = innerArgBinExpr.left;
if (!(innerArgElemAcc.expression.kind === ts.SyntaxKind.Identifier
&& innerArgElemAcc.expression.text === name)) {
const memberArgument = assignment.argumentExpression;
if (!memberArgument || !ts.isBinaryExpression(memberArgument)
|| memberArgument.operatorToken.kind !== ts.SyntaxKind.FirstAssignment) {
return null;
}
if (!ts.isElementAccessExpression(memberArgument.left)) {
return null;
}
if (!ts.isIdentifier(memberArgument.left.expression)
|| memberArgument.left.expression.text !== name) {
return null;
}
if (!memberArgument.left.argumentExpression
|| !ts.isStringLiteral(memberArgument.left.argumentExpression)) {
return null;
}
if (memberArgument.left.argumentExpression.text !== value.text) {
return null;
}
}
return statement.expression;
return callExpression;
}

@@ -280,3 +307,3 @@ // TS 2.2 enums have statements after the variable declaration, with index statements followed

]));
const updatedIife = ts.updateCall(iife, ts.updateParen(iife.expression, updatedFunction), iife.typeArguments, [ts.createObjectLiteral()]);
const updatedIife = ts.updateCall(iife, ts.updateParen(iife.expression, updatedFunction), iife.typeArguments, iife.arguments);
return updateHostNode(hostNode, updatedIife);

@@ -297,2 +324,2 @@ }

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid3JhcC1lbnVtcy5qcyIsInNvdXJjZVJvb3QiOiIuLyIsInNvdXJjZXMiOlsicGFja2FnZXMvYW5ndWxhcl9kZXZraXQvYnVpbGRfb3B0aW1pemVyL3NyYy90cmFuc2Zvcm1zL3dyYXAtZW51bXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQTs7Ozs7O0dBTUc7QUFDSCxpQ0FBaUM7QUFDakMsb0RBQXNEO0FBR3RELHVCQUE4QixPQUFlO0lBQzNDLDZEQUE2RDtJQUM3RCxNQUFNLENBQUMsSUFBSSxDQUFDO0FBQ2QsQ0FBQztBQUhELHNDQUdDO0FBRUQscUJBQXFCLElBQWE7SUFDaEMsTUFBTSxDQUFDLElBQUksQ0FBQyxJQUFJLEtBQUssRUFBRSxDQUFDLFVBQVUsQ0FBQyxLQUFLO1dBQ2pDLElBQUksQ0FBQyxJQUFJLEtBQUssRUFBRSxDQUFDLFVBQVUsQ0FBQyxXQUFXO1dBQ3ZDLElBQUksQ0FBQyxJQUFJLEtBQUssRUFBRSxDQUFDLFVBQVUsQ0FBQyxVQUFVO1dBQ3RDLElBQUksQ0FBQyxJQUFJLEtBQUssRUFBRSxDQUFDLFVBQVUsQ0FBQyxhQUFhO1dBQ3pDLElBQUksQ0FBQyxJQUFJLEtBQUssRUFBRSxDQUFDLFVBQVUsQ0FBQyxVQUFVLENBQUM7QUFDaEQsQ0FBQztBQUVEO0lBQ0UsTUFBTSxDQUFDLENBQUMsT0FBaUMsRUFBaUMsRUFBRTtRQUMxRSxNQUFNLFdBQVcsR0FBa0MsQ0FBQyxFQUFpQixFQUFFLEVBQUU7WUFFdkUsTUFBTSxNQUFNLEdBQUcsb0JBQW9CLENBQUMsRUFBRSxDQUF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3VycmVudFN0YXRlbWVudCxcbiAgICAgICAgICAgICAgaWlmZSxcbiAgICAgICAgICAgICkpO1xuICAgICAgICAgICAgLy8gc2tpcCBJSUZFIHN0YXRlbWVudFxuICAgICAgICAgICAgb0luZGV4Kys7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAodHMuaXNPYmplY3RMaXRlcmFsRXhwcmVzc2lvbih2YXJpYWJsZURlY2xhcmF0aW9uLmluaXRpYWxpemVyKVxuICAgICAgICAgICAgICAgICAgICYmIHZhcmlhYmxlRGVjbGFyYXRpb24uaW5pdGlhbGl6ZXIucHJvcGVydGllcy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICBjb25zdCBlbnVtU3RhdGVtZW50cyA9IGZpbmRUczJfMkVudW1TdGF0ZW1lbnRzKG5hbWUsIHN0YXRlbWVudHMsIG9JbmRleCArIDEpO1xuICAgICAgICAgIGlmIChlbnVtU3RhdGVtZW50cy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAvLyBmb3VuZCBhbiBlbnVtXG4gICAgICAgICAgICBpZiAoIXVwZGF0ZWRTdGF0ZW1lbnRzKSB7XG4gICAgICAgICAgICAgIHVwZGF0ZWRTdGF0ZW1lbnRzID0gc3RhdGVtZW50cy5zbGljZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gY3JlYXRlIHdyYXBwZXIgYW5kIHJlcGxhY2UgdmFyaWFibGUgc3RhdGVtZW50IGFuZCBlbnVtIG1lbWJlciBzdGF0ZW1lbnRzXG4gICAgICAgICAgICB1cGRhdGVkU3RhdGVtZW50cy5zcGxpY2UodUluZGV4LCBlbnVtU3RhdGVtZW50cy5sZW5ndGggKyAxLCBjcmVhdGVXcmFwcGVkRW51bShcbiAgICAgICAgICAgICAgbmFtZSxcbiAgICAgICAgICAgICAgY3VycmVudFN0YXRlbWVudCxcbiAgICAgICAgICAgICAgZW51bVN0YXRlbWVudHMsXG4gICAgICAgICAgICAgIHZhcmlhYmxlRGVjbGFyYXRpb24uaW5pdGlhbGl6ZXIsXG4gICAgICAgICAgICApKTtcbiAgICAgICAgICAgIC8vIHNraXAgZW51bSBtZW1iZXIgZGVjbGFyYXRpb25zXG4gICAgICAgICAgICBvSW5kZXggKz0gZW51bVN0YXRlbWVudHMubGVuZ3RoO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHRzLmlzT2JqZWN0TGl0ZXJhbEV4cHJlc3Npb24odmFyaWFibGVEZWNsYXJhdGlvbi5pbml0aWFsaXplcilcbiAgICAgICAgICAmJiB2YXJpYWJsZURlY2xhcmF0aW9uLmluaXRpYWxpemVyLnByb3BlcnRpZXMubGVuZ3RoICE9PSAwKSB7XG4gICAgICAgICAgY29uc3QgbGl0ZXJhbFByb3BlcnR5Q291bnQgPSB2YXJpYWJsZURlY2xhcmF0aW9uLmluaXRpYWxpemVyLnByb3BlcnRpZXMubGVuZ3RoO1xuICAgICAgICAgIGNvbnN0IGVudW1TdGF0ZW1lbnRzID0gZmluZEVudW1OYW1lU3RhdGVtZW50cyhuYW1lLCBzdGF0ZW1lbnRzLCBvSW5kZXggKyAxKTtcbiAgICAgICAgICBpZiAoZW51bVN0YXRlbWVudHMubGVuZ3RoID09PSBsaXRlcmFsUHJvcGVydHlDb3VudCkge1xuICAgICAgICAgICAgLy8gZm91bmQgYW4gZW51bVxuICAgICAgICAgICAgaWYgKCF1cGRhdGVkU3RhdGVtZW50cykge1xuICAgICAgICAgICAgICB1cGRhdGVkU3RhdGVtZW50cyA9IHN0YXRlbWVudHMuc2xpY2UoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGNyZWF0ZSB3cmFwcGVyIGFuZCByZXBsYWNlIHZhcmlhYmxlIHN0YXRlbWVudCBhbmQgZW51bSBtZW1iZXIgc3RhdGVtZW50c1xuICAgICAgICAgICAgdXBkYXRlZFN0YXRlbWVudHMuc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gICBpZiAoIXVwZGF0ZWRTdGF0ZW1lbnRzKSB7XG4gICAgICAgICAgICAgIHVwZGF0ZWRTdGF0ZW1lbnRzID0gc3RhdGVtZW50cy5zbGljZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gdXBkYXRlIElJRkUgYW5kIHJlcGxhY2UgdmFyaWFibGUgc3RhdGVtZW50IGFuZCBvbGQgSUlGRVxuICAgICAgICAgICAgdXBkYXRlZFN0YXRlbWVudHMuc3BsaWNlKHVJbmRleCwgMiwgdXBkYXRlRW51bUlpZmUoXG4gICAgICAgICAgICAgIGN1cnJlbnRTdGF0ZW1lbnQsXG4gICAgICAgICAgICAgIGlpZmUsXG4gICAgICAgICAgICApKTtcbiAgICAgICAgICAgIC8vIHNraXAgSUlGRSBzdGF0ZW1lbnRcbiAgICAgICAgICAgIG9JbmRleCsrO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHRzLmlzT2JqZWN0TGl0ZXJhbEV4cHJlc3Npb24odmFyaWFibGVEZWNsYXJhdGlvbi5pbml0aWFsaXplcilcbiAgICAgICAgICAgICAgICAgICAmJiB2YXJpYWJsZURlY2xhcmF0aW9uLmluaXRpYWxpemVyLnByb3BlcnRpZXMubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgY29uc3QgZW51bVN0YXRlbWVudHMgPSBmaW5kVHMyXzJFbnVtU3RhdGVtZW50cyhuYW1lLCBzdGF0ZW1lbnRzLCBvSW5kZXggKyAxKTtcbiAgICAgICAgICBpZiAoZW51bVN0YXRlbWVudHMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgLy8gZm91bmQgYW4gZW51bVxuICAgICAgICAgICAgaWYgKCF1cGRhdGVkU3RhdGVtZW50cykge1xuICAgICAgICAgICAgICB1cGRhdGVkU3RhdGVtZW50cyA9IHN0YXRlbWVudHMuc2xpY2UoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8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nR5Q291bnQpIHtcbiAgICAgICAgICAgIC8vIGZvdW5kIGFuIGVudW1cbiAgICAgICAgICAgIGlmICghdXBkYXRlZFN0YXRlbWVudHMpIHtcbiAgICAgICAgICAgICAgdXBkYXRlZFN0YXRlbWVudHMgPSBzdGF0ZW1lbnRzLnNsaWNlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBjcmVhdGUgd3JhcHBlciBhbmQgcmVwbGFjZSB2YXJpYWJsZSBzdGF0ZW1lbnQgYW5kIGVudW0gbWVtYmVyIHN0YXRlbWVudHNcbiAgICAgICAgICAgIHVwZGF0ZWRTdGF0ZW1lbnRzLnNwbGljZSh1SW5kZXgsIGVudW1TdGF0ZW1lbnRzLmxlbmd0aCArIDEsIGNyZWF0ZVdyYXBwZWRFbnVtKFxuICAgICAgICAgICAgICBuYW1lLFxuICAgICAgICAgICAgICBjdXJyZW50U3RhdGVtZW50LFxuICAgICAgICAgICAgICBlbnVtU3RhdGVtZW50cyxcbiAgICAgICAgICAgICAgdmFyaWFibGVEZWNsYXJhdGlvbi5pbml0aWFsaXplcixcbiAgICAgICAgICAgICkpO1xuICAgICAgICAgICAgLy8gc2tpcCBlbnVtIG1lbWJlciBkZWNsYXJhdGlvbnNcbiAgICAgICAgICAgIG9JbmRleCArPSBlbnVtU3RhdGVtZW50cy5sZW5ndGg7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICBjb25zdCByZXN1bHQgPSB0cy52aXNpdE5vZGUoY3VycmVudFN0YXRlbWVudCwgdmlzaXRvcik7XG4gICAgaWYgKHJlc3VsdCAhPT0gY3VycmVudFN0YXRlbWVudCkge1xuICAgICAgaWYgKCF1cGRhdGVkU3RhdGVtZW50cykge1xuICAgICAgICB1cGRhdGVkU3RhdGVtZW50cyA9IHN0YXRlbWVudHMuc2xpY2UoKTtcbiAgICAgIH1cbiAgICAgIHVwZGF0ZWRTdG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HVybih0cy5jcmVhdGVJZGVudGlmaWVyKG5hbWUpKTtcblxuICBjb25zdCBpaWZlID0gdHMuY3JlYXRlSW1tZWRpYXRlbHlJbnZva2VkRnVuY3Rpb25FeHByZXNzaW9uKFtcbiAgICBpbm5lclZhclN0bXQsXG4gICAgLi4uc3RhdGVtZW50cyxcbiAgICBpbm5lclJldHVybixcbiAgXSk7XG5cbiAgcmV0dXJuIHVwZGF0ZUhvc3ROb2RlKGhvc3ROb2RlLCB0cy5jcmVhdGVQYXJlbihpaWZlKSk7XG59XG4iXX0=
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