@apigames/async-interval
Advanced tools
Comparing version
/*! For license information please see set-interval-async.iife.js.LICENSE.txt */ | ||
var SetIntervalAsync;(()=>{"use strict";var e={874:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clearIntervalAsync=void 0;const r=n(572);t.clearIntervalAsync=async function(e){if(!(e instanceof r.SetIntervalAsyncTimer))throw new TypeError("First argument is not an instance of SetIntervalAsyncTimer");await r.SetIntervalAsyncTimer.stopTimer(e)}},653:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setIntervalAsync=t.clearIntervalAsync=void 0;const r=n(874);Object.defineProperty(t,"clearIntervalAsync",{enumerable:!0,get:function(){return r.clearIntervalAsync}});const a=n(572);t.setIntervalAsync=function(e,t){if("function"!=typeof e)throw new TypeError("First argument is not a function");if("number"!=typeof t)throw new TypeError("Second argument is not a number");for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];return a.SetIntervalAsyncTimer.startTimer("dynamic",e,t,...r)}},670:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setIntervalAsync=t.clearIntervalAsync=void 0;const r=n(874);Object.defineProperty(t,"clearIntervalAsync",{enumerable:!0,get:function(){return r.clearIntervalAsync}});const a=n(572);t.setIntervalAsync=function(e,t){if("function"!=typeof e)throw new TypeError("First argument is not a function");if("number"!=typeof t)throw new TypeError("Second argument is not a number");for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];return a.SetIntervalAsyncTimer.startTimer("fixed",e,t,...r)}},572:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SetIntervalAsyncTimer=void 0;class n{#e=void 0;#t=void 0;#n=!1;static startTimer(e,t,r){r=Math.min(Math.max(Math.trunc(r),10),2147483647);const a=new n;for(var s=arguments.length,i=new Array(s>3?s-3:0),o=3;o<s;o++)i[o-3]=arguments[o];return a.#r(e,t,r,r,...i),a}static async stopTimer(e){e.#n=!0,e.#e&&clearTimeout(e.#e),e.#t&&await e.#t}#r(e,t,n,r){for(var a=arguments.length,s=new Array(a>4?a-4:0),i=4;i<a;i++)s[i-4]=arguments[i];this.#e=setTimeout((async()=>{this.#e=void 0,this.#t=this.#a(e,t,n,...s),await this.#t,this.#t=void 0}),r)}async#a(e,t,n){const r=(new Date).getTime();for(var a=arguments.length,s=new Array(a>3?a-3:0),i=3;i<a;i++)s[i-3]=arguments[i];try{await t(...s)}finally{if(!this.#n){const a=(new Date).getTime()-r,i="dynamic"===e?n>a?n-a:0:n;this.#r(e,t,n,i,...s)}}}}t.SetIntervalAsyncTimer=n}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}var r={};(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.fixed=e.dynamic=e.clearIntervalAsync=e.setIntervalAsync=void 0;const t=n(874);Object.defineProperty(e,"clearIntervalAsync",{enumerable:!0,get:function(){return t.clearIntervalAsync}});const a=n(653),s=n(670),i=a.setIntervalAsync;e.setIntervalAsync=i;const o={setIntervalAsync:a.setIntervalAsync};e.dynamic=o;const c={setIntervalAsync:s.setIntervalAsync};e.fixed=c})(),SetIntervalAsync=r})(); | ||
var SetIntervalAsync;(()=>{"use strict";var e={574:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clearIntervalAsync=void 0;const r=n(143);t.clearIntervalAsync=async function(e){if(!(e instanceof r.SetIntervalAsyncTimer))throw new TypeError("First argument is not an instance of SetIntervalAsyncTimer");await r.SetIntervalAsyncTimer.stopTimer(e)}},273:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setIntervalAsync=t.clearIntervalAsync=void 0;const r=n(574);Object.defineProperty(t,"clearIntervalAsync",{enumerable:!0,get:function(){return r.clearIntervalAsync}});const a=n(143);t.setIntervalAsync=function(e,t){if("function"!=typeof e)throw new TypeError("First argument is not a function");if("number"!=typeof t)throw new TypeError("Second argument is not a number");for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];return a.SetIntervalAsyncTimer.startTimer("dynamic",e,t,...r)}},274:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setIntervalAsync=t.clearIntervalAsync=void 0;const r=n(574);Object.defineProperty(t,"clearIntervalAsync",{enumerable:!0,get:function(){return r.clearIntervalAsync}});const a=n(143);t.setIntervalAsync=function(e,t){if("function"!=typeof e)throw new TypeError("First argument is not a function");if("number"!=typeof t)throw new TypeError("Second argument is not a number");for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];return a.SetIntervalAsyncTimer.startTimer("fixed",e,t,...r)}},143:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SetIntervalAsyncTimer=void 0;class n{#e=void 0;#t=void 0;#n=!1;static startTimer(e,t,r){r=Math.min(Math.max(Math.trunc(r),10),2147483647);const a=new n;for(var s=arguments.length,i=new Array(s>3?s-3:0),o=3;o<s;o++)i[o-3]=arguments[o];return a.#r(e,t,r,r,...i),a}static async stopTimer(e){e.#n=!0,e.#e&&clearTimeout(e.#e),e.#t&&await e.#t}#r(e,t,n,r){for(var a=arguments.length,s=new Array(a>4?a-4:0),i=4;i<a;i++)s[i-4]=arguments[i];this.#e=setTimeout((async()=>{this.#e=void 0,this.#t=this.#a(e,t,n,...s),await this.#t,this.#t=void 0}),r)}async#a(e,t,n){const r=(new Date).getTime();for(var a=arguments.length,s=new Array(a>3?a-3:0),i=3;i<a;i++)s[i-3]=arguments[i];try{await t(...s)}finally{if(!this.#n){const a=(new Date).getTime()-r,i="dynamic"===e?n>a?n-a:0:n;this.#r(e,t,n,i,...s)}}}}t.SetIntervalAsyncTimer=n}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}var r={};(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.fixed=e.dynamic=e.clearIntervalAsync=e.setIntervalAsync=void 0;const t=n(574);Object.defineProperty(e,"clearIntervalAsync",{enumerable:!0,get:function(){return t.clearIntervalAsync}});const a=n(273),s=n(274),i=a.setIntervalAsync;e.setIntervalAsync=i;const o={setIntervalAsync:a.setIntervalAsync};e.dynamic=o;const c={setIntervalAsync:s.setIntervalAsync};e.fixed=c})(),SetIntervalAsync=r})(); |
{ | ||
"name": "@apigames/async-interval", | ||
"version": "24.1.0", | ||
"version": "24.1.1", | ||
"description": "Modern version of setInterval for promises and async functions available in Node.js and browsers.", | ||
@@ -72,19 +72,19 @@ "repository": { | ||
"devDependencies": { | ||
"@babel/core": "^7.23.9", | ||
"@babel/core": "^7.24.0", | ||
"@babel/plugin-transform-modules-commonjs": "^7.23.3", | ||
"@babel/plugin-transform-runtime": "^7.23.9", | ||
"@babel/preset-env": "^7.23.9", | ||
"@babel/plugin-transform-runtime": "^7.24.0", | ||
"@babel/preset-env": "^7.24.0", | ||
"@istanbuljs/nyc-config-typescript": "^1.0.2", | ||
"@sinonjs/fake-timers": "^11.2.2", | ||
"@types/mocha": "^10.0.6", | ||
"@types/node": "^20.11.14", | ||
"@types/node": "^20.11.24", | ||
"@types/sinon": "^17.0.3", | ||
"@types/sinonjs__fake-timers": "^8.1.5", | ||
"@typescript-eslint/eslint-plugin": "^6.20.0", | ||
"@typescript-eslint/parser": "^6.20.0", | ||
"@typescript-eslint/eslint-plugin": "^7.1.0", | ||
"@typescript-eslint/parser": "^7.1.0", | ||
"babel-loader": "^9.1.3", | ||
"eslint": "^8.56.0", | ||
"mocha": "^10.2.0", | ||
"eslint": "^8.57.0", | ||
"mocha": "^10.3.0", | ||
"nyc": "^15.1.0", | ||
"prettier": "^3.2.4", | ||
"prettier": "^3.2.5", | ||
"rimraf": "^5.0.5", | ||
@@ -95,5 +95,5 @@ "sinon": "^17.0.1", | ||
"typescript": "^5.3.3", | ||
"webpack": "^5.90.0", | ||
"webpack": "^5.90.3", | ||
"webpack-cli": "^5.1.4" | ||
} | ||
} |
32179
-0.01%