@apigames/async-interval
Advanced tools
Comparing version 24.1.4 to 24.1.5
/*! For license information please see set-interval-async.iife.js.LICENSE.txt */ | ||
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})(); | ||
var SetIntervalAsync;(()=>{"use strict";var e={574:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),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)};const r=n(143)},273:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clearIntervalAsync=void 0,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)};const r=n(574);Object.defineProperty(t,"clearIntervalAsync",{enumerable:!0,get:function(){return r.clearIntervalAsync}});const a=n(143)},274:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clearIntervalAsync=void 0,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)};const r=n(574);Object.defineProperty(t,"clearIntervalAsync",{enumerable:!0,get:function(){return r.clearIntervalAsync}});const a=n(143)},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.4", | ||
"version": "24.1.5", | ||
"description": "Modern version of setInterval for promises and async functions available in Node.js and browsers.", | ||
@@ -72,27 +72,27 @@ "repository": { | ||
"devDependencies": { | ||
"@babel/core": "^7.24.7", | ||
"@babel/plugin-transform-modules-commonjs": "^7.24.7", | ||
"@babel/core": "^7.25.2", | ||
"@babel/plugin-transform-modules-commonjs": "^7.24.8", | ||
"@babel/plugin-transform-runtime": "^7.24.7", | ||
"@babel/preset-env": "^7.24.7", | ||
"@babel/preset-env": "^7.25.3", | ||
"@istanbuljs/nyc-config-typescript": "^1.0.2", | ||
"@sinonjs/fake-timers": "^11.2.2", | ||
"@types/mocha": "^10.0.6", | ||
"@types/node": "^20.14.4", | ||
"@types/mocha": "^10.0.7", | ||
"@types/node": "^20.14.15", | ||
"@types/sinon": "^17.0.3", | ||
"@types/sinonjs__fake-timers": "^8.1.5", | ||
"@typescript-eslint/eslint-plugin": "^7.13.1", | ||
"@typescript-eslint/parser": "^7.13.1", | ||
"@typescript-eslint/eslint-plugin": "^7.18.0", | ||
"@typescript-eslint/parser": "^7.18.0", | ||
"babel-loader": "^9.1.3", | ||
"eslint": "^8.57.0", | ||
"mocha": "^10.4.0", | ||
"mocha": "^10.7.3", | ||
"nyc": "^15.1.0", | ||
"prettier": "^3.3.2", | ||
"rimraf": "^5.0.7", | ||
"prettier": "^3.3.3", | ||
"rimraf": "^5.0.10", | ||
"sinon": "^17.0.2", | ||
"source-map-support": "^0.5.21", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.4.5", | ||
"webpack": "^5.92.0", | ||
"typescript": "^5.5.4", | ||
"webpack": "^5.93.0", | ||
"webpack-cli": "^5.1.4" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
32025
144