UNPKG
@onesy/date
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
Time and date utils library
github.com/onesy-me/date
onesy-me/date
@onesy/date
/
max.js
8 lines
(7 loc)
•
248 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
"use strict"
;
Object
.
defineProperty
(
exports
,
"__esModule"
, {
value
:
true
});
function
max
(
values = []
) {
if
(values.
every
(
value
=>
value.
valid
))
return
values.
sort
(
(
a, b
) =>
b.
milliseconds
- a.
milliseconds
)[
0
]; }
exports
.
default
= max;