UNPKG

aws-sdk-js-codemod

Version:

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

24 lines (23 loc) 859 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getClientWaiterStates = void 0; const getClientWaiterStates = (j, source, clientIdentifiers) => { const waiterStates = []; for (const clientId of clientIdentifiers) { source .find(j.CallExpression, { callee: { type: "MemberExpression", object: clientId, property: { type: "Identifier", name: "waitFor" }, }, }) .forEach((waiterCallExpression) => { // @ts-expect-error arguments[0] is Literal or StringLiteral const waiterState = waiterCallExpression.value.arguments[0].value; waiterStates.push(waiterState); }); } return new Set(waiterStates); }; exports.getClientWaiterStates = getClientWaiterStates;