"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createCacheTimestampComparator = void 0;
const createCacheTimestampComparator = (locale) => {
    return (a, b) => {
        const aTimestamp = a.getLastModifiedTimestamp(locale);
        const bTimestamp = b.getLastModifiedTimestamp(locale);
        if (aTimestamp === bTimestamp) {
            return 0;
        }
        if (typeof aTimestamp === 'undefined') {
            return 1;
        }
        if (typeof bTimestamp === 'undefined') {
            return -1;
        }
        return bTimestamp - aTimestamp;
    };
};
exports.createCacheTimestampComparator = createCacheTimestampComparator;
