@aliceplex/core
Version:
[![License][license_badge]][license] [![Pipelines][pipelines_badge]][pipelines] [![Coverage][coverage_badge]][pipelines] [![NPM][npm_badge]][npm] [![semantic-release][semantic_release_badge]][semantic_release]
15 lines • 602 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function convertSeasonSummary(seasonSummary) {
const result = new Map();
const keys = Object.keys(seasonSummary)
.map((key) => ({ key, value: parseInt(key) }))
.filter((key) => Number.isInteger(key.value) && key.value >= 0)
.sort((a, b) => a.value === b.value ? 0 : a.value > b.value ? 1 : -1);
keys.forEach((key) => {
result.set(key.value, seasonSummary[key.key]);
});
return result;
}
exports.convertSeasonSummary = convertSeasonSummary;
//# sourceMappingURL=utils.js.map