aws-sdk-js-codemod
Version:
Collection of codemod scripts that help update AWS SDK for JavaScript APIs
20 lines (19 loc) • 920 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getClientTSTypeRefCount = void 0;
const ts_type_1 = require("../ts-type");
const getClientTSTypeRefCount = (j, source, { v2ClientName, v2ClientLocalName, v2GlobalName }) => {
let clientTSTypeRefCount = 0;
if (v2GlobalName) {
const clienTSTypeRefFromGlobalName = source.find(j.TSTypeReference, {
typeName: (0, ts_type_1.getTSQualifiedNameFromClientName)(v2ClientName, v2GlobalName),
});
clientTSTypeRefCount += clienTSTypeRefFromGlobalName.length;
}
const clienTSTypeRefFromClientLocalName = source.find(j.TSTypeReference, {
typeName: (0, ts_type_1.getTSQualifiedNameFromClientName)(v2ClientLocalName),
});
clientTSTypeRefCount += clienTSTypeRefFromClientLocalName.length;
return clientTSTypeRefCount;
};
exports.getClientTSTypeRefCount = getClientTSTypeRefCount;