UNPKG

aws-sdk-js-codemod

Version:

Collection of codemod scripts that help update AWS SDK for JavaScript APIs

18 lines (17 loc) 747 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getNamesFromNewExpr = void 0; const config_1 = require("../config"); const utils_1 = require("../utils"); const getNamesFromNewExpr = (j, source, v2GlobalName) => [ ...source .find(j.NewExpression, (0, utils_1.getClientNewExpressionFromGlobalName)(v2GlobalName)) .nodes() .map((newExpression) => newExpression.callee.property.name), ...source .find(j.NewExpression, (0, utils_1.getClientNewExpressionFromGlobalName)(v2GlobalName, config_1.DYNAMODB_DOCUMENT_CLIENT)) .nodes() .map((newExpression) => newExpression.callee.object .property.name), ]; exports.getNamesFromNewExpr = getNamesFromNewExpr;