UNPKG

aws-sdk-js-codemod

Version:

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

16 lines (15 loc) 584 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getImportDeclarations = void 0; const config_1 = require("../../config"); const getImportDeclarations = (j, source, path) => source.find(j.ImportDeclaration).filter((importDeclaration) => { const sourceValue = importDeclaration.value.source.value; if (typeof sourceValue !== "string") { return false; } if (path) { return sourceValue === path; } return sourceValue.startsWith(config_1.PACKAGE_NAME); }); exports.getImportDeclarations = getImportDeclarations;