toosoon-utils 1.0.6 → 1.2.0
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/README.md +651 -144
- package/lib/classes/_pool.d.ts +56 -0
- package/lib/classes/_pool.js +92 -0
- package/lib/classes/color-scale.d.ts +52 -0
- package/lib/classes/color-scale.js +160 -0
- package/lib/classes/frame-rate.d.ts +25 -0
- package/lib/classes/frame-rate.js +48 -0
- package/lib/colors.d.ts +9 -1
- package/lib/colors.js +59 -64
- package/lib/constants.d.ts +155 -155
- package/lib/constants.js +161 -164
- package/lib/dom.d.ts +2 -2
- package/lib/dom.js +5 -11
- package/lib/files.d.ts +1 -1
- package/lib/files.js +3 -8
- package/lib/functions.d.ts +6 -2
- package/lib/functions.js +30 -10
- package/lib/geometry.d.ts +2 -2
- package/lib/geometry.js +15 -27
- package/lib/maths.d.ts +11 -9
- package/lib/maths.js +32 -51
- package/lib/random.d.ts +24 -24
- package/lib/random.js +36 -53
- package/lib/strings.js +2 -7
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types.d.ts +8 -5
- package/lib/types.js +1 -2
- package/package.json +5 -5
- package/src/classes/_pool.ts +92 -0
- package/src/classes/color-scale.ts +181 -0
- package/src/classes/frame-rate.ts +49 -0
- package/src/colors.ts +32 -19
- package/src/constants.ts +155 -155
- package/src/dom.ts +3 -3
- package/src/files.ts +1 -1
- package/src/functions.ts +27 -2
- package/src/geometry.ts +2 -2
- package/src/maths.ts +23 -12
- package/src/random.ts +24 -24
- package/src/types.ts +18 -9
- package/tsconfig.json +2 -1
- package/src/index.ts +0 -11
- package/src/now.ts +0 -26
package/src/now.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Polyfill for "now()" functions
|
|
3
|
-
*/
|
|
4
|
-
let now: () => number;
|
|
5
|
-
|
|
6
|
-
// In node.js, use process.hrtime
|
|
7
|
-
if (typeof process !== 'undefined' && process.hrtime) {
|
|
8
|
-
now = function () {
|
|
9
|
-
// Convert [seconds, nanoseconds] to milliseconds
|
|
10
|
-
const time = process.hrtime();
|
|
11
|
-
return time[0] * 1000 + time[1] / 1000000;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
// In a browser use performance or Date
|
|
15
|
-
else if (typeof performance !== 'undefined') {
|
|
16
|
-
// This must be bound, because directly assigning this function leads to an invocation exception in Chrome
|
|
17
|
-
now = performance.now.bind(performance);
|
|
18
|
-
} else if (typeof Date.now !== 'undefined') {
|
|
19
|
-
now = Date.now;
|
|
20
|
-
} else {
|
|
21
|
-
now = function () {
|
|
22
|
-
return new Date().getTime();
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export default now;
|