-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
34 lines (34 loc) · 1.02 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use strict';
export * from './src/any/index.js';
export * from './src/collection/index.js';
export * from './src/funcs/index.js';
export * from './src/reactive/index.js';
export * from './src/struct/index.js';
export function consume(_) { }
export function Boolean(value) {
return value === 'true';
}
export function requireDefined(object) {
if (object === undefined)
throw new ReferenceError('object should not be undefined!');
return object;
}
export function equal(left, right) {
if (left.length !== right.length)
return false;
for (let i = 0; i !== left.length; ++i) {
if (left[i] !== right[i])
return false;
}
return true;
}
export function swapInHolders(left, right) {
const aux = left.value;
left.value = right.value;
right.value = aux;
}
export function formatTime(seconds) {
const secondsPerMinute = 60;
return (`${Math.floor(Math.ceil(seconds) / secondsPerMinute)}:` +
`${(Math.ceil(seconds) % secondsPerMinute).toString().padStart(2, '0')}`);
}