yummies 3.0.24 → 3.0.26
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/async.d.ts +2 -1
- package/async.d.ts.map +1 -1
- package/async.js +2 -7
- package/html.d.ts +6 -0
- package/html.d.ts.map +1 -1
- package/html.js +6 -0
- package/imports.js +2 -2
- package/package.json +1 -1
package/async.d.ts
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* @param ms значение в миллисекундах
|
|
5
5
|
* @returns Promise
|
|
6
6
|
*/
|
|
7
|
-
export declare const sleep: (time?: number) => Promise<
|
|
7
|
+
export declare const sleep: (time?: number) => Promise<unknown>;
|
|
8
8
|
/**
|
|
9
9
|
* Создает промис, который будет ждать указанное количество ms, чтобы выполниться
|
|
10
10
|
*
|
|
11
|
+
* @deprecated используй {sleep}
|
|
11
12
|
* @param ms значение в миллисекундах
|
|
12
13
|
* @returns Promise
|
|
13
14
|
*/
|
package/async.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../src/async.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,KAAK,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../src/async.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,KAAK,UAAU,MAAM,qBACmB,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,mCAC6B,CAAC;AAEpD;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,iBACP,MAAM,OAAO,GAAG,IAAI,gBACpB,OAAO,SAYtB,CAAC"}
|
package/async.js
CHANGED
|
@@ -5,16 +5,11 @@
|
|
|
5
5
|
* @param ms значение в миллисекундах
|
|
6
6
|
* @returns Promise
|
|
7
7
|
*/
|
|
8
|
-
export const sleep = (time = 0) =>
|
|
9
|
-
const promise = Promise.resolve();
|
|
10
|
-
setTimeout(() => {
|
|
11
|
-
promise.then();
|
|
12
|
-
}, time);
|
|
13
|
-
return promise;
|
|
14
|
-
};
|
|
8
|
+
export const sleep = (time = 0) => new Promise((resolve) => setTimeout(resolve, time));
|
|
15
9
|
/**
|
|
16
10
|
* Создает промис, который будет ждать указанное количество ms, чтобы выполниться
|
|
17
11
|
*
|
|
12
|
+
* @deprecated используй {sleep}
|
|
18
13
|
* @param ms значение в миллисекундах
|
|
19
14
|
* @returns Promise
|
|
20
15
|
*/
|
package/html.d.ts
CHANGED
|
@@ -31,6 +31,12 @@ export declare const startViewTransitionSafety: (fn: VoidFunction, params?: {
|
|
|
31
31
|
* Вычисляет размер скроллбара
|
|
32
32
|
*/
|
|
33
33
|
export declare const calcScrollbarWidth: () => number;
|
|
34
|
+
/**
|
|
35
|
+
* Calculates the inner height of an HTML element, accounting for padding.
|
|
36
|
+
*/
|
|
34
37
|
export declare function getElementInnerHeight(element: HTMLElement): number;
|
|
38
|
+
/**
|
|
39
|
+
* Calculates the inner width of an HTML element, accounting for padding.
|
|
40
|
+
*/
|
|
35
41
|
export declare function getElementInnerWidth(el: HTMLElement): number;
|
|
36
42
|
//# sourceMappingURL=html.d.ts.map
|
package/html.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../src/html.ts"],"names":[],"mappings":"AAAA,OAAe,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAIjD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,WAAY,MAAM,KAAG,MAAM,GAAG,IAa1D,CAAC;AAEF,eAAO,MAAM,mBAAmB,cACnB,MAAM,GAAG,IAAI,aACb,MAAM,SAgBlB,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,UAI7C;AAED,eAAO,MAAM,gBAAgB,YAAa,WA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AO,CAAC,eAAe,CAAC,WAMlC,CAAC;AAEF,eAAO,MAAM,qBAAqB,YACvB,WAAW,GAAG,IAAI,UACnB,KAAK,CAAC,WAAW,CAAC,YAe3B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,OAChC,YAAY,WACP;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,+BAMhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,cAoB9B,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,WAAW,UAQzD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,WAAW,UAQnD"}
|
package/html.js
CHANGED
|
@@ -168,6 +168,9 @@ export const calcScrollbarWidth = () => {
|
|
|
168
168
|
outer.parentNode?.removeChild(outer);
|
|
169
169
|
return scrollbarWidth;
|
|
170
170
|
};
|
|
171
|
+
/**
|
|
172
|
+
* Calculates the inner height of an HTML element, accounting for padding.
|
|
173
|
+
*/
|
|
171
174
|
export function getElementInnerHeight(element) {
|
|
172
175
|
const { clientHeight } = element;
|
|
173
176
|
const { paddingTop, paddingBottom } = getComputedStyle(element);
|
|
@@ -175,6 +178,9 @@ export function getElementInnerHeight(element) {
|
|
|
175
178
|
Number.parseFloat(paddingTop) -
|
|
176
179
|
Number.parseFloat(paddingBottom));
|
|
177
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* Calculates the inner width of an HTML element, accounting for padding.
|
|
183
|
+
*/
|
|
178
184
|
export function getElementInnerWidth(el) {
|
|
179
185
|
const { clientWidth } = el;
|
|
180
186
|
const { paddingLeft, paddingRight } = getComputedStyle(el);
|
package/imports.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { sleep } from './async.js';
|
|
2
2
|
/**
|
|
3
3
|
* Функция ленивой загрузки модуля, с возможностью вызова доп. попыток
|
|
4
4
|
* @example
|
|
@@ -16,7 +16,7 @@ export const fetchLazyModule = async (fetchModule, attempts = 3, delay = 1000) =
|
|
|
16
16
|
for await (const attempt of attemptsArray) {
|
|
17
17
|
try {
|
|
18
18
|
if (lastError !== null) {
|
|
19
|
-
await
|
|
19
|
+
await sleep(delay);
|
|
20
20
|
}
|
|
21
21
|
return await attempt();
|
|
22
22
|
}
|