@alwatr/delay 9.3.0 → 9.4.5
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/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/package.json +5 -5
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 📦 @alwatr/delay v9.
|
|
1
|
+
/* 📦 @alwatr/delay v9.4.5 */
|
|
2
2
|
import{parseDuration as O}from"@alwatr/parse-duration";import{getGlobalThis as M}from"@alwatr/global-this";var H=M(),K=H.requestAnimationFrame?.bind(H)??((z)=>setTimeout(()=>z(performance.now()),16.666666666666668)),L=H.requestIdleCallback?.bind(H)??((z,B)=>{let E=Date.now();return setTimeout(()=>{z({didTimeout:!!B?.timeout,timeRemaining:()=>Math.max(0,50-(Date.now()-E))})},B?.timeout??20)});var U={by:(z)=>new Promise((B)=>setTimeout(B,O(z))),animationFrame:()=>new Promise((z)=>K(z)),idleCallback:(z)=>new Promise((B)=>L(B,z)),domEvent:(z,B,E={passive:!0})=>new Promise((J)=>z.addEventListener(B,J,{...E,once:!0})),event:(z,B,E={passive:!0})=>new Promise((J)=>z.addEventListener(B,J,{...E,once:!0})),nextMacrotask:()=>new Promise((z)=>setTimeout(z,0)),nextMicrotask:()=>Promise.resolve().then(()=>{})};export{L as requestIdleCallback,K as requestAnimationFrame,U as delay};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=3182FC46964DEB3F64756E2164756E21
|
|
5
5
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"import {getGlobalThis} from '@alwatr/global-this';\n\n\nconst globalThis = getGlobalThis<DictionaryOpt<unknown>>();\n\n/**\n * Ensures compatibility for `requestAnimationFrame` by using the native API\n * available in `globalThis`. If it's not available, it falls back to a `setTimeout`\n * call that aims for a 60 frames per second refresh rate.\n *\n * @param callback The function to call when it's time to update your animation for the next repaint.\n * @returns A long integer value, the request ID, that uniquely identifies the entry in the callback list.\n */\nexport const requestAnimationFrame: (callback: FrameRequestCallback) => number =\n globalThis.requestAnimationFrame?.bind(globalThis) ??\n ((callback: FrameRequestCallback) => setTimeout(() => callback(performance.now()), 1000 / 60));\n\n/**\n * Ensures compatibility for `requestIdleCallback` by using the native API.\n * If unavailable, it falls back to a `setTimeout` that executes the callback\n * after a short delay, providing a mock `IdleDeadline` object.\n *\n * The mock `IdleDeadline` gives the task a 50ms budget to run.\n *\n * @param callback A reference to a function that should be called in the near future, when the event loop is idle.\n * @param options An optional object with configuration parameters.\n * @returns An ID which can be used to cancel the callback by calling `cancelIdleCallback()`.\n */\nexport const requestIdleCallback: (callback: (deadline: IdleDeadline) => void, options?: IdleRequestOptions) => number =\n globalThis.requestIdleCallback?.bind(globalThis) ??\n ((\n callback: (deadline: IdleDeadline) => void,\n // options is not used in the fallback but kept for API consistency\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n options?: IdleRequestOptions,\n ) => {\n const startTime = Date.now();\n return setTimeout(() => {\n callback({\n didTimeout: !!options?.timeout,\n timeRemaining: () => Math.max(0, 50 - (Date.now() - startTime)),\n });\n }, options?.timeout ?? 20);\n });\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";AAAA,wBAAQ,+BCAR,wBAAQ,4BAGR,IAAM,EAAa,EAAsC,EAU5C,EACX,EAAW,uBAAuB,KAAK,CAAU,IAChD,CAAC,IAAmC,WAAW,IAAM,EAAS,YAAY,IAAI,CAAC,EAAG,kBAAS,GAajF,EACX,EAAW,qBAAqB,KAAK,CAAU,IAC9C,CACC,EAGA,IACG,CACH,IAAM,EAAY,KAAK,IAAI,EAC3B,OAAO,WAAW,IAAM,CACtB,EAAS,CACP,WAAY,CAAC,CAAC,GAAS,QACvB,cAAe,IAAM,KAAK,IAAI,EAAG,IAAM,KAAK,IAAI,EAAI,EAAU,CAChE,CAAC,GACA,GAAS,SAAW,EAAE,IDjCtB,IAAM,EAAQ,CAanB,GAAI,CAAC,IAAsC,IAAI,QAAQ,CAAC,IAAY,WAAW,EAAS,EAAc,CAAQ,CAAC,CAAC,EAahH,eAAgB,IAAoC,IAAI,QAAQ,CAAC,IAAY,EAAsB,CAAO,CAAC,EAgB3G,aAAc,CAAC,IAAwD,IAAI,QAAQ,CAAC,IAAY,EAAoB,EAAS,CAAO,CAAC,EAoBrI,SAAU,CACR,EACA,EACA,EAAmC,CAAC,QAAS,EAAI,IAEjD,IAAI,QAAQ,CAAC,IACX,EAAQ,iBAAiB,EAAW,EAAS,IACxC,EACH,KAAM,EACR,CAAC,CACH,EAgBF,MAAO,CAAC,EAAqB,EAAmB,EAAmC,CAAC,QAAS,EAAI,IAC/F,IAAI,QAAQ,CAAC,IACX,EAAO,iBAAiB,EAAW,EAAS,IACvC,EACH,KAAM,EACR,CAAC,CACH,EAeF,cAAe,IAAqB,IAAI,QAAQ,CAAC,IAAY,WAAW,EAAS,CAAC,CAAC,EAenF,cAAe,IAAqB,QAAQ,QAAQ,EAAE,KAAK,IAAM,EAAE,CACrE",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "3182FC46964DEB3F64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwatr/delay",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.4.5",
|
|
4
4
|
"description": "Comprehensive toolkit for managing asynchronous operations.",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com> (https://ali.mihandoost.com)",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@alwatr/global-this": "9.
|
|
25
|
-
"@alwatr/parse-duration": "9.
|
|
24
|
+
"@alwatr/global-this": "9.4.5",
|
|
25
|
+
"@alwatr/parse-duration": "9.4.5"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@alwatr/nano-build": "9.3.0",
|
|
29
|
-
"@alwatr/standard": "9.
|
|
29
|
+
"@alwatr/standard": "9.4.5",
|
|
30
30
|
"@alwatr/type-helper": "9.1.1",
|
|
31
31
|
"@types/node": "^24.12.2",
|
|
32
32
|
"typescript": "^6.0.2"
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"utils",
|
|
77
77
|
"wait"
|
|
78
78
|
],
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "26e30d3e766cb9e2274a61d5259677643f8ca18d"
|
|
80
80
|
}
|