UNPKG

aws-sdk-js-codemod

Version:

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

11 lines (10 loc) 637 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getClientNamesFromDeepImport = void 0; const config_1 = require("../config"); const DEEP_IMPORT_PATH_REGEXP = new RegExp(`${config_1.PACKAGE_NAME}/clients/([\\w]*)`, "g"); const getClientNamesFromDeepImport = (fileSource) => { const clientsFromDeepImportPath = new Set([...fileSource.matchAll(DEEP_IMPORT_PATH_REGEXP)].flatMap((regExpMatch) => regExpMatch[1])); return config_1.CLIENT_NAMES.filter((clientName) => clientsFromDeepImportPath.has(clientName.toLowerCase())); }; exports.getClientNamesFromDeepImport = getClientNamesFromDeepImport;