magic-utils-yonava 1.0.2 → 1.0.4
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/clone.d.ts +9 -0
- package/dist/clone.js +15 -0
- package/dist/clone.test.d.ts +1 -0
- package/dist/clone.test.js +42 -0
- package/dist/colors.d.ts +522 -0
- package/{src/colors.ts → dist/colors.js} +224 -274
- package/dist/ctx/index.d.ts +10 -0
- package/dist/ctx/index.js +19 -0
- package/dist/debounce.d.ts +9 -0
- package/{src/debounce.ts → dist/debounce.js} +6 -6
- package/dist/debugging.d.ts +2 -0
- package/dist/debugging.js +21 -0
- package/dist/deepDelta/delta.test.d.ts +1 -0
- package/dist/deepDelta/delta.test.js +114 -0
- package/dist/deepDelta/index.d.ts +8 -0
- package/dist/deepDelta/index.js +40 -0
- package/dist/deepMerge.d.ts +16 -0
- package/dist/deepMerge.js +32 -0
- package/dist/deepMerge.test.d.ts +1 -0
- package/dist/deepMerge.test.js +68 -0
- package/dist/fps.d.ts +6 -0
- package/dist/fps.js +51 -0
- package/dist/fracDecConverter/index.d.ts +9 -0
- package/dist/fracDecConverter/index.js +34 -0
- package/dist/hashing.d.ts +2 -0
- package/dist/hashing.js +7 -0
- package/dist/id.d.ts +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/localStorage.d.ts +37 -0
- package/dist/localStorage.js +22 -0
- package/dist/math.d.ts +60 -0
- package/{src/math.ts → dist/math.js} +28 -32
- package/dist/math.test.d.ts +1 -0
- package/dist/math.test.js +42 -0
- package/{src/maybeGetter/index.ts → dist/maybeGetter/index.d.ts} +3 -18
- package/dist/maybeGetter/index.js +15 -0
- package/dist/mouse.d.ts +8 -0
- package/{src/mouse.ts → dist/mouse.js} +4 -4
- package/dist/random.d.ts +19 -0
- package/dist/random.js +21 -0
- package/dist/sets.d.ts +8 -0
- package/{src/sets.ts → dist/sets.js} +2 -2
- package/dist/string.d.ts +21 -0
- package/{src/string.ts → dist/string.js} +11 -11
- package/dist/string.test.d.ts +1 -0
- package/dist/string.test.js +14 -0
- package/{src/types.ts → dist/types.d.ts} +13 -38
- package/dist/types.js +1 -0
- package/dist/utils/clone.d.ts +9 -0
- package/dist/utils/clone.js +15 -0
- package/dist/utils/clone.test.d.ts +1 -0
- package/dist/utils/clone.test.js +42 -0
- package/dist/utils/colors.d.ts +522 -0
- package/dist/utils/colors.js +517 -0
- package/dist/utils/ctx/index.d.ts +10 -0
- package/dist/utils/ctx/index.js +19 -0
- package/dist/utils/debounce.d.ts +9 -0
- package/dist/utils/debounce.js +15 -0
- package/dist/utils/debugging.d.ts +2 -0
- package/dist/utils/debugging.js +21 -0
- package/dist/utils/deepDelta/delta.test.d.ts +1 -0
- package/dist/utils/deepDelta/delta.test.js +114 -0
- package/dist/utils/deepDelta/index.d.ts +8 -0
- package/dist/utils/deepDelta/index.js +40 -0
- package/dist/utils/deepMerge.d.ts +16 -0
- package/dist/utils/deepMerge.js +32 -0
- package/dist/utils/deepMerge.test.d.ts +1 -0
- package/dist/utils/deepMerge.test.js +68 -0
- package/dist/utils/fps.d.ts +6 -0
- package/dist/utils/fps.js +51 -0
- package/dist/utils/fracDecConverter/index.d.ts +9 -0
- package/dist/utils/fracDecConverter/index.js +34 -0
- package/dist/utils/hashing.d.ts +2 -0
- package/dist/utils/hashing.js +7 -0
- package/dist/utils/id.d.ts +5 -0
- package/dist/utils/id.js +5 -0
- package/dist/utils/localStorage.d.ts +37 -0
- package/dist/utils/localStorage.js +22 -0
- package/dist/utils/math.d.ts +60 -0
- package/dist/utils/math.js +89 -0
- package/dist/utils/math.test.d.ts +1 -0
- package/dist/utils/math.test.js +42 -0
- package/dist/utils/maybeGetter/index.d.ts +26 -0
- package/dist/utils/maybeGetter/index.js +15 -0
- package/dist/utils/mouse.d.ts +8 -0
- package/dist/utils/mouse.js +8 -0
- package/dist/utils/random.d.ts +19 -0
- package/dist/utils/random.js +21 -0
- package/dist/utils/sets.d.ts +8 -0
- package/dist/utils/sets.js +10 -0
- package/dist/utils/string.d.ts +21 -0
- package/dist/utils/string.js +31 -0
- package/dist/utils/string.test.d.ts +1 -0
- package/dist/utils/string.test.js +14 -0
- package/dist/utils/types.d.ts +54 -0
- package/dist/utils/types.js +1 -0
- package/package.json +4 -1
- package/src/clone.test.ts +0 -47
- package/src/clone.ts +0 -15
- package/src/ctx/index.ts +0 -20
- package/src/debugging.ts +0 -23
- package/src/deepDelta/delta.test.ts +0 -129
- package/src/deepDelta/index.ts +0 -48
- package/src/deepMerge.test.ts +0 -89
- package/src/deepMerge.ts +0 -37
- package/src/fps.ts +0 -64
- package/src/fracDecConverter/index.ts +0 -36
- package/src/hashing.ts +0 -9
- package/src/localStorage.ts +0 -49
- package/src/math.test.ts +0 -57
- package/src/random.ts +0 -27
- package/src/string.test.ts +0 -17
- package/tsconfig.json +0 -20
- /package/{src/id.ts → dist/id.js} +0 -0
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* all tailwind gray colors
|
|
3
|
+
*/
|
|
4
|
+
export const GRAY_50 = '#f9fafb';
|
|
5
|
+
export const GRAY_100 = '#f3f4f6';
|
|
6
|
+
export const GRAY_200 = '#e5e7eb';
|
|
7
|
+
export const GRAY_300 = '#d1d5db';
|
|
8
|
+
export const GRAY_400 = '#9ca3af';
|
|
9
|
+
export const GRAY_500 = '#6b7280';
|
|
10
|
+
export const GRAY_600 = '#4b5563';
|
|
11
|
+
export const GRAY_700 = '#374151';
|
|
12
|
+
export const GRAY_800 = '#1f2937';
|
|
13
|
+
export const GRAY_900 = '#111827';
|
|
14
|
+
/**
|
|
15
|
+
* all tailwind red colors
|
|
16
|
+
*/
|
|
17
|
+
export const RED_50 = '#fef2f2';
|
|
18
|
+
export const RED_100 = '#fee2e2';
|
|
19
|
+
export const RED_200 = '#fecaca';
|
|
20
|
+
export const RED_300 = '#fca5a5';
|
|
21
|
+
export const RED_400 = '#f87171';
|
|
22
|
+
export const RED_500 = '#ef4444';
|
|
23
|
+
export const RED_600 = '#dc2626';
|
|
24
|
+
export const RED_700 = '#b91c1c';
|
|
25
|
+
export const RED_800 = '#991b1b';
|
|
26
|
+
export const RED_900 = '#7f1d1d';
|
|
27
|
+
/**
|
|
28
|
+
* all tailwind orange colors
|
|
29
|
+
*/
|
|
30
|
+
export const ORANGE_50 = '#fff7ed';
|
|
31
|
+
export const ORANGE_100 = '#ffedd5';
|
|
32
|
+
export const ORANGE_200 = '#fed7aa';
|
|
33
|
+
export const ORANGE_300 = '#fdba74';
|
|
34
|
+
export const ORANGE_400 = '#fb923c';
|
|
35
|
+
export const ORANGE_500 = '#f97316';
|
|
36
|
+
export const ORANGE_600 = '#ea580c';
|
|
37
|
+
export const ORANGE_700 = '#c2410c';
|
|
38
|
+
export const ORANGE_800 = '#9a3412';
|
|
39
|
+
export const ORANGE_900 = '#7c2d12';
|
|
40
|
+
/**
|
|
41
|
+
* all tailwind amber colors
|
|
42
|
+
*/
|
|
43
|
+
export const AMBER_50 = '#fffbeb';
|
|
44
|
+
export const AMBER_100 = '#fef3c7';
|
|
45
|
+
export const AMBER_200 = '#fde68a';
|
|
46
|
+
export const AMBER_300 = '#fcd34d';
|
|
47
|
+
export const AMBER_400 = '#fbbf24';
|
|
48
|
+
export const AMBER_500 = '#f59e0b';
|
|
49
|
+
export const AMBER_600 = '#d97706';
|
|
50
|
+
export const AMBER_700 = '#b45309';
|
|
51
|
+
export const AMBER_800 = '#92400e';
|
|
52
|
+
export const AMBER_900 = '#78350f';
|
|
53
|
+
/**
|
|
54
|
+
* all tailwind yellow colors
|
|
55
|
+
*/
|
|
56
|
+
export const YELLOW_50 = '#fefce8';
|
|
57
|
+
export const YELLOW_100 = '#fef9c3';
|
|
58
|
+
export const YELLOW_200 = '#fef08a';
|
|
59
|
+
export const YELLOW_300 = '#fde047';
|
|
60
|
+
export const YELLOW_400 = '#facc15';
|
|
61
|
+
export const YELLOW_500 = '#eab308';
|
|
62
|
+
export const YELLOW_600 = '#ca8a04';
|
|
63
|
+
export const YELLOW_700 = '#a16207';
|
|
64
|
+
export const YELLOW_800 = '#854d0e';
|
|
65
|
+
export const YELLOW_900 = '#713f12';
|
|
66
|
+
/**
|
|
67
|
+
* all tailwind lime colors
|
|
68
|
+
*/
|
|
69
|
+
export const LIME_50 = '#f7fee7';
|
|
70
|
+
export const LIME_100 = '#ecfccb';
|
|
71
|
+
export const LIME_200 = '#d9f99d';
|
|
72
|
+
export const LIME_300 = '#bef264';
|
|
73
|
+
export const LIME_400 = '#a3e635';
|
|
74
|
+
export const LIME_500 = '#84cc16';
|
|
75
|
+
export const LIME_600 = '#65a30d';
|
|
76
|
+
export const LIME_700 = '#4d7c0f';
|
|
77
|
+
export const LIME_800 = '#3f6212';
|
|
78
|
+
export const LIME_900 = '#365314';
|
|
79
|
+
/**
|
|
80
|
+
* all tailwind green colors
|
|
81
|
+
*/
|
|
82
|
+
export const GREEN_50 = '#f0fdf4';
|
|
83
|
+
export const GREEN_100 = '#dcfce7';
|
|
84
|
+
export const GREEN_200 = '#bbf7d0';
|
|
85
|
+
export const GREEN_300 = '#86efac';
|
|
86
|
+
export const GREEN_400 = '#4ade80';
|
|
87
|
+
export const GREEN_500 = '#22c55e';
|
|
88
|
+
export const GREEN_600 = '#16a34a';
|
|
89
|
+
export const GREEN_700 = '#15803d';
|
|
90
|
+
export const GREEN_800 = '#166534';
|
|
91
|
+
export const GREEN_900 = '#14532d';
|
|
92
|
+
/**
|
|
93
|
+
* all tailwind emerald colors
|
|
94
|
+
*/
|
|
95
|
+
export const EMERALD_50 = '#ecfdf5';
|
|
96
|
+
export const EMERALD_100 = '#d1fae5';
|
|
97
|
+
export const EMERALD_200 = '#a7f3d0';
|
|
98
|
+
export const EMERALD_300 = '#6ee7b7';
|
|
99
|
+
export const EMERALD_400 = '#34d399';
|
|
100
|
+
export const EMERALD_500 = '#10b981';
|
|
101
|
+
export const EMERALD_600 = '#059669';
|
|
102
|
+
export const EMERALD_700 = '#047857';
|
|
103
|
+
export const EMERALD_800 = '#065f46';
|
|
104
|
+
export const EMERALD_900 = '#064e3b';
|
|
105
|
+
/**
|
|
106
|
+
* all tailwind teal colors
|
|
107
|
+
*/
|
|
108
|
+
export const TEAL_50 = '#f0fdfa';
|
|
109
|
+
export const TEAL_100 = '#ccfbf1';
|
|
110
|
+
export const TEAL_200 = '#99f6e4';
|
|
111
|
+
export const TEAL_300 = '#5eead4';
|
|
112
|
+
export const TEAL_400 = '#2dd4bf';
|
|
113
|
+
export const TEAL_500 = '#14b8a6';
|
|
114
|
+
export const TEAL_600 = '#0d9488';
|
|
115
|
+
export const TEAL_700 = '#0f766e';
|
|
116
|
+
export const TEAL_800 = '#115e59';
|
|
117
|
+
export const TEAL_900 = '#134e4a';
|
|
118
|
+
/**
|
|
119
|
+
* all tailwind cyan colors
|
|
120
|
+
*/
|
|
121
|
+
export const CYAN_50 = '#ecfeff';
|
|
122
|
+
export const CYAN_100 = '#cffafe';
|
|
123
|
+
export const CYAN_200 = '#a5f3fc';
|
|
124
|
+
export const CYAN_300 = '#67e8f9';
|
|
125
|
+
export const CYAN_400 = '#22d3ee';
|
|
126
|
+
export const CYAN_500 = '#06b6d4';
|
|
127
|
+
export const CYAN_600 = '#0891b2';
|
|
128
|
+
export const CYAN_700 = '#0e7490';
|
|
129
|
+
export const CYAN_800 = '#155e75';
|
|
130
|
+
export const CYAN_900 = '#164e63';
|
|
131
|
+
/**
|
|
132
|
+
* all tailwind sky colors
|
|
133
|
+
*/
|
|
134
|
+
export const SKY_50 = '#f0f9ff';
|
|
135
|
+
export const SKY_100 = '#e0f2fe';
|
|
136
|
+
export const SKY_200 = '#bae6fd';
|
|
137
|
+
export const SKY_300 = '#7dd3fc';
|
|
138
|
+
export const SKY_400 = '#38bdf8';
|
|
139
|
+
export const SKY_500 = '#0ea5e9';
|
|
140
|
+
export const SKY_600 = '#0284c7';
|
|
141
|
+
export const SKY_700 = '#0369a1';
|
|
142
|
+
export const SKY_800 = '#075985';
|
|
143
|
+
export const SKY_900 = '#0c4a6e';
|
|
144
|
+
/**
|
|
145
|
+
* all tailwind blue colors
|
|
146
|
+
*/
|
|
147
|
+
export const BLUE_50 = '#eff6ff';
|
|
148
|
+
export const BLUE_100 = '#dbeafe';
|
|
149
|
+
export const BLUE_200 = '#bfdbfe';
|
|
150
|
+
export const BLUE_300 = '#93c5fd';
|
|
151
|
+
export const BLUE_400 = '#60a5fa';
|
|
152
|
+
export const BLUE_500 = '#3b82f6';
|
|
153
|
+
export const BLUE_600 = '#2563eb';
|
|
154
|
+
export const BLUE_700 = '#1d4ed8';
|
|
155
|
+
export const BLUE_800 = '#1e40af';
|
|
156
|
+
export const BLUE_900 = '#1e3a8a';
|
|
157
|
+
/**
|
|
158
|
+
* all tailwind indigo colors
|
|
159
|
+
*/
|
|
160
|
+
export const INDIGO_50 = '#eef2ff';
|
|
161
|
+
export const INDIGO_100 = '#e0e7ff';
|
|
162
|
+
export const INDIGO_200 = '#c7d2fe';
|
|
163
|
+
export const INDIGO_300 = '#a5b4fc';
|
|
164
|
+
export const INDIGO_400 = '#818cf8';
|
|
165
|
+
export const INDIGO_500 = '#6366f1';
|
|
166
|
+
export const INDIGO_600 = '#4f46e5';
|
|
167
|
+
export const INDIGO_700 = '#4338ca';
|
|
168
|
+
export const INDIGO_800 = '#3730a3';
|
|
169
|
+
export const INDIGO_900 = '#312e81';
|
|
170
|
+
/**
|
|
171
|
+
* all tailwind violet colors,
|
|
172
|
+
*/
|
|
173
|
+
export const VIOLET_50 = '#f5f3ff';
|
|
174
|
+
export const VIOLET_100 = '#ede9fe';
|
|
175
|
+
export const VIOLET_200 = '#ddd6fe';
|
|
176
|
+
export const VIOLET_300 = '#c4b5fd';
|
|
177
|
+
export const VIOLET_400 = '#a78bfa';
|
|
178
|
+
export const VIOLET_500 = '#8b5cf6';
|
|
179
|
+
export const VIOLET_600 = '#7c3aed';
|
|
180
|
+
export const VIOLET_700 = '#6d28d9';
|
|
181
|
+
export const VIOLET_800 = '#5b21b6';
|
|
182
|
+
export const VIOLET_900 = '#4c1d95';
|
|
183
|
+
/**
|
|
184
|
+
* all tailwind purple colors
|
|
185
|
+
*/
|
|
186
|
+
export const PURPLE_50 = '#faf5ff';
|
|
187
|
+
export const PURPLE_100 = '#f3e8ff';
|
|
188
|
+
export const PURPLE_200 = '#e9d5ff';
|
|
189
|
+
export const PURPLE_300 = '#d8b4fe';
|
|
190
|
+
export const PURPLE_400 = '#c084fc';
|
|
191
|
+
export const PURPLE_500 = '#a855f7';
|
|
192
|
+
export const PURPLE_600 = '#9333ea';
|
|
193
|
+
export const PURPLE_700 = '#7e22ce';
|
|
194
|
+
export const PURPLE_800 = '#6b21a8';
|
|
195
|
+
export const PURPLE_900 = '#581c87';
|
|
196
|
+
/**
|
|
197
|
+
* all tailwind fuchsia colors
|
|
198
|
+
*/
|
|
199
|
+
export const FUCHSIA_50 = '#fdf4ff';
|
|
200
|
+
export const FUCHSIA_100 = '#fae8ff';
|
|
201
|
+
export const FUCHSIA_200 = '#f5d0fe';
|
|
202
|
+
export const FUCHSIA_300 = '#f0abfc';
|
|
203
|
+
export const FUCHSIA_400 = '#e879f9';
|
|
204
|
+
export const FUCHSIA_500 = '#d946ef';
|
|
205
|
+
export const FUCHSIA_600 = '#c026d3';
|
|
206
|
+
export const FUCHSIA_700 = '#a21caf';
|
|
207
|
+
export const FUCHSIA_800 = '#86198f';
|
|
208
|
+
export const FUCHSIA_900 = '#701a75';
|
|
209
|
+
/**
|
|
210
|
+
* all tailwind pink colors
|
|
211
|
+
*/
|
|
212
|
+
export const PINK_50 = '#fdf2f8';
|
|
213
|
+
export const PINK_100 = '#fce7f3';
|
|
214
|
+
export const PINK_200 = '#fbcfe8';
|
|
215
|
+
export const PINK_300 = '#f9a8d4';
|
|
216
|
+
export const PINK_400 = '#f472b6';
|
|
217
|
+
export const PINK_500 = '#ec4899';
|
|
218
|
+
export const PINK_600 = '#db2777';
|
|
219
|
+
export const PINK_700 = '#be185d';
|
|
220
|
+
export const PINK_800 = '#9d174d';
|
|
221
|
+
export const PINK_900 = '#831843';
|
|
222
|
+
/**
|
|
223
|
+
* all tailwind rose colors
|
|
224
|
+
*/
|
|
225
|
+
export const ROSE_50 = '#fff1f2';
|
|
226
|
+
export const ROSE_100 = '#ffe4e6';
|
|
227
|
+
export const ROSE_200 = '#fecdd3';
|
|
228
|
+
export const ROSE_300 = '#fda4af';
|
|
229
|
+
export const ROSE_400 = '#fb7185';
|
|
230
|
+
export const ROSE_500 = '#f43f5e';
|
|
231
|
+
export const ROSE_600 = '#e11d48';
|
|
232
|
+
export const ROSE_700 = '#be123c';
|
|
233
|
+
export const ROSE_800 = '#9f1239';
|
|
234
|
+
export const ROSE_900 = '#881337';
|
|
235
|
+
/**
|
|
236
|
+
* all tailwind stone colors
|
|
237
|
+
*/
|
|
238
|
+
export const STONE_50 = '#f5f7fa';
|
|
239
|
+
export const STONE_100 = '#e4e7eb';
|
|
240
|
+
export const STONE_200 = '#cbd2d9';
|
|
241
|
+
export const STONE_300 = '#9fa6b2';
|
|
242
|
+
export const STONE_400 = '#6b7280';
|
|
243
|
+
export const STONE_500 = '#4b5563';
|
|
244
|
+
export const STONE_600 = '#374151';
|
|
245
|
+
export const STONE_700 = '#252f3f';
|
|
246
|
+
export const STONE_800 = '#161e2e';
|
|
247
|
+
export const STONE_900 = '#0d131e';
|
|
248
|
+
/**
|
|
249
|
+
* all tailwind neutral colors
|
|
250
|
+
*/
|
|
251
|
+
export const NEUTRAL_50 = '#f9fafb';
|
|
252
|
+
export const NEUTRAL_100 = '#f4f5f7';
|
|
253
|
+
export const NEUTRAL_200 = '#e5e7eb';
|
|
254
|
+
export const NEUTRAL_300 = '#d2d6dc';
|
|
255
|
+
export const NEUTRAL_400 = '#9fa6b2';
|
|
256
|
+
export const NEUTRAL_500 = '#6b7280';
|
|
257
|
+
export const NEUTRAL_600 = '#4b5563';
|
|
258
|
+
export const NEUTRAL_700 = '#374151';
|
|
259
|
+
export const NEUTRAL_800 = '#252f3f';
|
|
260
|
+
export const NEUTRAL_900 = '#161e2e';
|
|
261
|
+
/**
|
|
262
|
+
* all tailwind zinc colors
|
|
263
|
+
*/
|
|
264
|
+
export const ZINC_50 = '#f9fafb';
|
|
265
|
+
export const ZINC_100 = '#f4f5f7';
|
|
266
|
+
export const ZINC_200 = '#e5e7eb';
|
|
267
|
+
export const ZINC_300 = '#d2d6dc';
|
|
268
|
+
export const ZINC_400 = '#9fa6b2';
|
|
269
|
+
export const ZINC_500 = '#6b7280';
|
|
270
|
+
export const ZINC_600 = '#4b5563';
|
|
271
|
+
export const ZINC_700 = '#374151';
|
|
272
|
+
export const ZINC_800 = '#252f3f';
|
|
273
|
+
export const ZINC_900 = '#161e2e';
|
|
274
|
+
/**
|
|
275
|
+
* all tailwind slate colors
|
|
276
|
+
*/
|
|
277
|
+
export const SLATE_50 = '#f4f5f7';
|
|
278
|
+
export const SLATE_100 = '#e5e7eb';
|
|
279
|
+
export const SLATE_200 = '#d2d6dc';
|
|
280
|
+
export const SLATE_300 = '#9fa6b2';
|
|
281
|
+
export const SLATE_400 = '#6b7280';
|
|
282
|
+
export const SLATE_500 = '#4b5563';
|
|
283
|
+
export const SLATE_600 = '#374151';
|
|
284
|
+
export const SLATE_700 = '#252f3f';
|
|
285
|
+
export const SLATE_800 = '#161e2e';
|
|
286
|
+
export const SLATE_900 = '#0d131e';
|
|
287
|
+
export const WHITE = '#ffffff';
|
|
288
|
+
export const BLACK = '#000000';
|
|
289
|
+
export const TRANSPARENT = '#00000000';
|
|
290
|
+
/**
|
|
291
|
+
* every color in one enum
|
|
292
|
+
*/
|
|
293
|
+
export default {
|
|
294
|
+
WHITE,
|
|
295
|
+
BLACK,
|
|
296
|
+
TRANSPARENT,
|
|
297
|
+
GRAY_50,
|
|
298
|
+
GRAY_100,
|
|
299
|
+
GRAY_200,
|
|
300
|
+
GRAY_300,
|
|
301
|
+
GRAY_400,
|
|
302
|
+
GRAY_500,
|
|
303
|
+
GRAY_600,
|
|
304
|
+
GRAY_700,
|
|
305
|
+
GRAY_800,
|
|
306
|
+
GRAY_900,
|
|
307
|
+
RED_50,
|
|
308
|
+
RED_100,
|
|
309
|
+
RED_200,
|
|
310
|
+
RED_300,
|
|
311
|
+
RED_400,
|
|
312
|
+
RED_500,
|
|
313
|
+
RED_600,
|
|
314
|
+
RED_700,
|
|
315
|
+
RED_800,
|
|
316
|
+
RED_900,
|
|
317
|
+
ORANGE_50,
|
|
318
|
+
ORANGE_100,
|
|
319
|
+
ORANGE_200,
|
|
320
|
+
ORANGE_300,
|
|
321
|
+
ORANGE_400,
|
|
322
|
+
ORANGE_500,
|
|
323
|
+
ORANGE_600,
|
|
324
|
+
ORANGE_700,
|
|
325
|
+
ORANGE_800,
|
|
326
|
+
ORANGE_900,
|
|
327
|
+
AMBER_50,
|
|
328
|
+
AMBER_100,
|
|
329
|
+
AMBER_200,
|
|
330
|
+
AMBER_300,
|
|
331
|
+
AMBER_400,
|
|
332
|
+
AMBER_500,
|
|
333
|
+
AMBER_600,
|
|
334
|
+
AMBER_700,
|
|
335
|
+
AMBER_800,
|
|
336
|
+
AMBER_900,
|
|
337
|
+
YELLOW_50,
|
|
338
|
+
YELLOW_100,
|
|
339
|
+
YELLOW_200,
|
|
340
|
+
YELLOW_300,
|
|
341
|
+
YELLOW_400,
|
|
342
|
+
YELLOW_500,
|
|
343
|
+
YELLOW_600,
|
|
344
|
+
YELLOW_700,
|
|
345
|
+
YELLOW_800,
|
|
346
|
+
YELLOW_900,
|
|
347
|
+
LIME_50,
|
|
348
|
+
LIME_100,
|
|
349
|
+
LIME_200,
|
|
350
|
+
LIME_300,
|
|
351
|
+
LIME_400,
|
|
352
|
+
LIME_500,
|
|
353
|
+
LIME_600,
|
|
354
|
+
LIME_700,
|
|
355
|
+
LIME_800,
|
|
356
|
+
LIME_900,
|
|
357
|
+
GREEN_50,
|
|
358
|
+
GREEN_100,
|
|
359
|
+
GREEN_200,
|
|
360
|
+
GREEN_300,
|
|
361
|
+
GREEN_400,
|
|
362
|
+
GREEN_500,
|
|
363
|
+
GREEN_600,
|
|
364
|
+
GREEN_700,
|
|
365
|
+
GREEN_800,
|
|
366
|
+
GREEN_900,
|
|
367
|
+
EMERALD_50,
|
|
368
|
+
EMERALD_100,
|
|
369
|
+
EMERALD_200,
|
|
370
|
+
EMERALD_300,
|
|
371
|
+
EMERALD_400,
|
|
372
|
+
EMERALD_500,
|
|
373
|
+
EMERALD_600,
|
|
374
|
+
EMERALD_700,
|
|
375
|
+
EMERALD_800,
|
|
376
|
+
EMERALD_900,
|
|
377
|
+
TEAL_50,
|
|
378
|
+
TEAL_100,
|
|
379
|
+
TEAL_200,
|
|
380
|
+
TEAL_300,
|
|
381
|
+
TEAL_400,
|
|
382
|
+
TEAL_500,
|
|
383
|
+
TEAL_600,
|
|
384
|
+
TEAL_700,
|
|
385
|
+
TEAL_800,
|
|
386
|
+
TEAL_900,
|
|
387
|
+
CYAN_50,
|
|
388
|
+
CYAN_100,
|
|
389
|
+
CYAN_200,
|
|
390
|
+
CYAN_300,
|
|
391
|
+
CYAN_400,
|
|
392
|
+
CYAN_500,
|
|
393
|
+
CYAN_600,
|
|
394
|
+
CYAN_700,
|
|
395
|
+
CYAN_800,
|
|
396
|
+
CYAN_900,
|
|
397
|
+
SKY_50,
|
|
398
|
+
SKY_100,
|
|
399
|
+
SKY_200,
|
|
400
|
+
SKY_300,
|
|
401
|
+
SKY_400,
|
|
402
|
+
SKY_500,
|
|
403
|
+
SKY_600,
|
|
404
|
+
SKY_700,
|
|
405
|
+
SKY_800,
|
|
406
|
+
SKY_900,
|
|
407
|
+
BLUE_50,
|
|
408
|
+
BLUE_100,
|
|
409
|
+
BLUE_200,
|
|
410
|
+
BLUE_300,
|
|
411
|
+
BLUE_400,
|
|
412
|
+
BLUE_500,
|
|
413
|
+
BLUE_600,
|
|
414
|
+
BLUE_700,
|
|
415
|
+
BLUE_800,
|
|
416
|
+
BLUE_900,
|
|
417
|
+
INDIGO_50,
|
|
418
|
+
INDIGO_100,
|
|
419
|
+
INDIGO_200,
|
|
420
|
+
INDIGO_300,
|
|
421
|
+
INDIGO_400,
|
|
422
|
+
INDIGO_500,
|
|
423
|
+
INDIGO_600,
|
|
424
|
+
INDIGO_700,
|
|
425
|
+
INDIGO_800,
|
|
426
|
+
INDIGO_900,
|
|
427
|
+
VIOLET_50,
|
|
428
|
+
VIOLET_100,
|
|
429
|
+
VIOLET_200,
|
|
430
|
+
VIOLET_300,
|
|
431
|
+
VIOLET_400,
|
|
432
|
+
VIOLET_500,
|
|
433
|
+
VIOLET_600,
|
|
434
|
+
VIOLET_700,
|
|
435
|
+
VIOLET_800,
|
|
436
|
+
VIOLET_900,
|
|
437
|
+
PURPLE_50,
|
|
438
|
+
PURPLE_100,
|
|
439
|
+
PURPLE_200,
|
|
440
|
+
PURPLE_300,
|
|
441
|
+
PURPLE_400,
|
|
442
|
+
PURPLE_500,
|
|
443
|
+
PURPLE_600,
|
|
444
|
+
PURPLE_700,
|
|
445
|
+
PURPLE_800,
|
|
446
|
+
PURPLE_900,
|
|
447
|
+
FUCHSIA_50,
|
|
448
|
+
FUCHSIA_100,
|
|
449
|
+
FUCHSIA_200,
|
|
450
|
+
FUCHSIA_300,
|
|
451
|
+
FUCHSIA_400,
|
|
452
|
+
FUCHSIA_500,
|
|
453
|
+
FUCHSIA_600,
|
|
454
|
+
FUCHSIA_700,
|
|
455
|
+
FUCHSIA_800,
|
|
456
|
+
FUCHSIA_900,
|
|
457
|
+
PINK_50,
|
|
458
|
+
PINK_100,
|
|
459
|
+
PINK_200,
|
|
460
|
+
PINK_300,
|
|
461
|
+
PINK_400,
|
|
462
|
+
PINK_500,
|
|
463
|
+
PINK_600,
|
|
464
|
+
PINK_700,
|
|
465
|
+
PINK_800,
|
|
466
|
+
PINK_900,
|
|
467
|
+
ROSE_50,
|
|
468
|
+
ROSE_100,
|
|
469
|
+
ROSE_200,
|
|
470
|
+
ROSE_300,
|
|
471
|
+
ROSE_400,
|
|
472
|
+
ROSE_500,
|
|
473
|
+
ROSE_600,
|
|
474
|
+
ROSE_700,
|
|
475
|
+
ROSE_800,
|
|
476
|
+
ROSE_900,
|
|
477
|
+
STONE_50,
|
|
478
|
+
STONE_100,
|
|
479
|
+
STONE_200,
|
|
480
|
+
STONE_300,
|
|
481
|
+
STONE_400,
|
|
482
|
+
STONE_500,
|
|
483
|
+
STONE_600,
|
|
484
|
+
STONE_700,
|
|
485
|
+
STONE_800,
|
|
486
|
+
STONE_900,
|
|
487
|
+
NEUTRAL_50,
|
|
488
|
+
NEUTRAL_100,
|
|
489
|
+
NEUTRAL_200,
|
|
490
|
+
NEUTRAL_300,
|
|
491
|
+
NEUTRAL_400,
|
|
492
|
+
NEUTRAL_500,
|
|
493
|
+
NEUTRAL_600,
|
|
494
|
+
NEUTRAL_700,
|
|
495
|
+
NEUTRAL_800,
|
|
496
|
+
NEUTRAL_900,
|
|
497
|
+
ZINC_50,
|
|
498
|
+
ZINC_100,
|
|
499
|
+
ZINC_200,
|
|
500
|
+
ZINC_300,
|
|
501
|
+
ZINC_400,
|
|
502
|
+
ZINC_500,
|
|
503
|
+
ZINC_600,
|
|
504
|
+
ZINC_700,
|
|
505
|
+
ZINC_800,
|
|
506
|
+
ZINC_900,
|
|
507
|
+
SLATE_50,
|
|
508
|
+
SLATE_100,
|
|
509
|
+
SLATE_200,
|
|
510
|
+
SLATE_300,
|
|
511
|
+
SLATE_400,
|
|
512
|
+
SLATE_500,
|
|
513
|
+
SLATE_600,
|
|
514
|
+
SLATE_700,
|
|
515
|
+
SLATE_800,
|
|
516
|
+
SLATE_900,
|
|
517
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MaybeRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* pulls ctx from a canvas or canvas ref (vue.js), throws if not found
|
|
4
|
+
*
|
|
5
|
+
* @returns {CanvasRenderingContext2D}
|
|
6
|
+
* @example const ctx = getCtx(canvasRef);
|
|
7
|
+
* // ctx is defined and ready to use
|
|
8
|
+
* @throws {Error} if canvas or 2d context not found
|
|
9
|
+
*/
|
|
10
|
+
export declare const getCtx: (canvasInput: MaybeRef<HTMLCanvasElement | null | undefined>) => CanvasRenderingContext2D;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pulls ctx from a canvas or canvas ref (vue.js), throws if not found
|
|
3
|
+
*
|
|
4
|
+
* @returns {CanvasRenderingContext2D}
|
|
5
|
+
* @example const ctx = getCtx(canvasRef);
|
|
6
|
+
* // ctx is defined and ready to use
|
|
7
|
+
* @throws {Error} if canvas or 2d context not found
|
|
8
|
+
*/
|
|
9
|
+
export const getCtx = (canvasInput) => {
|
|
10
|
+
if (!canvasInput)
|
|
11
|
+
throw new Error('canvas not found');
|
|
12
|
+
const canvas = 'value' in canvasInput ? canvasInput.value : canvasInput;
|
|
13
|
+
if (!canvas)
|
|
14
|
+
throw new Error('canvas not found');
|
|
15
|
+
const ctx = canvas.getContext('2d');
|
|
16
|
+
if (!ctx)
|
|
17
|
+
throw new Error('2d context not found');
|
|
18
|
+
return ctx;
|
|
19
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* a function that will only be called after a certain amount
|
|
3
|
+
* of time has passed since the last time it was called
|
|
4
|
+
*
|
|
5
|
+
* @param fn target function
|
|
6
|
+
* @param ms time in milliseconds
|
|
7
|
+
* @returns a debounced function
|
|
8
|
+
*/
|
|
9
|
+
export declare const debounce: <T extends () => void>(fn: T, ms: number) => () => void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* a function that will only be called after a certain amount
|
|
3
|
+
* of time has passed since the last time it was called
|
|
4
|
+
*
|
|
5
|
+
* @param fn target function
|
|
6
|
+
* @param ms time in milliseconds
|
|
7
|
+
* @returns a debounced function
|
|
8
|
+
*/
|
|
9
|
+
export const debounce = (fn, ms) => {
|
|
10
|
+
let timeout;
|
|
11
|
+
return () => {
|
|
12
|
+
clearTimeout(timeout);
|
|
13
|
+
timeout = setTimeout(fn, ms);
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const useLogReport = (frequencyMs = 1000, resetReportAfterLogging = true) => {
|
|
2
|
+
const report = new Set();
|
|
3
|
+
const logReport = () => {
|
|
4
|
+
console.log(Array.from(report));
|
|
5
|
+
if (resetReportAfterLogging)
|
|
6
|
+
report.clear();
|
|
7
|
+
};
|
|
8
|
+
setInterval(logReport, frequencyMs);
|
|
9
|
+
return report;
|
|
10
|
+
};
|
|
11
|
+
export const useCooldownLog = (frequencyMs = 1000) => {
|
|
12
|
+
let cooldown = false;
|
|
13
|
+
const log = (...data) => {
|
|
14
|
+
if (cooldown)
|
|
15
|
+
return;
|
|
16
|
+
console.log(...data);
|
|
17
|
+
cooldown = true;
|
|
18
|
+
};
|
|
19
|
+
setInterval(() => (cooldown = false), frequencyMs);
|
|
20
|
+
return log;
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { expect, test } from 'vitest';
|
|
2
|
+
import { delta } from '.';
|
|
3
|
+
test('deepDelta standard', () => {
|
|
4
|
+
const yona = {
|
|
5
|
+
name: 'yona',
|
|
6
|
+
sex: 'm',
|
|
7
|
+
residence: 'amherst',
|
|
8
|
+
school: {
|
|
9
|
+
name: 'umass',
|
|
10
|
+
year: 'senior',
|
|
11
|
+
info: {
|
|
12
|
+
major: ['cs'],
|
|
13
|
+
minor: [],
|
|
14
|
+
start: '2023',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
test: {
|
|
18
|
+
hello: 'world',
|
|
19
|
+
removeMe: {
|
|
20
|
+
removeMe: 'removeMe',
|
|
21
|
+
removeMe2: {},
|
|
22
|
+
},
|
|
23
|
+
test2: {
|
|
24
|
+
test3: 'secret',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
const dila = {
|
|
29
|
+
name: 'dila',
|
|
30
|
+
sex: 'f',
|
|
31
|
+
residence: 'amherst',
|
|
32
|
+
school: {
|
|
33
|
+
name: 'umass',
|
|
34
|
+
year: 'junior',
|
|
35
|
+
info: {
|
|
36
|
+
major: ['cs', 'japanese'],
|
|
37
|
+
minor: [],
|
|
38
|
+
start: '2022',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
test: {
|
|
42
|
+
hello: 'world',
|
|
43
|
+
removeMe: {
|
|
44
|
+
removeMe: 'removeMe',
|
|
45
|
+
removeMe2: {},
|
|
46
|
+
},
|
|
47
|
+
test2: {
|
|
48
|
+
test3: 'secret changed',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
const expected = {
|
|
53
|
+
name: 'dila',
|
|
54
|
+
sex: 'f',
|
|
55
|
+
school: {
|
|
56
|
+
year: 'junior',
|
|
57
|
+
info: {
|
|
58
|
+
major: ['cs', 'japanese'],
|
|
59
|
+
start: '2022',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
test: {
|
|
63
|
+
test2: {
|
|
64
|
+
test3: 'secret changed',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
const result = delta(yona, dila);
|
|
69
|
+
expect(result).toEqual(expected);
|
|
70
|
+
});
|
|
71
|
+
test('deepDelta works if new object has more keys', () => {
|
|
72
|
+
const yona = {
|
|
73
|
+
name: 'yona',
|
|
74
|
+
};
|
|
75
|
+
const dila = {
|
|
76
|
+
name: 'dila',
|
|
77
|
+
favoriteColor: 'blue',
|
|
78
|
+
anime: {
|
|
79
|
+
naruto: 'meh',
|
|
80
|
+
bleach: 'good',
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
const expected = {
|
|
84
|
+
name: 'dila',
|
|
85
|
+
favoriteColor: 'blue',
|
|
86
|
+
anime: {
|
|
87
|
+
naruto: 'meh',
|
|
88
|
+
bleach: 'good',
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
const result = delta(yona, dila);
|
|
92
|
+
expect(result).toEqual(expected);
|
|
93
|
+
});
|
|
94
|
+
test('deepDelta works on fields that are null or undefined', () => {
|
|
95
|
+
const colorGetter = () => 'blue';
|
|
96
|
+
const yona = {
|
|
97
|
+
name: 'yona',
|
|
98
|
+
favoriteColor: {
|
|
99
|
+
color: colorGetter,
|
|
100
|
+
},
|
|
101
|
+
sbahn: 's1',
|
|
102
|
+
};
|
|
103
|
+
const dila = {
|
|
104
|
+
name: 'dila',
|
|
105
|
+
favoriteColor: null,
|
|
106
|
+
sbahn: undefined,
|
|
107
|
+
};
|
|
108
|
+
const expected = {
|
|
109
|
+
name: 'dila',
|
|
110
|
+
sbahn: undefined,
|
|
111
|
+
};
|
|
112
|
+
const result = delta(yona, dila);
|
|
113
|
+
expect(result).toEqual(expected);
|
|
114
|
+
});
|