📄 formatDistance.cjs
/home/palash/git/site/node_modules/date-fns/locale/bn/_lib/formatDistance.cjs
Language: cjs â€ĸ Lines: 109
"use strict";
exports.formatDistance = void 0;
var _index = require("./localize.cjs");

const formatDistanceLocale = {
  lessThanXSeconds: {
    one: "āĻĒā§āϰāĻžā§Ÿ ā§§ āϏ⧇āϕ⧇āĻ¨ā§āĻĄ",
    other: "āĻĒā§āϰāĻžā§Ÿ {{count}} āϏ⧇āϕ⧇āĻ¨ā§āĻĄ",
  },

  xSeconds: {
    one: "ā§§ āϏ⧇āϕ⧇āĻ¨ā§āĻĄ",
    other: "{{count}} āϏ⧇āϕ⧇āĻ¨ā§āĻĄ",
  },

  halfAMinute: "āφāϧ āĻŽāĻŋāύāĻŋāϟ",

  lessThanXMinutes: {
    one: "āĻĒā§āϰāĻžā§Ÿ ā§§ āĻŽāĻŋāύāĻŋāϟ",
    other: "āĻĒā§āϰāĻžā§Ÿ {{count}} āĻŽāĻŋāύāĻŋāϟ",
  },

  xMinutes: {
    one: "ā§§ āĻŽāĻŋāύāĻŋāϟ",
    other: "{{count}} āĻŽāĻŋāύāĻŋāϟ",
  },

  aboutXHours: {
    one: "āĻĒā§āϰāĻžā§Ÿ ā§§ āϘāĻ¨ā§āϟāĻž",
    other: "āĻĒā§āϰāĻžā§Ÿ {{count}} āϘāĻ¨ā§āϟāĻž",
  },

  xHours: {
    one: "ā§§ āϘāĻ¨ā§āϟāĻž",
    other: "{{count}} āϘāĻ¨ā§āϟāĻž",
  },

  xDays: {
    one: "ā§§ āĻĻāĻŋāύ",
    other: "{{count}} āĻĻāĻŋāύ",
  },

  aboutXWeeks: {
    one: "āĻĒā§āϰāĻžā§Ÿ ā§§ āϏāĻĒā§āϤāĻžāĻš",
    other: "āĻĒā§āϰāĻžā§Ÿ {{count}} āϏāĻĒā§āϤāĻžāĻš",
  },

  xWeeks: {
    one: "ā§§ āϏāĻĒā§āϤāĻžāĻš",
    other: "{{count}} āϏāĻĒā§āϤāĻžāĻš",
  },

  aboutXMonths: {
    one: "āĻĒā§āϰāĻžā§Ÿ ā§§ āĻŽāĻžāϏ",
    other: "āĻĒā§āϰāĻžā§Ÿ {{count}} āĻŽāĻžāϏ",
  },

  xMonths: {
    one: "ā§§ āĻŽāĻžāϏ",
    other: "{{count}} āĻŽāĻžāϏ",
  },

  aboutXYears: {
    one: "āĻĒā§āϰāĻžā§Ÿ ā§§ āĻŦāĻ›āϰ",
    other: "āĻĒā§āϰāĻžā§Ÿ {{count}} āĻŦāĻ›āϰ",
  },

  xYears: {
    one: "ā§§ āĻŦāĻ›āϰ",
    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}}",
      (0, _index.numberToLocale)(count),
    );
  }

  if (options?.addSuffix) {
    if (options.comparison && options.comparison > 0) {
      return result + " āĻāϰ āĻŽāĻ§ā§āϝ⧇";
    } else {
      return result + " āφāϗ⧇";
    }
  }

  return result;
};
exports.formatDistance = formatDistance;