UNPKG

aws-sdk-js-codemod

Version:

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

20 lines (19 loc) 903 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getClientMetadataRecord = void 0; const getV3ClientName_1 = require("./getV3ClientName"); const getV3ClientPackageName_1 = require("./getV3ClientPackageName"); const getClientMetadataRecord = (v2ClientNamesRecord) => Object.entries(Object.entries(v2ClientNamesRecord).reduce((acc, [v2ClientName, v2ClientLocalName]) => { acc[v2ClientName] = { v2ClientLocalName, v3ClientName: (0, getV3ClientName_1.getV3ClientName)(v2ClientName), v3ClientPackageName: (0, getV3ClientPackageName_1.getV3ClientPackageName)(v2ClientName), }; return acc; }, {})) .sort(([, { v3ClientPackageName: a }], [, { v3ClientPackageName: b }]) => b.localeCompare(a)) .reduce((acc, [key, value]) => { acc[key] = value; return acc; }, {}); exports.getClientMetadataRecord = getClientMetadataRecord;