UNPKG
@doegis/core
Version:
latest (0.1.0)
0.1.0
DOE GIS API
@doegis/core
/
symbols
/
cim
/
quantizeTime.js
3 lines
(1 loc)
•
196 B
JavaScript
View Raw
1
2
3
const
t=
.05
;
function
n
(
n
){
return
Math
.
max
(
Math
.
round
(n/t),
1
)*t}
const
e=
new
Set
([
"StartTimeOffset"
,
"Duration"
,
"RepeatDelay"
]);
function
a
(
t,a
){
return
e.
has
(a)?
n
(t):t}
export
{a
as
quantizeIfNeeded};