index.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var formatDistanceLocale = {
  7. lessThanXSeconds: {
  8. one: 'segundo bat baino gutxiago',
  9. other: '{{count}} segundo baino gutxiago'
  10. },
  11. xSeconds: {
  12. one: '1 segundo',
  13. other: '{{count}} segundo'
  14. },
  15. halfAMinute: 'minutu erdi',
  16. lessThanXMinutes: {
  17. one: 'minutu bat baino gutxiago',
  18. other: '{{count}} minutu baino gutxiago'
  19. },
  20. xMinutes: {
  21. one: '1 minutu',
  22. other: '{{count}} minutu'
  23. },
  24. aboutXHours: {
  25. one: '1 ordu gutxi gorabehera',
  26. other: '{{count}} ordu gutxi gorabehera'
  27. },
  28. xHours: {
  29. one: '1 ordu',
  30. other: '{{count}} ordu'
  31. },
  32. xDays: {
  33. one: '1 egun',
  34. other: '{{count}} egun'
  35. },
  36. aboutXWeeks: {
  37. one: 'aste 1 inguru',
  38. other: '{{count}} aste inguru'
  39. },
  40. xWeeks: {
  41. one: '1 aste',
  42. other: '{{count}} astean'
  43. },
  44. aboutXMonths: {
  45. one: '1 hilabete gutxi gorabehera',
  46. other: '{{count}} hilabete gutxi gorabehera'
  47. },
  48. xMonths: {
  49. one: '1 hilabete',
  50. other: '{{count}} hilabete'
  51. },
  52. aboutXYears: {
  53. one: '1 urte gutxi gorabehera',
  54. other: '{{count}} urte gutxi gorabehera'
  55. },
  56. xYears: {
  57. one: '1 urte',
  58. other: '{{count}} urte'
  59. },
  60. overXYears: {
  61. one: '1 urte baino gehiago',
  62. other: '{{count}} urte baino gehiago'
  63. },
  64. almostXYears: {
  65. one: 'ia 1 urte',
  66. other: 'ia {{count}} urte'
  67. }
  68. };
  69. var formatDistance = function formatDistance(token, count, options) {
  70. var result;
  71. var tokenValue = formatDistanceLocale[token];
  72. if (typeof tokenValue === 'string') {
  73. result = tokenValue;
  74. } else if (count === 1) {
  75. result = tokenValue.one;
  76. } else {
  77. result = tokenValue.other.replace('{{count}}', String(count));
  78. }
  79. if (options !== null && options !== void 0 && options.addSuffix) {
  80. if (options.comparison && options.comparison > 0) {
  81. return 'en ' + result;
  82. } else {
  83. return 'duela ' + result;
  84. }
  85. }
  86. return result;
  87. };
  88. var _default = formatDistance;
  89. exports.default = _default;
  90. module.exports = exports.default;