@mintlify/common 1.0.909 → 1.0.911

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/rss/dates.js CHANGED
@@ -33,17 +33,16 @@ export const getMostRepresentativeDate = (updateComponent, lineBlame, defaultDat
33
33
  for (const date of dates) {
34
34
  dateCounts.set(date, (dateCounts.get(date) || 0) + 1);
35
35
  }
36
- let mostCommonDate = defaultDate;
36
+ let mostCommonDate = '';
37
37
  let maxCount = 0;
38
38
  for (const [date, count] of dateCounts.entries()) {
39
- if (count > maxCount) {
39
+ const isTiedOlder = count === maxCount &&
40
+ mostCommonDate &&
41
+ new Date(date).getTime() < new Date(mostCommonDate).getTime();
42
+ if (count > maxCount || isTiedOlder) {
40
43
  maxCount = count;
41
44
  mostCommonDate = date;
42
45
  }
43
46
  }
44
- const threshold = dates.length * 0.9;
45
- if (maxCount >= threshold) {
46
- return mostCommonDate;
47
- }
48
- return defaultDate;
47
+ return mostCommonDate || defaultDate;
49
48
  };