UNPKG
@nteract/timeago
Version:
latest (3.6.5)
3.6.5
3.6.3
3.6.2
3.6.1
3.6.0
3.5.1
3.5.0
3.4.10
3.4.9
3.4.8
3.4.7
3.4.6
3.4.5
3.4.4
A simple Time-Ago component for React
github.com/nteract/nteract
nteract/nteract
@nteract/timeago
/
lib
/
defaultFormatter.js
14 lines
(11 loc)
•
254 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
"use strict"
;
Object
.
defineProperty
(
exports
,
"__esModule"
, {
value
:
true
});
exports
.
default
= defaultFormatter;
function
defaultFormatter
(
value, unit, suffix
) {
if
(value !==
1
) { unit +=
"s"
; }
return
value +
" "
+ unit +
" "
+ suffix; }