πŸ“„ formatDistance.cjs
/home/palash/git/site/node_modules/date-fns/locale/bg/_lib/formatDistance.cjs
Language: cjs β€’ Lines: 105
"use strict";
exports.formatDistance = void 0;

const formatDistanceLocale = {
  lessThanXSeconds: {
    one: "ΠΏΠΎ-ΠΌΠ°Π»ΠΊΠΎ ΠΎΡ‚ сСкунда",
    other: "ΠΏΠΎ-ΠΌΠ°Π»ΠΊΠΎ ΠΎΡ‚ {{count}} сСкунди",
  },

  xSeconds: {
    one: "1 сСкунда",
    other: "{{count}} сСкунди",
  },

  halfAMinute: "ΠΏΠΎΠ»ΠΎΠ²ΠΈΠ½ ΠΌΠΈΠ½ΡƒΡ‚Π°",

  lessThanXMinutes: {
    one: "ΠΏΠΎ-ΠΌΠ°Π»ΠΊΠΎ ΠΎΡ‚ ΠΌΠΈΠ½ΡƒΡ‚Π°",
    other: "ΠΏΠΎ-ΠΌΠ°Π»ΠΊΠΎ ΠΎΡ‚ {{count}} ΠΌΠΈΠ½ΡƒΡ‚ΠΈ",
  },

  xMinutes: {
    one: "1 ΠΌΠΈΠ½ΡƒΡ‚Π°",
    other: "{{count}} ΠΌΠΈΠ½ΡƒΡ‚ΠΈ",
  },

  aboutXHours: {
    one: "ΠΎΠΊΠΎΠ»ΠΎ час",
    other: "ΠΎΠΊΠΎΠ»ΠΎ {{count}} часа",
  },

  xHours: {
    one: "1 час",
    other: "{{count}} часа",
  },

  xDays: {
    one: "1 Π΄Π΅Π½",
    other: "{{count}} Π΄Π½ΠΈ",
  },

  aboutXWeeks: {
    one: "ΠΎΠΊΠΎΠ»ΠΎ сСдмица",
    other: "ΠΎΠΊΠΎΠ»ΠΎ {{count}} сСдмици",
  },

  xWeeks: {
    one: "1 сСдмица",
    other: "{{count}} сСдмици",
  },

  aboutXMonths: {
    one: "ΠΎΠΊΠΎΠ»ΠΎ мСсСц",
    other: "ΠΎΠΊΠΎΠ»ΠΎ {{count}} мСсСца",
  },

  xMonths: {
    one: "1 мСсСц",
    other: "{{count}} мСсСца",
  },

  aboutXYears: {
    one: "ΠΎΠΊΠΎΠ»ΠΎ Π³ΠΎΠ΄ΠΈΠ½Π°",
    other: "ΠΎΠΊΠΎΠ»ΠΎ {{count}} Π³ΠΎΠ΄ΠΈΠ½ΠΈ",
  },

  xYears: {
    one: "1 Π³ΠΎΠ΄ΠΈΠ½Π°",
    other: "{{count}} Π³ΠΎΠ΄ΠΈΠ½ΠΈ",
  },

  overXYears: {
    one: "Π½Π°Π΄ Π³ΠΎΠ΄ΠΈΠ½Π°",
    other: "Π½Π°Π΄ {{count}} Π³ΠΎΠ΄ΠΈΠ½ΠΈ",
  },

  almostXYears: {
    one: "ΠΏΠΎΡ‡Ρ‚ΠΈ Π³ΠΎΠ΄ΠΈΠ½Π°",
    other: "ΠΏΠΎΡ‡Ρ‚ΠΈ {{count}} Π³ΠΎΠ΄ΠΈΠ½ΠΈ",
  },
};

const formatDistance = (token, count, options) => {
  let result;

  const tokenValue = formatDistanceLocale[token];
  if (typeof tokenValue === "string") {
    result = tokenValue;
  } else if (count === 1) {
    result = tokenValue.one;
  } else {
    result = tokenValue.other.replace("{{count}}", String(count));
  }

  if (options?.addSuffix) {
    if (options.comparison && options.comparison > 0) {
      return "слСд " + result;
    } else {
      return "ΠΏΡ€Π΅Π΄ΠΈ " + result;
    }
  }

  return result;
};
exports.formatDistance = formatDistance;