index.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var formatDistanceLocale = {
  7. lessThanXSeconds: {
  8. standalone: {
  9. one: 'vähem kui üks sekund',
  10. other: 'vähem kui {{count}} sekundit'
  11. },
  12. withPreposition: {
  13. one: 'vähem kui ühe sekundi',
  14. other: 'vähem kui {{count}} sekundi'
  15. }
  16. },
  17. xSeconds: {
  18. standalone: {
  19. one: 'üks sekund',
  20. other: '{{count}} sekundit'
  21. },
  22. withPreposition: {
  23. one: 'ühe sekundi',
  24. other: '{{count}} sekundi'
  25. }
  26. },
  27. halfAMinute: {
  28. standalone: 'pool minutit',
  29. withPreposition: 'poole minuti'
  30. },
  31. lessThanXMinutes: {
  32. standalone: {
  33. one: 'vähem kui üks minut',
  34. other: 'vähem kui {{count}} minutit'
  35. },
  36. withPreposition: {
  37. one: 'vähem kui ühe minuti',
  38. other: 'vähem kui {{count}} minuti'
  39. }
  40. },
  41. xMinutes: {
  42. standalone: {
  43. one: 'üks minut',
  44. other: '{{count}} minutit'
  45. },
  46. withPreposition: {
  47. one: 'ühe minuti',
  48. other: '{{count}} minuti'
  49. }
  50. },
  51. aboutXHours: {
  52. standalone: {
  53. one: 'umbes üks tund',
  54. other: 'umbes {{count}} tundi'
  55. },
  56. withPreposition: {
  57. one: 'umbes ühe tunni',
  58. other: 'umbes {{count}} tunni'
  59. }
  60. },
  61. xHours: {
  62. standalone: {
  63. one: 'üks tund',
  64. other: '{{count}} tundi'
  65. },
  66. withPreposition: {
  67. one: 'ühe tunni',
  68. other: '{{count}} tunni'
  69. }
  70. },
  71. xDays: {
  72. standalone: {
  73. one: 'üks päev',
  74. other: '{{count}} päeva'
  75. },
  76. withPreposition: {
  77. one: 'ühe päeva',
  78. other: '{{count}} päeva'
  79. }
  80. },
  81. aboutXWeeks: {
  82. standalone: {
  83. one: 'umbes üks nädal',
  84. other: 'umbes {{count}} nädalat'
  85. },
  86. withPreposition: {
  87. one: 'umbes ühe nädala',
  88. other: 'umbes {{count}} nädala'
  89. }
  90. },
  91. xWeeks: {
  92. standalone: {
  93. one: 'üks nädal',
  94. other: '{{count}} nädalat'
  95. },
  96. withPreposition: {
  97. one: 'ühe nädala',
  98. other: '{{count}} nädala'
  99. }
  100. },
  101. aboutXMonths: {
  102. standalone: {
  103. one: 'umbes üks kuu',
  104. other: 'umbes {{count}} kuud'
  105. },
  106. withPreposition: {
  107. one: 'umbes ühe kuu',
  108. other: 'umbes {{count}} kuu'
  109. }
  110. },
  111. xMonths: {
  112. standalone: {
  113. one: 'üks kuu',
  114. other: '{{count}} kuud'
  115. },
  116. withPreposition: {
  117. one: 'ühe kuu',
  118. other: '{{count}} kuu'
  119. }
  120. },
  121. aboutXYears: {
  122. standalone: {
  123. one: 'umbes üks aasta',
  124. other: 'umbes {{count}} aastat'
  125. },
  126. withPreposition: {
  127. one: 'umbes ühe aasta',
  128. other: 'umbes {{count}} aasta'
  129. }
  130. },
  131. xYears: {
  132. standalone: {
  133. one: 'üks aasta',
  134. other: '{{count}} aastat'
  135. },
  136. withPreposition: {
  137. one: 'ühe aasta',
  138. other: '{{count}} aasta'
  139. }
  140. },
  141. overXYears: {
  142. standalone: {
  143. one: 'rohkem kui üks aasta',
  144. other: 'rohkem kui {{count}} aastat'
  145. },
  146. withPreposition: {
  147. one: 'rohkem kui ühe aasta',
  148. other: 'rohkem kui {{count}} aasta'
  149. }
  150. },
  151. almostXYears: {
  152. standalone: {
  153. one: 'peaaegu üks aasta',
  154. other: 'peaaegu {{count}} aastat'
  155. },
  156. withPreposition: {
  157. one: 'peaaegu ühe aasta',
  158. other: 'peaaegu {{count}} aasta'
  159. }
  160. }
  161. };
  162. var formatDistance = function formatDistance(token, count, options) {
  163. var usageGroup = options !== null && options !== void 0 && options.addSuffix ? formatDistanceLocale[token].withPreposition : formatDistanceLocale[token].standalone;
  164. var result;
  165. if (typeof usageGroup === 'string') {
  166. result = usageGroup;
  167. } else if (count === 1) {
  168. result = usageGroup.one;
  169. } else {
  170. result = usageGroup.other.replace('{{count}}', String(count));
  171. }
  172. if (options !== null && options !== void 0 && options.addSuffix) {
  173. if (options.comparison && options.comparison > 0) {
  174. return result + ' pärast';
  175. } else {
  176. return result + ' eest';
  177. }
  178. }
  179. return result;
  180. };
  181. var _default = formatDistance;
  182. exports.default = _default;
  183. module.exports = exports.default;