magic-utils-yonava 1.0.6 → 1.0.7
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/dist/index.d.ts
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
+
export * from "./utils/ctx";
|
|
2
|
+
export * from "./utils/deepDelta";
|
|
3
|
+
export * from "./utils/fracDecConverter";
|
|
4
|
+
export * from "./utils/maybeGetter";
|
|
5
|
+
export * from "./utils/clone";
|
|
6
|
+
export * from "./utils/colors";
|
|
7
|
+
export * from "./utils/debounce";
|
|
8
|
+
export * from "./utils/debugging";
|
|
9
|
+
export * from "./utils/deepMerge";
|
|
10
|
+
export * from "./utils/fps";
|
|
11
|
+
export * from "./utils/hashing";
|
|
12
|
+
export * from "./utils/id";
|
|
13
|
+
export * from "./utils/localStorage";
|
|
1
14
|
export * from "./utils/math";
|
|
15
|
+
export * from "./utils/mouse";
|
|
16
|
+
export * from "./utils/random";
|
|
17
|
+
export * from "./utils/sets";
|
|
18
|
+
export * from "./utils/string";
|
|
19
|
+
export * from "./utils/types";
|
package/dist/index.js
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
+
export * from "./utils/ctx";
|
|
2
|
+
export * from "./utils/deepDelta";
|
|
3
|
+
export * from "./utils/fracDecConverter";
|
|
4
|
+
export * from "./utils/maybeGetter";
|
|
5
|
+
export * from "./utils/clone";
|
|
6
|
+
export * from "./utils/colors";
|
|
7
|
+
export * from "./utils/debounce";
|
|
8
|
+
export * from "./utils/debugging";
|
|
9
|
+
export * from "./utils/deepMerge";
|
|
10
|
+
export * from "./utils/fps";
|
|
11
|
+
export * from "./utils/hashing";
|
|
12
|
+
export * from "./utils/id";
|
|
13
|
+
export * from "./utils/localStorage";
|
|
1
14
|
export * from "./utils/math";
|
|
15
|
+
export * from "./utils/mouse";
|
|
16
|
+
export * from "./utils/random";
|
|
17
|
+
export * from "./utils/sets";
|
|
18
|
+
export * from "./utils/string";
|
|
19
|
+
export * from "./utils/types";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
const gcd = (a, b) => (b ? gcd(b, a % b) : a);
|
|
2
2
|
export const isNullOrUnd = (input) => input === null || input === undefined;
|
|
3
3
|
export const isFraction = (input) => {
|
|
4
|
-
const fraction = input.trim().split(
|
|
4
|
+
const fraction = input.trim().split("/").filter(Boolean);
|
|
5
5
|
if (fraction.length !== 2)
|
|
6
6
|
return false;
|
|
7
7
|
const [numerator, denominator] = fraction.map(Number);
|
|
@@ -28,7 +28,7 @@ export const decimalToFraction = (decimalInput) => {
|
|
|
28
28
|
export const fractionToDecimal = (fractionInput) => {
|
|
29
29
|
if (!isFraction(fractionInput))
|
|
30
30
|
return;
|
|
31
|
-
const fraction = fractionInput.split(
|
|
31
|
+
const fraction = fractionInput.split("/");
|
|
32
32
|
const [numerator, denominator] = fraction.map(Number);
|
|
33
33
|
return numerator / denominator;
|
|
34
34
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,114 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "magic-utils-yonava",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"files": [
|
|
5
6
|
"dist"
|
|
6
7
|
],
|
|
8
|
+
"main": "dist/index.cjs.js",
|
|
9
|
+
"module": "dist/index.esm.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
7
11
|
"exports": {
|
|
8
|
-
".":
|
|
9
|
-
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.esm.js",
|
|
14
|
+
"require": "./dist/index.cjs.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./ctx": {
|
|
18
|
+
"import": "./dist/utils/ctx.js",
|
|
19
|
+
"require": "./dist/utils/ctx.cjs.js",
|
|
20
|
+
"types": "./dist/utils/ctx.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./deepDelta": {
|
|
23
|
+
"import": "./dist/utils/deepDelta.js",
|
|
24
|
+
"require": "./dist/utils/deepDelta.cjs.js",
|
|
25
|
+
"types": "./dist/utils/deepDelta.d.ts"
|
|
26
|
+
},
|
|
27
|
+
"./fracDecConverter": {
|
|
28
|
+
"import": "./dist/utils/fracDecConverter.js",
|
|
29
|
+
"require": "./dist/utils/fracDecConverter.cjs.js",
|
|
30
|
+
"types": "./dist/utils/fracDecConverter.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"./maybeGetter": {
|
|
33
|
+
"import": "./dist/utils/maybeGetter.js",
|
|
34
|
+
"require": "./dist/utils/maybeGetter.cjs.js",
|
|
35
|
+
"types": "./dist/utils/maybeGetter.d.ts"
|
|
36
|
+
},
|
|
37
|
+
"./clone": {
|
|
38
|
+
"import": "./dist/utils/clone.js",
|
|
39
|
+
"require": "./dist/utils/clone.cjs.js",
|
|
40
|
+
"types": "./dist/utils/clone.d.ts"
|
|
41
|
+
},
|
|
42
|
+
"./colors": {
|
|
43
|
+
"import": "./dist/utils/colors.js",
|
|
44
|
+
"require": "./dist/utils/colors.cjs.js",
|
|
45
|
+
"types": "./dist/utils/colors.d.ts"
|
|
46
|
+
},
|
|
47
|
+
"./debounce": {
|
|
48
|
+
"import": "./dist/utils/debounce.js",
|
|
49
|
+
"require": "./dist/utils/debounce.cjs.js",
|
|
50
|
+
"types": "./dist/utils/debounce.d.ts"
|
|
51
|
+
},
|
|
52
|
+
"./debugging": {
|
|
53
|
+
"import": "./dist/utils/debugging.js",
|
|
54
|
+
"require": "./dist/utils/debugging.cjs.js",
|
|
55
|
+
"types": "./dist/utils/debugging.d.ts"
|
|
56
|
+
},
|
|
57
|
+
"./deepMerge": {
|
|
58
|
+
"import": "./dist/utils/deepMerge.js",
|
|
59
|
+
"require": "./dist/utils/deepMerge.cjs.js",
|
|
60
|
+
"types": "./dist/utils/deepMerge.d.ts"
|
|
61
|
+
},
|
|
62
|
+
"./fps": {
|
|
63
|
+
"import": "./dist/utils/fps.js",
|
|
64
|
+
"require": "./dist/utils/fps.cjs.js",
|
|
65
|
+
"types": "./dist/utils/fps.d.ts"
|
|
66
|
+
},
|
|
67
|
+
"./hashing": {
|
|
68
|
+
"import": "./dist/utils/hashing.js",
|
|
69
|
+
"require": "./dist/utils/hashing.cjs.js",
|
|
70
|
+
"types": "./dist/utils/hashing.d.ts"
|
|
71
|
+
},
|
|
72
|
+
"./id": {
|
|
73
|
+
"import": "./dist/utils/id.js",
|
|
74
|
+
"require": "./dist/utils/id.cjs.js",
|
|
75
|
+
"types": "./dist/utils/id.d.ts"
|
|
76
|
+
},
|
|
77
|
+
"./localStorage": {
|
|
78
|
+
"import": "./dist/utils/localStorage.js",
|
|
79
|
+
"require": "./dist/utils/localStorage.cjs.js",
|
|
80
|
+
"types": "./dist/utils/localStorage.d.ts"
|
|
81
|
+
},
|
|
82
|
+
"./math": {
|
|
83
|
+
"import": "./dist/utils/math.js",
|
|
84
|
+
"require": "./dist/utils/math.cjs.js",
|
|
85
|
+
"types": "./dist/utils/math.d.ts"
|
|
86
|
+
},
|
|
87
|
+
"./mouse": {
|
|
88
|
+
"import": "./dist/utils/mouse.js",
|
|
89
|
+
"require": "./dist/utils/mouse.cjs.js",
|
|
90
|
+
"types": "./dist/utils/mouse.d.ts"
|
|
91
|
+
},
|
|
92
|
+
"./random": {
|
|
93
|
+
"import": "./dist/utils/random.js",
|
|
94
|
+
"require": "./dist/utils/random.cjs.js",
|
|
95
|
+
"types": "./dist/utils/random.d.ts"
|
|
96
|
+
},
|
|
97
|
+
"./sets": {
|
|
98
|
+
"import": "./dist/utils/sets.js",
|
|
99
|
+
"require": "./dist/utils/sets.cjs.js",
|
|
100
|
+
"types": "./dist/utils/sets.d.ts"
|
|
101
|
+
},
|
|
102
|
+
"./string": {
|
|
103
|
+
"import": "./dist/utils/string.js",
|
|
104
|
+
"require": "./dist/utils/string.cjs.js",
|
|
105
|
+
"types": "./dist/utils/string.d.ts"
|
|
106
|
+
},
|
|
107
|
+
"./types": {
|
|
108
|
+
"import": "./dist/utils/types.js",
|
|
109
|
+
"require": "./dist/utils/types.cjs.js",
|
|
110
|
+
"types": "./dist/utils/types.d.ts"
|
|
111
|
+
}
|
|
10
112
|
},
|
|
11
113
|
"repository": {
|
|
12
114
|
"type": "git",
|