javascript-time-ago 2.6.2 → 2.6.3
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/bundle/javascript-time-ago.js +1 -1
- package/bundle/javascript-time-ago.js.map +1 -1
- package/bundle/javascript-time-ago.min.js +1 -1
- package/bundle/javascript-time-ago.min.js.map +1 -1
- package/commonjs/FullDateFormatter.test.js +11 -9
- package/commonjs/FullDateFormatter.test.js.map +1 -1
- package/commonjs/TimeAgo.test.js +237 -236
- package/commonjs/TimeAgo.test.js.map +1 -1
- package/commonjs/cache.test.js +8 -6
- package/commonjs/cache.test.js.map +1 -1
- package/commonjs/isStyleObject.test.js +21 -19
- package/commonjs/isStyleObject.test.js.map +1 -1
- package/commonjs/locale.test.js +16 -14
- package/commonjs/locale.test.js.map +1 -1
- package/commonjs/steps/approximate.test.js +26 -24
- package/commonjs/steps/approximate.test.js.map +1 -1
- package/commonjs/steps/getStep.test.js +20 -18
- package/commonjs/steps/getStep.test.js.map +1 -1
- package/commonjs/steps/getStepDenominator.test.js +9 -7
- package/commonjs/steps/getStepDenominator.test.js.map +1 -1
- package/commonjs/steps/getStepMinTime.test.js +9 -7
- package/commonjs/steps/getStepMinTime.test.js.map +1 -1
- package/commonjs/steps/getTimeToNextUpdate.test.js +56 -54
- package/commonjs/steps/getTimeToNextUpdate.test.js.map +1 -1
- package/commonjs/steps/getTimeToNextUpdateForUnit.test.js +20 -18
- package/commonjs/steps/getTimeToNextUpdateForUnit.test.js.map +1 -1
- package/commonjs/steps/helpers.test.js +6 -4
- package/commonjs/steps/helpers.test.js.map +1 -1
- package/commonjs/steps/renameLegacyProperties.test.js +12 -10
- package/commonjs/steps/renameLegacyProperties.test.js.map +1 -1
- package/commonjs/steps/round.test.js +27 -25
- package/commonjs/steps/round.test.js.map +1 -1
- package/commonjs/style/approximateTime.test.js +6 -5
- package/commonjs/style/approximateTime.test.js.map +1 -1
- package/commonjs/style/mini.test.js +62 -60
- package/commonjs/style/mini.test.js.map +1 -1
- package/commonjs/style/miniMinute.test.js +27 -25
- package/commonjs/style/miniMinute.test.js.map +1 -1
- package/commonjs/style/miniMinuteNow.test.js +27 -25
- package/commonjs/style/miniMinuteNow.test.js.map +1 -1
- package/commonjs/style/miniNow.test.js +27 -25
- package/commonjs/style/miniNow.test.js.map +1 -1
- package/commonjs/style/renameLegacyProperties.test.js +9 -7
- package/commonjs/style/renameLegacyProperties.test.js.map +1 -1
- package/commonjs/style/round.test.js +81 -79
- package/commonjs/style/round.test.js.map +1 -1
- package/commonjs/style/roundMinute.test.js +50 -48
- package/commonjs/style/roundMinute.test.js.map +1 -1
- package/commonjs/style/twitter.test.js +86 -84
- package/commonjs/style/twitter.test.js.map +1 -1
- package/commonjs/style/twitterFirstMinute.test.js +33 -31
- package/commonjs/style/twitterFirstMinute.test.js.map +1 -1
- package/commonjs/style/twitterMinute.test.js +32 -30
- package/commonjs/style/twitterMinute.test.js.map +1 -1
- package/commonjs/style/twitterMinuteNow.test.js +32 -30
- package/commonjs/style/twitterMinuteNow.test.js.map +1 -1
- package/commonjs/style/twitterNow.test.js +34 -32
- package/commonjs/style/twitterNow.test.js.map +1 -1
- package/load-all-locales/index.cjs +15 -0
- package/load-all-locales/index.cjs.js +15 -0
- package/load-all-locales/index.js +30 -0
- package/locale/ak.json +8 -26
- package/locale/ak.json.js +8 -26
- package/locale/am.json +3 -3
- package/locale/am.json.js +3 -3
- package/locale/ba/package.json +16 -0
- package/locale/ba.json +159 -0
- package/locale/ba.json.d.ts +4 -0
- package/locale/ba.json.js +159 -0
- package/locale/be-tarask.json +4 -4
- package/locale/be-tarask.json.js +4 -4
- package/locale/be.json +4 -4
- package/locale/be.json.js +4 -4
- package/locale/bn.json +6 -6
- package/locale/bn.json.js +6 -6
- package/locale/bs.json +36 -30
- package/locale/bs.json.js +36 -30
- package/locale/bua/package.json +16 -0
- package/locale/bua.json +159 -0
- package/locale/bua.json.d.ts +4 -0
- package/locale/bua.json.js +159 -0
- package/locale/cv.json +134 -82
- package/locale/cv.json.js +134 -82
- package/locale/en-EE/package.json +16 -0
- package/locale/en-EE.json +219 -0
- package/locale/en-EE.json.d.ts +4 -0
- package/locale/en-EE.json.js +219 -0
- package/locale/en-GE/package.json +16 -0
- package/locale/en-GE.json +219 -0
- package/locale/en-GE.json.d.ts +4 -0
- package/locale/en-GE.json.js +219 -0
- package/locale/en-LT/package.json +16 -0
- package/locale/en-LT.json +219 -0
- package/locale/en-LT.json.d.ts +4 -0
- package/locale/en-LT.json.js +219 -0
- package/locale/en-LV/package.json +16 -0
- package/locale/en-LV.json +219 -0
- package/locale/en-LV.json.d.ts +4 -0
- package/locale/en-LV.json.js +219 -0
- package/locale/en-UA/package.json +16 -0
- package/locale/en-UA.json +219 -0
- package/locale/en-UA.json.d.ts +4 -0
- package/locale/en-UA.json.js +219 -0
- package/locale/es-MX.json +2 -8
- package/locale/es-MX.json.js +2 -8
- package/locale/fr-CA.json +4 -4
- package/locale/fr-CA.json.js +4 -4
- package/locale/fr.json +4 -4
- package/locale/fr.json.js +4 -4
- package/locale/he.json +74 -86
- package/locale/he.json.js +74 -86
- package/locale/ht.json +4 -4
- package/locale/ht.json.js +4 -4
- package/locale/ie.json +15 -9
- package/locale/ie.json.js +15 -9
- package/locale/kk-Arab/package.json +16 -0
- package/locale/kk-Arab.json +159 -0
- package/locale/kk-Arab.json.d.ts +4 -0
- package/locale/kk-Arab.json.js +159 -0
- package/locale/kok-Latn.json +138 -39
- package/locale/kok-Latn.json.js +138 -39
- package/locale/kok.json +169 -64
- package/locale/kok.json.js +169 -64
- package/locale/ku.json +166 -73
- package/locale/ku.json.js +166 -73
- package/locale/mk.json +20 -20
- package/locale/mk.json.js +20 -20
- package/locale/nso/package.json +16 -0
- package/locale/nso.json +159 -0
- package/locale/nso.json.d.ts +4 -0
- package/locale/nso.json.js +159 -0
- package/locale/rm.json +151 -85
- package/locale/rm.json.js +151 -85
- package/locale/ro.json +4 -2
- package/locale/ro.json.js +4 -2
- package/locale/rw/package.json +16 -0
- package/locale/rw.json +159 -0
- package/locale/rw.json.d.ts +4 -0
- package/locale/rw.json.js +159 -0
- package/locale/scn/package.json +16 -0
- package/locale/scn.json +249 -0
- package/locale/scn.json.d.ts +4 -0
- package/locale/scn.json.js +249 -0
- package/locale/sd-Deva/package.json +16 -0
- package/locale/sd-Deva.json +159 -0
- package/locale/sd-Deva.json.d.ts +4 -0
- package/locale/sd-Deva.json.js +159 -0
- package/locale/sd.json +77 -20
- package/locale/sd.json.js +77 -20
- package/locale/shn/package.json +16 -0
- package/locale/shn.json +159 -0
- package/locale/shn.json.d.ts +4 -0
- package/locale/shn.json.js +159 -0
- package/locale/sv.json +3 -3
- package/locale/sv.json.js +3 -3
- package/locale/syr.json +27 -27
- package/locale/syr.json.js +27 -27
- package/locale/ta.json +15 -9
- package/locale/ta.json.js +15 -9
- package/locale/tn.json +27 -27
- package/locale/tn.json.js +27 -27
- package/locale/tok/package.json +16 -0
- package/locale/tok.json +159 -0
- package/locale/tok.json.d.ts +4 -0
- package/locale/tok.json.js +159 -0
- package/locale/tyv/package.json +16 -0
- package/locale/tyv.json +159 -0
- package/locale/tyv.json.d.ts +4 -0
- package/locale/tyv.json.js +159 -0
- package/locale/xh.json +18 -18
- package/locale/xh.json.js +18 -18
- package/modules/FullDateFormatter.test.js +2 -0
- package/modules/FullDateFormatter.test.js.map +1 -1
- package/modules/TimeAgo.test.js +190 -189
- package/modules/TimeAgo.test.js.map +1 -1
- package/modules/cache.test.js +2 -0
- package/modules/cache.test.js.map +1 -1
- package/modules/isStyleObject.test.js +19 -17
- package/modules/isStyleObject.test.js.map +1 -1
- package/modules/locale.test.js +12 -10
- package/modules/locale.test.js.map +1 -1
- package/modules/steps/approximate.test.js +2 -0
- package/modules/steps/approximate.test.js.map +1 -1
- package/modules/steps/getStep.test.js +7 -5
- package/modules/steps/getStep.test.js.map +1 -1
- package/modules/steps/getStepDenominator.test.js +6 -4
- package/modules/steps/getStepDenominator.test.js.map +1 -1
- package/modules/steps/getStepMinTime.test.js +6 -4
- package/modules/steps/getStepMinTime.test.js.map +1 -1
- package/modules/steps/getTimeToNextUpdate.test.js +36 -34
- package/modules/steps/getTimeToNextUpdate.test.js.map +1 -1
- package/modules/steps/getTimeToNextUpdateForUnit.test.js +12 -10
- package/modules/steps/getTimeToNextUpdateForUnit.test.js.map +1 -1
- package/modules/steps/helpers.test.js +4 -2
- package/modules/steps/helpers.test.js.map +1 -1
- package/modules/steps/renameLegacyProperties.test.js +8 -6
- package/modules/steps/renameLegacyProperties.test.js.map +1 -1
- package/modules/steps/round.test.js +2 -0
- package/modules/steps/round.test.js.map +1 -1
- package/modules/style/approximateTime.test.js +3 -2
- package/modules/style/approximateTime.test.js.map +1 -1
- package/modules/style/mini.test.js +58 -56
- package/modules/style/mini.test.js.map +1 -1
- package/modules/style/miniMinute.test.js +25 -23
- package/modules/style/miniMinute.test.js.map +1 -1
- package/modules/style/miniMinuteNow.test.js +25 -23
- package/modules/style/miniMinuteNow.test.js.map +1 -1
- package/modules/style/miniNow.test.js +25 -23
- package/modules/style/miniNow.test.js.map +1 -1
- package/modules/style/renameLegacyProperties.test.js +6 -4
- package/modules/style/renameLegacyProperties.test.js.map +1 -1
- package/modules/style/round.test.js +76 -74
- package/modules/style/round.test.js.map +1 -1
- package/modules/style/roundMinute.test.js +47 -45
- package/modules/style/roundMinute.test.js.map +1 -1
- package/modules/style/twitter.test.js +72 -70
- package/modules/style/twitter.test.js.map +1 -1
- package/modules/style/twitterFirstMinute.test.js +29 -27
- package/modules/style/twitterFirstMinute.test.js.map +1 -1
- package/modules/style/twitterMinute.test.js +29 -27
- package/modules/style/twitterMinute.test.js.map +1 -1
- package/modules/style/twitterMinuteNow.test.js +29 -27
- package/modules/style/twitterMinuteNow.test.js.map +1 -1
- package/modules/style/twitterNow.test.js +31 -29
- package/modules/style/twitterNow.test.js.map +1 -1
- package/package.json +126 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twitterMinute.test.js","names":["twitter","TimeAgo","hour","minute","day","month","year","
|
|
1
|
+
{"version":3,"file":"twitterMinute.test.js","names":["describe","it","expect","twitter","TimeAgo","hour","minute","day","month","year","timeAgo","now","Date","getTime","formatInterval","secondsPassed","format","_objectSpread","round","to","equal"],"sources":["../../source/style/twitterMinute.test.js"],"sourcesContent":["import { describe, it } from 'mocha'\r\nimport { expect } from 'chai'\r\n\r\nimport twitter from './twitterMinute.js'\r\nimport TimeAgo from '../TimeAgo.js'\r\nimport { hour, minute, day, month, year } from '../steps/index.js'\r\n\r\ndescribe('style/twitterMinute', () => {\r\n\tit('should format Twitter style relative time (English) (round: \"floor\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2016.\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatInterval = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter, round: 'floor' })\r\n\r\n\t\texpect(formatInterval(0)).to.equal('0m')\r\n\t\texpect(formatInterval(59.9)).to.equal('0m')\r\n\t\texpect(formatInterval(60)).to.equal('1m')\r\n\t\texpect(formatInterval(1.9 * minute)).to.equal('1m')\r\n\t\texpect(formatInterval(2 * minute)).to.equal('2m')\r\n\t\texpect(formatInterval(2.9 * minute)).to.equal('2m')\r\n\t\texpect(formatInterval(3 * minute)).to.equal('3m')\r\n\t\t// …\r\n\t\texpect(formatInterval(59.9 * minute)).to.equal('59m')\r\n\t\texpect(formatInterval(60 * minute)).to.equal('1h')\r\n\t\texpect(formatInterval(1.9 * hour)).to.equal('1h')\r\n\t\texpect(formatInterval(2 * hour)).to.equal('2h')\r\n\t\texpect(formatInterval(2.9 * hour)).to.equal('2h')\r\n\t\texpect(formatInterval(3 * hour)).to.equal('3h')\r\n\t\t// …\r\n\t\texpect(formatInterval(23.9 * hour)).to.equal('23h')\r\n\t\texpect(formatInterval(day + 2 * minute + hour)).to.equal('Apr 9')\r\n\t\t// …\r\n\t\t// `month` is about 30.5 days.\r\n\t\texpect(formatInterval(month * 3)).to.equal('Jan 10')\r\n\t\texpect(formatInterval(month * 4)).to.equal('Dec 11, 2015')\r\n\t\texpect(formatInterval(year)).to.equal('Apr 11, 2015')\r\n\r\n\t\t// Test future dates.\r\n\t\t// `month` is about 30.5 days.\r\n\t\texpect(formatInterval(-1 * month * 8)).to.equal('Dec 10')\r\n\t\texpect(formatInterval(-1 * month * 9)).to.equal('Jan 9, 2017')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (English) (round: \"round\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2016.\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatInterval = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter, round: 'round' })\r\n\r\n\t\texpect(formatInterval(0)).to.equal('0m')\r\n\t\texpect(formatInterval(29.9)).to.equal('0m')\r\n\t\texpect(formatInterval(30)).to.equal('1m')\r\n\t\texpect(formatInterval(1.49 * minute)).to.equal('1m')\r\n\t\texpect(formatInterval(1.5 * minute)).to.equal('2m')\r\n\t\texpect(formatInterval(2.49 * minute)).to.equal('2m')\r\n\t\texpect(formatInterval(2.5 * minute)).to.equal('3m')\r\n\t})\r\n})"],"mappings":";;;;;;AAAA,SAASA,QAAQ,EAAEC,EAAE,QAAQ,OAAO;AACpC,SAASC,MAAM,QAAQ,MAAM;AAE7B,OAAOC,OAAO,MAAM,oBAAoB;AACxC,OAAOC,OAAO,MAAM,eAAe;AACnC,SAASC,IAAI,EAAEC,MAAM,EAAEC,GAAG,EAAEC,KAAK,EAAEC,IAAI,QAAQ,mBAAmB;AAElET,QAAQ,CAAC,qBAAqB,EAAE,YAAM;EACrCC,EAAE,CAAC,sEAAsE,EAAE,YAAM;IAChF,IAAMS,OAAO,GAAG,IAAIN,OAAO,CAAC,IAAI,CAAC;;IAEjC;IACA,IAAMO,GAAG,GAAG,IAAIC,IAAI,CAAC,IA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ignoreList":[]}
|
|
@@ -4,6 +4,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { describe, it } from 'mocha';
|
|
8
|
+
import { expect } from 'chai';
|
|
7
9
|
import twitter from './twitterMinuteNow.js';
|
|
8
10
|
import TimeAgo from '../TimeAgo.js';
|
|
9
11
|
import { hour, minute, day, month, year } from '../steps/index.js';
|
|
@@ -20,33 +22,33 @@ describe('style/twitterNow', function () {
|
|
|
20
22
|
round: 'floor'
|
|
21
23
|
}));
|
|
22
24
|
};
|
|
23
|
-
formatInterval(0).
|
|
24
|
-
formatInterval(59.9).
|
|
25
|
-
formatInterval(60).
|
|
26
|
-
formatInterval(1.9 * minute).
|
|
27
|
-
formatInterval(2 * minute).
|
|
28
|
-
formatInterval(2.9 * minute).
|
|
29
|
-
formatInterval(3 * minute).
|
|
25
|
+
expect(formatInterval(0)).to.equal('now');
|
|
26
|
+
expect(formatInterval(59.9)).to.equal('now');
|
|
27
|
+
expect(formatInterval(60)).to.equal('1m');
|
|
28
|
+
expect(formatInterval(1.9 * minute)).to.equal('1m');
|
|
29
|
+
expect(formatInterval(2 * minute)).to.equal('2m');
|
|
30
|
+
expect(formatInterval(2.9 * minute)).to.equal('2m');
|
|
31
|
+
expect(formatInterval(3 * minute)).to.equal('3m');
|
|
30
32
|
// …
|
|
31
|
-
formatInterval(59.9 * minute).
|
|
32
|
-
formatInterval(60 * minute).
|
|
33
|
-
formatInterval(1.9 * hour).
|
|
34
|
-
formatInterval(2 * hour).
|
|
35
|
-
formatInterval(2.9 * hour).
|
|
36
|
-
formatInterval(3 * hour).
|
|
33
|
+
expect(formatInterval(59.9 * minute)).to.equal('59m');
|
|
34
|
+
expect(formatInterval(60 * minute)).to.equal('1h');
|
|
35
|
+
expect(formatInterval(1.9 * hour)).to.equal('1h');
|
|
36
|
+
expect(formatInterval(2 * hour)).to.equal('2h');
|
|
37
|
+
expect(formatInterval(2.9 * hour)).to.equal('2h');
|
|
38
|
+
expect(formatInterval(3 * hour)).to.equal('3h');
|
|
37
39
|
// …
|
|
38
|
-
formatInterval(23.9 * hour).
|
|
39
|
-
formatInterval(day + 2 * minute + hour).
|
|
40
|
+
expect(formatInterval(23.9 * hour)).to.equal('23h');
|
|
41
|
+
expect(formatInterval(day + 2 * minute + hour)).to.equal('Apr 9');
|
|
40
42
|
// …
|
|
41
43
|
// `month` is about 30.5 days.
|
|
42
|
-
formatInterval(month * 3).
|
|
43
|
-
formatInterval(month * 4).
|
|
44
|
-
formatInterval(year).
|
|
44
|
+
expect(formatInterval(month * 3)).to.equal('Jan 10');
|
|
45
|
+
expect(formatInterval(month * 4)).to.equal('Dec 11, 2015');
|
|
46
|
+
expect(formatInterval(year)).to.equal('Apr 11, 2015');
|
|
45
47
|
|
|
46
48
|
// Test future dates.
|
|
47
49
|
// `month` is about 30.5 days.
|
|
48
|
-
formatInterval(-1 * month * 8).
|
|
49
|
-
formatInterval(-1 * month * 9).
|
|
50
|
+
expect(formatInterval(-1 * month * 8)).to.equal('Dec 10');
|
|
51
|
+
expect(formatInterval(-1 * month * 9)).to.equal('Jan 9, 2017');
|
|
50
52
|
});
|
|
51
53
|
it('should format Twitter style relative time (English) (round: "round")', function () {
|
|
52
54
|
var timeAgo = new TimeAgo('en');
|
|
@@ -60,13 +62,13 @@ describe('style/twitterNow', function () {
|
|
|
60
62
|
round: 'round'
|
|
61
63
|
}));
|
|
62
64
|
};
|
|
63
|
-
formatInterval(0).
|
|
64
|
-
formatInterval(29.9).
|
|
65
|
-
formatInterval(30).
|
|
66
|
-
formatInterval(1.49 * minute).
|
|
67
|
-
formatInterval(1.5 * minute).
|
|
68
|
-
formatInterval(2.49 * minute).
|
|
69
|
-
formatInterval(2.5 * minute).
|
|
65
|
+
expect(formatInterval(0)).to.equal('now');
|
|
66
|
+
expect(formatInterval(29.9)).to.equal('now');
|
|
67
|
+
expect(formatInterval(30)).to.equal('1m');
|
|
68
|
+
expect(formatInterval(1.49 * minute)).to.equal('1m');
|
|
69
|
+
expect(formatInterval(1.5 * minute)).to.equal('2m');
|
|
70
|
+
expect(formatInterval(2.49 * minute)).to.equal('2m');
|
|
71
|
+
expect(formatInterval(2.5 * minute)).to.equal('3m');
|
|
70
72
|
});
|
|
71
73
|
});
|
|
72
74
|
//# sourceMappingURL=twitterMinuteNow.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twitterMinuteNow.test.js","names":["twitter","TimeAgo","hour","minute","day","month","year","
|
|
1
|
+
{"version":3,"file":"twitterMinuteNow.test.js","names":["describe","it","expect","twitter","TimeAgo","hour","minute","day","month","year","timeAgo","now","Date","getTime","formatInterval","secondsPassed","format","_objectSpread","round","to","equal"],"sources":["../../source/style/twitterMinuteNow.test.js"],"sourcesContent":["import { describe, it } from 'mocha'\r\nimport { expect } from 'chai'\r\n\r\nimport twitter from './twitterMinuteNow.js'\r\nimport TimeAgo from '../TimeAgo.js'\r\nimport { hour, minute, day, month, year } from '../steps/index.js'\r\n\r\ndescribe('style/twitterNow', () => {\r\n\tit('should format Twitter style relative time (English) (round: \"floor\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2016.\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatInterval = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter, round: 'floor' })\r\n\r\n\t\texpect(formatInterval(0)).to.equal('now')\r\n\t\texpect(formatInterval(59.9)).to.equal('now')\r\n\t\texpect(formatInterval(60)).to.equal('1m')\r\n\t\texpect(formatInterval(1.9 * minute)).to.equal('1m')\r\n\t\texpect(formatInterval(2 * minute)).to.equal('2m')\r\n\t\texpect(formatInterval(2.9 * minute)).to.equal('2m')\r\n\t\texpect(formatInterval(3 * minute)).to.equal('3m')\r\n\t\t// …\r\n\t\texpect(formatInterval(59.9 * minute)).to.equal('59m')\r\n\t\texpect(formatInterval(60 * minute)).to.equal('1h')\r\n\t\texpect(formatInterval(1.9 * hour)).to.equal('1h')\r\n\t\texpect(formatInterval(2 * hour)).to.equal('2h')\r\n\t\texpect(formatInterval(2.9 * hour)).to.equal('2h')\r\n\t\texpect(formatInterval(3 * hour)).to.equal('3h')\r\n\t\t// …\r\n\t\texpect(formatInterval(23.9 * hour)).to.equal('23h')\r\n\t\texpect(formatInterval(day + 2 * minute + hour)).to.equal('Apr 9')\r\n\t\t// …\r\n\t\t// `month` is about 30.5 days.\r\n\t\texpect(formatInterval(month * 3)).to.equal('Jan 10')\r\n\t\texpect(formatInterval(month * 4)).to.equal('Dec 11, 2015')\r\n\t\texpect(formatInterval(year)).to.equal('Apr 11, 2015')\r\n\r\n\t\t// Test future dates.\r\n\t\t// `month` is about 30.5 days.\r\n\t\texpect(formatInterval(-1 * month * 8)).to.equal('Dec 10')\r\n\t\texpect(formatInterval(-1 * month * 9)).to.equal('Jan 9, 2017')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (English) (round: \"round\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2016.\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatInterval = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter, round: 'round' })\r\n\r\n\t\texpect(formatInterval(0)).to.equal('now')\r\n\t\texpect(formatInterval(29.9)).to.equal('now')\r\n\t\texpect(formatInterval(30)).to.equal('1m')\r\n\t\texpect(formatInterval(1.49 * minute)).to.equal('1m')\r\n\t\texpect(formatInterval(1.5 * minute)).to.equal('2m')\r\n\t\texpect(formatInterval(2.49 * minute)).to.equal('2m')\r\n\t\texpect(formatInterval(2.5 * minute)).to.equal('3m')\r\n\t})\r\n})"],"mappings":";;;;;;AAAA,SAASA,QAAQ,EAAEC,EAAE,QAAQ,OAAO;AACpC,SAASC,MAAM,QAAQ,MAAM;AAE7B,OAAOC,OAAO,MAAM,uBAAuB;AAC3C,OAAOC,OAAO,MAAM,eAAe;AACnC,SAASC,IAAI,EAAEC,MAAM,EAAEC,GAAG,EAAEC,KAAK,EAAEC,IAAI,QAAQ,mBAAmB;AAElET,QAAQ,CAAC,kBAAkB,EAAE,YAAM;EAClCC,EAAE,CAAC,sEAAsE,EAAE,YAAM;IAChF,IAAMS,OAAO,GAAG,IAAIN,OAAO,CAAC,IAAI,CAAC;;IAEjC;IACA,IAAMO,GAAG,GAAG,IAAIC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAACC,OAAO,CAAC,CAAC;IACnD,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,aAAa;MAAA,OAAKL,OAAO,CAACM,MAAM,CAACL,GAAG,GAAGI,aAAa,GAAG,IAAI,EAAAE,aAAA,CAAAA,aAAA;QAAIN,GAAG,EAAHA;MAAG,GAAKR,OAAO;QAAEe,KAAK,EAAE;MAAO,EAAE,CAAC;IAAA;IAEzHhB,MAAM,CAACY,cAAc,CAAC,CAAC,CAAC,CAAC,CAACK,EAAE,CAACC,KAAK,CAAC,KAAK,CAAC;IACzClB,MAAM,CAACY,cAAc,CAAC,IAAI,CAAC,CAAC,CAACK,EAAE,CAACC,KAAK,CAAC,KAAK,CAAC;IAC5ClB,MAAM,CAACY,cAAc,CAAC,EAAE,CAAC,CAAC,CAACK,EAAE,CAACC,KAAK,CAAC,IA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AAC;IACzClB,MAAM,CAACY,cAAc,CAAC,IAAI,CAAC,CAAC,CAACK,EAAE,CAACC,KAAK,CAAC,KAAK,CAAC;IAC5ClB,MAAM,CAACY,cAAc,CAAC,EAAE,CAAC,CAAC,CAACK,EAAE,CAACC,KAAK,CAAC,IAAI,CAAC;IACzClB,MAAM,CAACY,cAAc,CAAC,IAAI,GAAGR,MAAM,CAAC,CAAC,CAACa,EAAE,CAACC,KAAK,CAAC,IAAI,CAAC;IACpDlB,MAAM,CAACY,cAAc,CAAC,GAAG,GAAGR,MAAM,CAAC,CAAC,CAACa,EAAE,CAACC,KAAK,CAAC,IAAI,CAAC;IACnDlB,MAAM,CAACY,cAAc,CAAC,IAAI,GAAGR,MAAM,CAAC,CAAC,CAACa,EAAE,CAACC,KAAK,CAAC,IAAI,CAAC;IACpDlB,MAAM,CAACY,cAAc,CAAC,GAAG,GAAGR,MAAM,CAAC,CAAC,CAACa,EAAE,CAACC,KAAK,CAAC,IAAI,CAAC;EACpD,CAAC,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,6 +4,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { describe, it } from 'mocha';
|
|
8
|
+
import { expect } from 'chai';
|
|
7
9
|
import twitter from './twitterNow.js';
|
|
8
10
|
import TimeAgo from '../TimeAgo.js';
|
|
9
11
|
import { hour, minute, day, month, year } from '../steps/index.js';
|
|
@@ -20,35 +22,35 @@ describe('style/twitterNow', function () {
|
|
|
20
22
|
round: 'floor'
|
|
21
23
|
}));
|
|
22
24
|
};
|
|
23
|
-
formatInterval(0).
|
|
24
|
-
formatInterval(0.9).
|
|
25
|
-
formatInterval(1).
|
|
26
|
-
formatInterval(59.9).
|
|
27
|
-
formatInterval(60).
|
|
28
|
-
formatInterval(1.9 * minute).
|
|
29
|
-
formatInterval(2 * minute).
|
|
30
|
-
formatInterval(2.9 * minute).
|
|
31
|
-
formatInterval(3 * minute).
|
|
25
|
+
expect(formatInterval(0)).to.equal('now');
|
|
26
|
+
expect(formatInterval(0.9)).to.equal('now');
|
|
27
|
+
expect(formatInterval(1)).to.equal('1s');
|
|
28
|
+
expect(formatInterval(59.9)).to.equal('59s');
|
|
29
|
+
expect(formatInterval(60)).to.equal('1m');
|
|
30
|
+
expect(formatInterval(1.9 * minute)).to.equal('1m');
|
|
31
|
+
expect(formatInterval(2 * minute)).to.equal('2m');
|
|
32
|
+
expect(formatInterval(2.9 * minute)).to.equal('2m');
|
|
33
|
+
expect(formatInterval(3 * minute)).to.equal('3m');
|
|
32
34
|
// …
|
|
33
|
-
formatInterval(59.9 * minute).
|
|
34
|
-
formatInterval(60 * minute).
|
|
35
|
-
formatInterval(1.9 * hour).
|
|
36
|
-
formatInterval(2 * hour).
|
|
37
|
-
formatInterval(2.9 * hour).
|
|
38
|
-
formatInterval(3 * hour).
|
|
35
|
+
expect(formatInterval(59.9 * minute)).to.equal('59m');
|
|
36
|
+
expect(formatInterval(60 * minute)).to.equal('1h');
|
|
37
|
+
expect(formatInterval(1.9 * hour)).to.equal('1h');
|
|
38
|
+
expect(formatInterval(2 * hour)).to.equal('2h');
|
|
39
|
+
expect(formatInterval(2.9 * hour)).to.equal('2h');
|
|
40
|
+
expect(formatInterval(3 * hour)).to.equal('3h');
|
|
39
41
|
// …
|
|
40
|
-
formatInterval(23.9 * hour).
|
|
41
|
-
formatInterval(day + 2 * minute + hour).
|
|
42
|
+
expect(formatInterval(23.9 * hour)).to.equal('23h');
|
|
43
|
+
expect(formatInterval(day + 2 * minute + hour)).to.equal('Apr 9');
|
|
42
44
|
// …
|
|
43
45
|
// `month` is about 30.5 days.
|
|
44
|
-
formatInterval(month * 3).
|
|
45
|
-
formatInterval(month * 4).
|
|
46
|
-
formatInterval(year).
|
|
46
|
+
expect(formatInterval(month * 3)).to.equal('Jan 10');
|
|
47
|
+
expect(formatInterval(month * 4)).to.equal('Dec 11, 2015');
|
|
48
|
+
expect(formatInterval(year)).to.equal('Apr 11, 2015');
|
|
47
49
|
|
|
48
50
|
// Test future dates.
|
|
49
51
|
// `month` is about 30.5 days.
|
|
50
|
-
formatInterval(-1 * month * 8).
|
|
51
|
-
formatInterval(-1 * month * 9).
|
|
52
|
+
expect(formatInterval(-1 * month * 8)).to.equal('Dec 10');
|
|
53
|
+
expect(formatInterval(-1 * month * 9)).to.equal('Jan 9, 2017');
|
|
52
54
|
});
|
|
53
55
|
it('should format Twitter style relative time (Russian) (round: "floor")', function () {
|
|
54
56
|
var timeAgo = new TimeAgo('ru');
|
|
@@ -60,13 +62,13 @@ describe('style/twitterNow', function () {
|
|
|
60
62
|
round: 'floor'
|
|
61
63
|
}));
|
|
62
64
|
};
|
|
63
|
-
formatInterval(0).
|
|
64
|
-
formatInterval(0.9).
|
|
65
|
-
formatInterval(1).
|
|
66
|
-
formatInterval(60).
|
|
67
|
-
formatInterval(60 * minute).
|
|
68
|
-
formatInterval(day + 62 * minute).
|
|
69
|
-
formatInterval(year).
|
|
65
|
+
expect(formatInterval(0)).to.equal('сейчас');
|
|
66
|
+
expect(formatInterval(0.9)).to.equal('сейчас');
|
|
67
|
+
expect(formatInterval(1)).to.equal('1 с');
|
|
68
|
+
expect(formatInterval(60)).to.equal('1 мин');
|
|
69
|
+
expect(formatInterval(60 * minute)).to.equal('1 ч');
|
|
70
|
+
expect(formatInterval(day + 62 * minute)).to.equal('9 апр.');
|
|
71
|
+
expect(formatInterval(year)).to.equal('11 апр. 2015 г.');
|
|
70
72
|
});
|
|
71
73
|
});
|
|
72
74
|
//# sourceMappingURL=twitterNow.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twitterNow.test.js","names":["twitter","TimeAgo","hour","minute","day","month","year","
|
|
1
|
+
{"version":3,"file":"twitterNow.test.js","names":["describe","it","expect","twitter","TimeAgo","hour","minute","day","month","year","timeAgo","now","Date","getTime","formatInterval","secondsPassed","format","_objectSpread","round","to","equal"],"sources":["../../source/style/twitterNow.test.js"],"sourcesContent":["import { describe, it } from 'mocha'\r\nimport { expect } from 'chai'\r\n\r\nimport twitter from './twitterNow.js'\r\nimport TimeAgo from '../TimeAgo.js'\r\nimport { hour, minute, day, month, year } from '../steps/index.js'\r\n\r\ndescribe('style/twitterNow', () => {\r\n\tit('should format Twitter style relative time (English) (round: \"floor\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('en')\r\n\r\n\t\t// April 10th, 2016.\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatInterval = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter, round: 'floor' })\r\n\r\n\t\texpect(formatInterval(0)).to.equal('now')\r\n\t\texpect(formatInterval(0.9)).to.equal('now')\r\n\t\texpect(formatInterval(1)).to.equal('1s')\r\n\t\texpect(formatInterval(59.9)).to.equal('59s')\r\n\t\texpect(formatInterval(60)).to.equal('1m')\r\n\t\texpect(formatInterval(1.9 * minute)).to.equal('1m')\r\n\t\texpect(formatInterval(2 * minute)).to.equal('2m')\r\n\t\texpect(formatInterval(2.9 * minute)).to.equal('2m')\r\n\t\texpect(formatInterval(3 * minute)).to.equal('3m')\r\n\t\t// …\r\n\t\texpect(formatInterval(59.9 * minute)).to.equal('59m')\r\n\t\texpect(formatInterval(60 * minute)).to.equal('1h')\r\n\t\texpect(formatInterval(1.9 * hour)).to.equal('1h')\r\n\t\texpect(formatInterval(2 * hour)).to.equal('2h')\r\n\t\texpect(formatInterval(2.9 * hour)).to.equal('2h')\r\n\t\texpect(formatInterval(3 * hour)).to.equal('3h')\r\n\t\t// …\r\n\t\texpect(formatInterval(23.9 * hour)).to.equal('23h')\r\n\t\texpect(formatInterval(day + 2 * minute + hour)).to.equal('Apr 9')\r\n\t\t// …\r\n\t\t// `month` is about 30.5 days.\r\n\t\texpect(formatInterval(month * 3)).to.equal('Jan 10')\r\n\t\texpect(formatInterval(month * 4)).to.equal('Dec 11, 2015')\r\n\t\texpect(formatInterval(year)).to.equal('Apr 11, 2015')\r\n\r\n\t\t// Test future dates.\r\n\t\t// `month` is about 30.5 days.\r\n\t\texpect(formatInterval(-1 * month * 8)).to.equal('Dec 10')\r\n\t\texpect(formatInterval(-1 * month * 9)).to.equal('Jan 9, 2017')\r\n\t})\r\n\r\n\tit('should format Twitter style relative time (Russian) (round: \"floor\")', () => {\r\n\t\tconst timeAgo = new TimeAgo('ru')\r\n\r\n\t\tconst now = new Date(2016, 3, 10, 22, 59).getTime()\r\n\t\tconst formatInterval = (secondsPassed) => timeAgo.format(now - secondsPassed * 1000, { now, ...twitter, round: 'floor' })\r\n\r\n\t\texpect(formatInterval(0)).to.equal('сейчас')\r\n\t\texpect(formatInterval(0.9)).to.equal('сейчас')\r\n\t\texpect(formatInterval(1)).to.equal('1 с')\r\n\t\texpect(formatInterval(60)).to.equal('1 мин')\r\n\t\texpect(formatInterval(60 * minute)).to.equal('1 ч')\r\n\t\texpect(formatInterval(day + 62 * minute)).to.equal('9 апр.')\r\n\t\texpect(formatInterval(year)).to.equal('11 апр. 2015 г.')\r\n\t})\r\n})"],"mappings":";;;;;;AAAA,SAASA,QAAQ,EAAEC,EAAE,QAAQ,OAAO;AACpC,SAASC,MAAM,QAAQ,MAAM;AAE7B,OAAOC,OAAO,MAAM,iBAAiB;AACrC,OAAOC,OAAO,MAAM,eAAe;AACnC,SAASC,IAAI,EAAEC,MAAM,EAAEC,GAAG,EAA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AC,CAACK,EAAE,CAACC,KAAK,CAAC,OAAO,CAAC;IAC5ClB,MAAM,CAACY,cAAc,CAAC,EAAE,GAAGR,MAAM,CAAC,CAAC,CAACa,EAAE,CAACC,KAAK,CAAC,KAAK,CAAC;IACnDlB,MAAM,CAACY,cAAc,CAACP,GAAG,GAAG,EAAE,GAAGD,MAAM,CAAC,CAAC,CAACa,EAAE,CAACC,KAAK,CAAC,QAAQ,CAAC;IAC5DlB,MAAM,CAACY,cAAc,CAACL,IAAI,CAAC,CAAC,CAACU,EAAE,CAACC,KAAK,CAAC,iBAAiB,CAAC;EACzD,CAAC,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "javascript-time-ago",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3",
|
|
4
4
|
"description": "Localized relative date/time formatting",
|
|
5
5
|
"main": "index.cjs",
|
|
6
6
|
"module": "index.js",
|
|
@@ -101,6 +101,14 @@
|
|
|
101
101
|
"import": "./locale/az.json.js",
|
|
102
102
|
"require": "./locale/az.json"
|
|
103
103
|
},
|
|
104
|
+
"./locale/ba": {
|
|
105
|
+
"import": "./locale/ba.json.js",
|
|
106
|
+
"require": "./locale/ba.json"
|
|
107
|
+
},
|
|
108
|
+
"./locale/ba.json": {
|
|
109
|
+
"import": "./locale/ba.json.js",
|
|
110
|
+
"require": "./locale/ba.json"
|
|
111
|
+
},
|
|
104
112
|
"./locale/bal-Latn": {
|
|
105
113
|
"import": "./locale/bal-Latn.json.js",
|
|
106
114
|
"require": "./locale/bal-Latn.json"
|
|
@@ -189,6 +197,14 @@
|
|
|
189
197
|
"import": "./locale/bs.json.js",
|
|
190
198
|
"require": "./locale/bs.json"
|
|
191
199
|
},
|
|
200
|
+
"./locale/bua": {
|
|
201
|
+
"import": "./locale/bua.json.js",
|
|
202
|
+
"require": "./locale/bua.json"
|
|
203
|
+
},
|
|
204
|
+
"./locale/bua.json": {
|
|
205
|
+
"import": "./locale/bua.json.js",
|
|
206
|
+
"require": "./locale/bua.json"
|
|
207
|
+
},
|
|
192
208
|
"./locale/ca": {
|
|
193
209
|
"import": "./locale/ca.json.js",
|
|
194
210
|
"require": "./locale/ca.json"
|
|
@@ -509,6 +525,14 @@
|
|
|
509
525
|
"import": "./locale/en-DM.json.js",
|
|
510
526
|
"require": "./locale/en-DM.json"
|
|
511
527
|
},
|
|
528
|
+
"./locale/en-EE": {
|
|
529
|
+
"import": "./locale/en-EE.json.js",
|
|
530
|
+
"require": "./locale/en-EE.json"
|
|
531
|
+
},
|
|
532
|
+
"./locale/en-EE.json": {
|
|
533
|
+
"import": "./locale/en-EE.json.js",
|
|
534
|
+
"require": "./locale/en-EE.json"
|
|
535
|
+
},
|
|
512
536
|
"./locale/en-ER": {
|
|
513
537
|
"import": "./locale/en-ER.json.js",
|
|
514
538
|
"require": "./locale/en-ER.json"
|
|
@@ -581,6 +605,14 @@
|
|
|
581
605
|
"import": "./locale/en-GD.json.js",
|
|
582
606
|
"require": "./locale/en-GD.json"
|
|
583
607
|
},
|
|
608
|
+
"./locale/en-GE": {
|
|
609
|
+
"import": "./locale/en-GE.json.js",
|
|
610
|
+
"require": "./locale/en-GE.json"
|
|
611
|
+
},
|
|
612
|
+
"./locale/en-GE.json": {
|
|
613
|
+
"import": "./locale/en-GE.json.js",
|
|
614
|
+
"require": "./locale/en-GE.json"
|
|
615
|
+
},
|
|
584
616
|
"./locale/en-GG": {
|
|
585
617
|
"import": "./locale/en-GG.json.js",
|
|
586
618
|
"require": "./locale/en-GG.json"
|
|
@@ -773,6 +805,22 @@
|
|
|
773
805
|
"import": "./locale/en-LS.json.js",
|
|
774
806
|
"require": "./locale/en-LS.json"
|
|
775
807
|
},
|
|
808
|
+
"./locale/en-LT": {
|
|
809
|
+
"import": "./locale/en-LT.json.js",
|
|
810
|
+
"require": "./locale/en-LT.json"
|
|
811
|
+
},
|
|
812
|
+
"./locale/en-LT.json": {
|
|
813
|
+
"import": "./locale/en-LT.json.js",
|
|
814
|
+
"require": "./locale/en-LT.json"
|
|
815
|
+
},
|
|
816
|
+
"./locale/en-LV": {
|
|
817
|
+
"import": "./locale/en-LV.json.js",
|
|
818
|
+
"require": "./locale/en-LV.json"
|
|
819
|
+
},
|
|
820
|
+
"./locale/en-LV.json": {
|
|
821
|
+
"import": "./locale/en-LV.json.js",
|
|
822
|
+
"require": "./locale/en-LV.json"
|
|
823
|
+
},
|
|
776
824
|
"./locale/en-MG": {
|
|
777
825
|
"import": "./locale/en-MG.json.js",
|
|
778
826
|
"require": "./locale/en-MG.json"
|
|
@@ -1109,6 +1157,14 @@
|
|
|
1109
1157
|
"import": "./locale/en-TZ.json.js",
|
|
1110
1158
|
"require": "./locale/en-TZ.json"
|
|
1111
1159
|
},
|
|
1160
|
+
"./locale/en-UA": {
|
|
1161
|
+
"import": "./locale/en-UA.json.js",
|
|
1162
|
+
"require": "./locale/en-UA.json"
|
|
1163
|
+
},
|
|
1164
|
+
"./locale/en-UA.json": {
|
|
1165
|
+
"import": "./locale/en-UA.json.js",
|
|
1166
|
+
"require": "./locale/en-UA.json"
|
|
1167
|
+
},
|
|
1112
1168
|
"./locale/en-UG": {
|
|
1113
1169
|
"import": "./locale/en-UG.json.js",
|
|
1114
1170
|
"require": "./locale/en-UG.json"
|
|
@@ -1685,6 +1741,14 @@
|
|
|
1685
1741
|
"import": "./locale/kgp.json.js",
|
|
1686
1742
|
"require": "./locale/kgp.json"
|
|
1687
1743
|
},
|
|
1744
|
+
"./locale/kk-Arab": {
|
|
1745
|
+
"import": "./locale/kk-Arab.json.js",
|
|
1746
|
+
"require": "./locale/kk-Arab.json"
|
|
1747
|
+
},
|
|
1748
|
+
"./locale/kk-Arab.json": {
|
|
1749
|
+
"import": "./locale/kk-Arab.json.js",
|
|
1750
|
+
"require": "./locale/kk-Arab.json"
|
|
1751
|
+
},
|
|
1688
1752
|
"./locale/kk": {
|
|
1689
1753
|
"import": "./locale/kk.json.js",
|
|
1690
1754
|
"require": "./locale/kk.json"
|
|
@@ -1965,6 +2029,14 @@
|
|
|
1965
2029
|
"import": "./locale/nqo.json.js",
|
|
1966
2030
|
"require": "./locale/nqo.json"
|
|
1967
2031
|
},
|
|
2032
|
+
"./locale/nso": {
|
|
2033
|
+
"import": "./locale/nso.json.js",
|
|
2034
|
+
"require": "./locale/nso.json"
|
|
2035
|
+
},
|
|
2036
|
+
"./locale/nso.json": {
|
|
2037
|
+
"import": "./locale/nso.json.js",
|
|
2038
|
+
"require": "./locale/nso.json"
|
|
2039
|
+
},
|
|
1968
2040
|
"./locale/om": {
|
|
1969
2041
|
"import": "./locale/om.json.js",
|
|
1970
2042
|
"require": "./locale/om.json"
|
|
@@ -2165,6 +2237,14 @@
|
|
|
2165
2237
|
"import": "./locale/ru.json.js",
|
|
2166
2238
|
"require": "./locale/ru.json"
|
|
2167
2239
|
},
|
|
2240
|
+
"./locale/rw": {
|
|
2241
|
+
"import": "./locale/rw.json.js",
|
|
2242
|
+
"require": "./locale/rw.json"
|
|
2243
|
+
},
|
|
2244
|
+
"./locale/rw.json": {
|
|
2245
|
+
"import": "./locale/rw.json.js",
|
|
2246
|
+
"require": "./locale/rw.json"
|
|
2247
|
+
},
|
|
2168
2248
|
"./locale/sah": {
|
|
2169
2249
|
"import": "./locale/sah.json.js",
|
|
2170
2250
|
"require": "./locale/sah.json"
|
|
@@ -2181,6 +2261,22 @@
|
|
|
2181
2261
|
"import": "./locale/sc.json.js",
|
|
2182
2262
|
"require": "./locale/sc.json"
|
|
2183
2263
|
},
|
|
2264
|
+
"./locale/scn": {
|
|
2265
|
+
"import": "./locale/scn.json.js",
|
|
2266
|
+
"require": "./locale/scn.json"
|
|
2267
|
+
},
|
|
2268
|
+
"./locale/scn.json": {
|
|
2269
|
+
"import": "./locale/scn.json.js",
|
|
2270
|
+
"require": "./locale/scn.json"
|
|
2271
|
+
},
|
|
2272
|
+
"./locale/sd-Deva": {
|
|
2273
|
+
"import": "./locale/sd-Deva.json.js",
|
|
2274
|
+
"require": "./locale/sd-Deva.json"
|
|
2275
|
+
},
|
|
2276
|
+
"./locale/sd-Deva.json": {
|
|
2277
|
+
"import": "./locale/sd-Deva.json.js",
|
|
2278
|
+
"require": "./locale/sd-Deva.json"
|
|
2279
|
+
},
|
|
2184
2280
|
"./locale/sd": {
|
|
2185
2281
|
"import": "./locale/sd.json.js",
|
|
2186
2282
|
"require": "./locale/sd.json"
|
|
@@ -2205,6 +2301,14 @@
|
|
|
2205
2301
|
"import": "./locale/se.json.js",
|
|
2206
2302
|
"require": "./locale/se.json"
|
|
2207
2303
|
},
|
|
2304
|
+
"./locale/shn": {
|
|
2305
|
+
"import": "./locale/shn.json.js",
|
|
2306
|
+
"require": "./locale/shn.json"
|
|
2307
|
+
},
|
|
2308
|
+
"./locale/shn.json": {
|
|
2309
|
+
"import": "./locale/shn.json.js",
|
|
2310
|
+
"require": "./locale/shn.json"
|
|
2311
|
+
},
|
|
2208
2312
|
"./locale/si": {
|
|
2209
2313
|
"import": "./locale/si.json.js",
|
|
2210
2314
|
"require": "./locale/si.json"
|
|
@@ -2373,6 +2477,14 @@
|
|
|
2373
2477
|
"import": "./locale/to.json.js",
|
|
2374
2478
|
"require": "./locale/to.json"
|
|
2375
2479
|
},
|
|
2480
|
+
"./locale/tok": {
|
|
2481
|
+
"import": "./locale/tok.json.js",
|
|
2482
|
+
"require": "./locale/tok.json"
|
|
2483
|
+
},
|
|
2484
|
+
"./locale/tok.json": {
|
|
2485
|
+
"import": "./locale/tok.json.js",
|
|
2486
|
+
"require": "./locale/tok.json"
|
|
2487
|
+
},
|
|
2376
2488
|
"./locale/tr": {
|
|
2377
2489
|
"import": "./locale/tr.json.js",
|
|
2378
2490
|
"require": "./locale/tr.json"
|
|
@@ -2389,6 +2501,14 @@
|
|
|
2389
2501
|
"import": "./locale/tt.json.js",
|
|
2390
2502
|
"require": "./locale/tt.json"
|
|
2391
2503
|
},
|
|
2504
|
+
"./locale/tyv": {
|
|
2505
|
+
"import": "./locale/tyv.json.js",
|
|
2506
|
+
"require": "./locale/tyv.json"
|
|
2507
|
+
},
|
|
2508
|
+
"./locale/tyv.json": {
|
|
2509
|
+
"import": "./locale/tyv.json.js",
|
|
2510
|
+
"require": "./locale/tyv.json"
|
|
2511
|
+
},
|
|
2392
2512
|
"./locale/ug": {
|
|
2393
2513
|
"import": "./locale/ug.json.js",
|
|
2394
2514
|
"require": "./locale/ug.json"
|
|
@@ -2604,7 +2724,7 @@
|
|
|
2604
2724
|
"./load-all-locales/index.cjs.js"
|
|
2605
2725
|
],
|
|
2606
2726
|
"dependencies": {
|
|
2607
|
-
"relative-time-format": "^1.1.
|
|
2727
|
+
"relative-time-format": "^1.1.12"
|
|
2608
2728
|
},
|
|
2609
2729
|
"devDependencies": {
|
|
2610
2730
|
"@babel/cli": "^7.17.10",
|
|
@@ -2637,7 +2757,8 @@
|
|
|
2637
2757
|
"rollup-plugin-terser": "^7.0.2"
|
|
2638
2758
|
},
|
|
2639
2759
|
"scripts": {
|
|
2640
|
-
"test": "
|
|
2760
|
+
"test": "mocha --require ./test/addLocales.js --bail \"source/**/*.test.js\" \"test/*.test.js\" \"test/!(exports)/**/*.test.js\"",
|
|
2761
|
+
"test:exports": "mocha --bail \"test/exports/**/*.test.js\"",
|
|
2641
2762
|
"test-coverage": "npm-run-all build-commonjs build-commonjs-test-coverage-setup test-coverage-commonjs",
|
|
2642
2763
|
"test-coverage-commonjs": "node --experimental-json-modules node_modules/istanbul/lib/cli.js cover -x \"*.test.js\" node_modules/mocha/bin/_mocha -- --colors --reporter dot --require ./test/globals.js ./commonjs/addLocales.js \"commonjs/**/*.test.js\" --recursive",
|
|
2643
2764
|
"build-commonjs-test-coverage-setup": "cross-env babel ./test/addLocales.js ./test/addLabels.test.js --out-dir ./commonjs --source-maps",
|
|
@@ -2651,13 +2772,13 @@
|
|
|
2651
2772
|
"build-commonjs-package.json": "node scripts/create-commonjs-package-json.js",
|
|
2652
2773
|
"build-es6-modules": "cross-env BABEL_ENV=es6 babel ./source --out-dir ./modules --source-maps --ignore *.test.js",
|
|
2653
2774
|
"build": "npm-run-all clean-for-build build-commonjs build-es6-modules browser-build",
|
|
2654
|
-
"prepublishOnly": "npm-run-all generate-locales build test",
|
|
2655
2775
|
"update-relative-time-format": "npm install relative-time-format@latest --save",
|
|
2656
2776
|
"delete-locales": "rimraf ./locale/**/*",
|
|
2657
2777
|
"create-locales-directory": "mkdirp locale",
|
|
2658
2778
|
"generate-locale-messages": "node scripts/generate-locale-messages",
|
|
2659
2779
|
"generate-load-all-locales": "node scripts/generate-load-all-locales",
|
|
2660
|
-
"generate-locales": "npm-run-all update-relative-time-format delete-locales create-locales-directory generate-locale-messages generate-load-all-locales"
|
|
2780
|
+
"generate-locales": "npm-run-all update-relative-time-format delete-locales create-locales-directory generate-locale-messages generate-load-all-locales",
|
|
2781
|
+
"prepublishOnly": "npm-run-all generate-locales build test test:exports"
|
|
2661
2782
|
},
|
|
2662
2783
|
"repository": {
|
|
2663
2784
|
"type": "git",
|