aws-sdk-js-codemod
Version:
Collection of codemod scripts that help update AWS SDK for JavaScript APIs
21 lines (20 loc) • 783 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isS3GetSignedUrlApiUsed = void 0;
const isS3GetSignedUrlApiUsed = (j, source, clientIdentifiers) => {
for (const clientId of clientIdentifiers) {
for (const apiName of ["getSignedUrl", "getSignedUrlPromise"]) {
const s3GetSignedUrlCallExpressions = source.find(j.CallExpression, {
callee: {
type: "MemberExpression",
object: clientId,
property: { type: "Identifier", name: apiName },
},
});
if (s3GetSignedUrlCallExpressions.length)
return true;
}
}
return false;
};
exports.isS3GetSignedUrlApiUsed = isS3GetSignedUrlApiUsed;