UNPKG

aws-sdk-js-codemod

Version:

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

22 lines (21 loc) 776 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getClientNewExpressionFromLocalName = void 0; const getClientNewExpressionFromLocalName = (v2ClientLocalName) => { // Support for DynamoDB.DocumentClient const [clientName, subClientName] = v2ClientLocalName.split("."); if (subClientName) { return { type: "NewExpression", callee: { object: { type: "Identifier", name: clientName }, property: { type: "Identifier", name: subClientName }, }, }; } return { type: "NewExpression", callee: { type: "Identifier", name: clientName }, }; }; exports.getClientNewExpressionFromLocalName = getClientNewExpressionFromLocalName;