worker-timers 8.0.13 → 8.0.15

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/README.md CHANGED
@@ -29,13 +29,13 @@ The usage is exactly the same (despite of the [error handling](#error-handling)
29
29
  as with the corresponding functions on the global scope.
30
30
 
31
31
  ```js
32
- var intervalId = setInterval(() => {
32
+ const intervalId = setInterval(() => {
33
33
  // do something many times
34
34
  }, 100);
35
35
 
36
36
  clearInterval(intervalId);
37
37
 
38
- var timeoutId = setTimeout(() => {
38
+ const timeoutId = setTimeout(() => {
39
39
  // do something once
40
40
  }, 100);
41
41
 
@@ -1,2 +1,2 @@
1
- export declare const worker = "(()=>{\"use strict\";const e=new Map,t=new Map,r=t=>{const r=e.get(t);return void 0!==r&&(clearTimeout(r),e.delete(t),!0)},s=e=>{const r=t.get(e);return void 0!==r&&(clearTimeout(r),t.delete(e),!0)},o=(e,t)=>{const r=performance.now(),s=e+t-r-performance.timeOrigin;return{expected:r+s,remainingDelay:s}},i=(e,t,r,s)=>{const o=r-performance.now();o>0?e.set(t,setTimeout(i,o,e,t,r,s)):(e.delete(t),postMessage({id:null,method:\"call\",params:{timerId:t,timerType:s}}))};addEventListener(\"message\",(({data:n})=>{try{if(\"clear\"===n.method){const{id:e,params:{timerId:t,timerType:o}}=n;if(\"interval\"===o)postMessage({id:e,result:r(t)});else{if(\"timeout\"!==o)throw new Error('The given type \"'.concat(o,'\" is not supported'));postMessage({id:e,result:s(t)})}}else{if(\"set\"!==n.method)throw new Error('The given method \"'.concat(n.method,'\" is not supported'));{const{params:{delay:r,now:s,timerId:a,timerType:m}}=n;if(\"interval\"===m)((t,r,s)=>{const{expected:n,remainingDelay:a}=o(t,s);e.set(r,setTimeout(i,a,e,r,n,\"interval\"))})(r,a,s);else{if(\"timeout\"!==m)throw new Error('The given type \"'.concat(m,'\" is not supported'));((e,r,s)=>{const{expected:n,remainingDelay:a}=o(e,s);t.set(r,setTimeout(i,a,t,r,n,\"timeout\"))})(r,a,s)}}}}catch(e){postMessage({error:{message:e.message},id:n.id,result:null})}}))})();";
1
+ export declare const worker = "(()=>{var e={455:function(e,t){!function(e){\"use strict\";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,s=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<s?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*s);return e(r,i)}if(r.size>n)throw new Error(\"Congratulations, you created a collection of unique numbers which uses all available integers!\");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,u=r(i),c=a(u,i),d=t(c);e.addUniqueNumber=d,e.generateUniqueNumber=c}(t)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}(()=>{\"use strict\";const e=-32603,t=-32602,n=-32601,o=(e,t)=>Object.assign(new Error(e),{status:t}),s=t=>o('The handler of the method called \"'.concat(t,'\" returned an unexpected result.'),e),a=(t,r)=>async({data:{id:a,method:i,params:u}})=>{const c=r[i];try{if(void 0===c)throw(e=>o('The requested method called \"'.concat(e,'\" is not supported.'),n))(i);const r=void 0===u?c():c(u);if(void 0===r)throw(t=>o('The handler of the method called \"'.concat(t,'\" returned no required result.'),e))(i);const d=r instanceof Promise?await r:r;if(null===a){if(void 0!==d.result)throw s(i)}else{if(void 0===d.result)throw s(i);const{result:e,transferables:r=[]}=d;t.postMessage({id:a,result:e},r)}}catch(e){const{message:r,status:n=-32603}=e;t.postMessage({error:{code:n,message:r},id:a})}};var i=r(455);const u=new Map,c=(e,r,n)=>({...r,connect:({port:t})=>{t.start();const n=e(t,r),o=(0,i.generateUniqueNumber)(u);return u.set(o,(()=>{n(),t.close(),u.delete(o)})),{result:o}},disconnect:({portId:e})=>{const r=u.get(e);if(void 0===r)throw(e=>o('The specified parameter called \"portId\" with the given value \"'.concat(e,'\" does not identify a port connected to this worker.'),t))(e);return r(),{result:null}},isSupported:async()=>{if(await new Promise((e=>{const t=new ArrayBuffer(0),{port1:r,port2:n}=new MessageChannel;r.onmessage=({data:t})=>e(null!==t),n.postMessage(t,[t])}))){const e=n();return{result:e instanceof Promise?await e:e}}return{result:!1}}}),d=(e,t,r=()=>!0)=>{const n=c(d,t,r),o=a(e,n);return e.addEventListener(\"message\",o),()=>e.removeEventListener(\"message\",o)},l=e=>t=>{const r=e.get(t);if(void 0===r)return Promise.resolve(!1);const[n,o]=r;return clearTimeout(n),e.delete(t),o(!1),Promise.resolve(!0)},f=(e,t,r)=>(n,o,s)=>{const{expected:a,remainingDelay:i}=e(n,o);return new Promise((e=>{t.set(s,[setTimeout(r,i,a,t,e,s),e])}))},m=(e,t)=>{const r=performance.now(),n=e+t-r-performance.timeOrigin;return{expected:r+n,remainingDelay:n}},p=(e,t,r,n)=>{const o=e-performance.now();o>0?t.set(n,[setTimeout(p,o,e,t,r,n),r]):(t.delete(n),r(!0))},h=new Map,v=l(h),w=new Map,g=l(w),M=f(m,h,p),y=f(m,w,p);d(self,{clear:async({timerId:e,timerType:t})=>({result:await(\"interval\"===t?v(e):g(e))}),set:async({delay:e,now:t,timerId:r,timerType:n})=>({result:await(\"interval\"===n?M:y)(e,t,r)})})})()})();";
2
2
  //# sourceMappingURL=worker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/worker/worker.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,MAAM,szCAA0xC,CAAC"}
1
+ {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/worker/worker.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,MAAM,+nGAAumG,CAAC"}
@@ -1,3 +1,3 @@
1
1
  // This is the minified and stringified code of the worker-timers-worker package.
2
- export const worker = `(()=>{"use strict";const e=new Map,t=new Map,r=t=>{const r=e.get(t);return void 0!==r&&(clearTimeout(r),e.delete(t),!0)},s=e=>{const r=t.get(e);return void 0!==r&&(clearTimeout(r),t.delete(e),!0)},o=(e,t)=>{const r=performance.now(),s=e+t-r-performance.timeOrigin;return{expected:r+s,remainingDelay:s}},i=(e,t,r,s)=>{const o=r-performance.now();o>0?e.set(t,setTimeout(i,o,e,t,r,s)):(e.delete(t),postMessage({id:null,method:"call",params:{timerId:t,timerType:s}}))};addEventListener("message",(({data:n})=>{try{if("clear"===n.method){const{id:e,params:{timerId:t,timerType:o}}=n;if("interval"===o)postMessage({id:e,result:r(t)});else{if("timeout"!==o)throw new Error('The given type "'.concat(o,'" is not supported'));postMessage({id:e,result:s(t)})}}else{if("set"!==n.method)throw new Error('The given method "'.concat(n.method,'" is not supported'));{const{params:{delay:r,now:s,timerId:a,timerType:m}}=n;if("interval"===m)((t,r,s)=>{const{expected:n,remainingDelay:a}=o(t,s);e.set(r,setTimeout(i,a,e,r,n,"interval"))})(r,a,s);else{if("timeout"!==m)throw new Error('The given type "'.concat(m,'" is not supported'));((e,r,s)=>{const{expected:n,remainingDelay:a}=o(e,s);t.set(r,setTimeout(i,a,t,r,n,"timeout"))})(r,a,s)}}}}catch(e){postMessage({error:{message:e.message},id:n.id,result:null})}}))})();`; // tslint:disable-line:max-line-length
2
+ export const worker = `(()=>{var e={455:function(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,s=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<s?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*s);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,u=r(i),c=a(u,i),d=t(c);e.addUniqueNumber=d,e.generateUniqueNumber=c}(t)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}(()=>{"use strict";const e=-32603,t=-32602,n=-32601,o=(e,t)=>Object.assign(new Error(e),{status:t}),s=t=>o('The handler of the method called "'.concat(t,'" returned an unexpected result.'),e),a=(t,r)=>async({data:{id:a,method:i,params:u}})=>{const c=r[i];try{if(void 0===c)throw(e=>o('The requested method called "'.concat(e,'" is not supported.'),n))(i);const r=void 0===u?c():c(u);if(void 0===r)throw(t=>o('The handler of the method called "'.concat(t,'" returned no required result.'),e))(i);const d=r instanceof Promise?await r:r;if(null===a){if(void 0!==d.result)throw s(i)}else{if(void 0===d.result)throw s(i);const{result:e,transferables:r=[]}=d;t.postMessage({id:a,result:e},r)}}catch(e){const{message:r,status:n=-32603}=e;t.postMessage({error:{code:n,message:r},id:a})}};var i=r(455);const u=new Map,c=(e,r,n)=>({...r,connect:({port:t})=>{t.start();const n=e(t,r),o=(0,i.generateUniqueNumber)(u);return u.set(o,(()=>{n(),t.close(),u.delete(o)})),{result:o}},disconnect:({portId:e})=>{const r=u.get(e);if(void 0===r)throw(e=>o('The specified parameter called "portId" with the given value "'.concat(e,'" does not identify a port connected to this worker.'),t))(e);return r(),{result:null}},isSupported:async()=>{if(await new Promise((e=>{const t=new ArrayBuffer(0),{port1:r,port2:n}=new MessageChannel;r.onmessage=({data:t})=>e(null!==t),n.postMessage(t,[t])}))){const e=n();return{result:e instanceof Promise?await e:e}}return{result:!1}}}),d=(e,t,r=()=>!0)=>{const n=c(d,t,r),o=a(e,n);return e.addEventListener("message",o),()=>e.removeEventListener("message",o)},l=e=>t=>{const r=e.get(t);if(void 0===r)return Promise.resolve(!1);const[n,o]=r;return clearTimeout(n),e.delete(t),o(!1),Promise.resolve(!0)},f=(e,t,r)=>(n,o,s)=>{const{expected:a,remainingDelay:i}=e(n,o);return new Promise((e=>{t.set(s,[setTimeout(r,i,a,t,e,s),e])}))},m=(e,t)=>{const r=performance.now(),n=e+t-r-performance.timeOrigin;return{expected:r+n,remainingDelay:n}},p=(e,t,r,n)=>{const o=e-performance.now();o>0?t.set(n,[setTimeout(p,o,e,t,r,n),r]):(t.delete(n),r(!0))},h=new Map,v=l(h),w=new Map,g=l(w),M=f(m,h,p),y=f(m,w,p);d(self,{clear:async({timerId:e,timerType:t})=>({result:await("interval"===t?v(e):g(e))}),set:async({delay:e,now:t,timerId:r,timerType:n})=>({result:await("interval"===n?M:y)(e,t,r)})})})()})();`; // tslint:disable-line:max-line-length
3
3
  //# sourceMappingURL=worker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../src/worker/worker.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,CAAC,MAAM,MAAM,GAAG,uxCAAuxC,CAAC,CAAC,sCAAsC"}
1
+ {"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../src/worker/worker.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,CAAC,MAAM,MAAM,GAAG,omGAAomG,CAAC,CAAC,sCAAsC"}
@@ -24,7 +24,7 @@
24
24
  };
25
25
 
26
26
  // This is the minified and stringified code of the worker-timers-worker package.
27
- var worker = "(()=>{var e={472:(e,t,r)=>{var o,n;void 0===(n=\"function\"==typeof(o=function(){\"use strict\";var e=new Map,t=new Map,r=function(t){var r=e.get(t);return void 0!==r&&(clearTimeout(r),e.delete(t),!0)},o=function(e){var r=t.get(e);return void 0!==r&&(clearTimeout(r),t.delete(e),!0)},n=function(e,t){var r=performance.now(),o=e+t-r-performance.timeOrigin;return{expected:r+o,remainingDelay:o}},i=function(e,t,r,o){var n=r-performance.now();n>0?e.set(t,setTimeout(i,n,e,t,r,o)):(e.delete(t),postMessage({id:null,method:\"call\",params:{timerId:t,timerType:o}}))},a=function(t,r,o){var a=n(t,o),s=a.expected,u=a.remainingDelay;e.set(r,setTimeout(i,u,e,r,s,\"interval\"))},s=function(e,r,o){var a=n(e,o),s=a.expected,u=a.remainingDelay;t.set(r,setTimeout(i,u,t,r,s,\"timeout\"))};addEventListener(\"message\",(function(e){var t=e.data;try{if(\"clear\"===t.method){var n=t.id,i=t.params,u=i.timerId,d=i.timerType;if(\"interval\"===d)postMessage({id:n,result:r(u)});else{if(\"timeout\"!==d)throw new Error('The given type \"'.concat(d,'\" is not supported'));postMessage({id:n,result:o(u)})}}else{if(\"set\"!==t.method)throw new Error('The given method \"'.concat(t.method,'\" is not supported'));var p=t.params,c=p.delay,m=p.now,l=p.timerId,v=p.timerType;if(\"interval\"===v)a(c,l,m);else{if(\"timeout\"!==v)throw new Error('The given type \"'.concat(v,'\" is not supported'));s(c,l,m)}}}catch(e){postMessage({error:{message:e.message},id:t.id,result:null})}}))})?o.call(t,r,t,e):o)||(e.exports=n)}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{\"use strict\";r(472)})()})();"; // tslint:disable-line:max-line-length
27
+ var worker = "(()=>{var t={45:(t,e,r)=>{var n=r(738).default;t.exports=function(t,e){if(\"object\"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||\"default\");if(\"object\"!=n(o))return o;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},79:t=>{t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n},t.exports.__esModule=!0,t.exports.default=t.exports},122:(t,e,r)=>{var n=r(79);t.exports=function(t,e){if(t){if(\"string\"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return\"Object\"===r&&t.constructor&&(r=t.constructor.name),\"Map\"===r||\"Set\"===r?Array.from(t):\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports},156:t=>{t.exports=function(t,e){var r=null==t?null:\"undefined\"!=typeof Symbol&&t[Symbol.iterator]||t[\"@@iterator\"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}},t.exports.__esModule=!0,t.exports.default=t.exports},293:t=>{function e(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=t.apply(r,n);function u(t){e(a,o,i,u,c,\"next\",t)}function c(t){e(a,o,i,u,c,\"throw\",t)}u(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},389:function(t,e){!function(t){\"use strict\";var e=function(t){return function(e){var r=t(e);return e.add(r),r}},r=function(t){return function(e,r){return t.set(e,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,i=2*o,a=function(t,e){return function(r){var a=e.get(r),u=void 0===a?r.size:a<i?a+1:0;if(!r.has(u))return t(r,u);if(r.size<o){for(;r.has(u);)u=Math.floor(Math.random()*i);return t(r,u)}if(r.size>n)throw new Error(\"Congratulations, you created a collection of unique numbers which uses all available integers!\");for(;r.has(u);)u=Math.floor(Math.random()*n);return t(r,u)}},u=new WeakMap,c=r(u),s=a(c,u),f=e(s);t.addUniqueNumber=f,t.generateUniqueNumber=s}(e)},472:function(t,e,r){!function(t,e,r,n){\"use strict\";var o=function(t){return function(e){var r=t.get(e);if(void 0===r)return Promise.resolve(!1);var o=n(r,2),i=o[0],a=o[1];return clearTimeout(i),t.delete(e),a(!1),Promise.resolve(!0)}},i=function(t,e,r){return function(n,o,i){var a=t(n,o),u=a.expected,c=a.remainingDelay;return new Promise((function(t){e.set(i,[setTimeout(r,c,u,e,t,i),t])}))}},a=function(t,e){var r=performance.now(),n=t+e-r-performance.timeOrigin;return{expected:r+n,remainingDelay:n}},u=function(t,e,r,n){var o=t-performance.now();o>0?e.set(n,[setTimeout(u,o,t,e,r,n),r]):(e.delete(n),r(!0))},c=new Map,s=o(c),f=new Map,l=o(f),p=i(a,c,u),h=i(a,f,u);r.createWorker(self,{clear:function(){var r=t(e.mark((function t(r){var n,o;return e.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.timerId,o=r.timerType,t.next=3,\"interval\"===o?s(n):l(n);case 3:return t.t0=t.sent,t.abrupt(\"return\",{result:t.t0});case 5:case\"end\":return t.stop()}}),t)})));function n(t){return r.apply(this,arguments)}return n}(),set:function(){var r=t(e.mark((function t(r){var n,o,i,a;return e.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.delay,o=r.now,i=r.timerId,a=r.timerType,t.next=3,(\"interval\"===a?p:h)(n,o,i);case 3:return t.t0=t.sent,t.abrupt(\"return\",{result:t.t0});case 5:case\"end\":return t.stop()}}),t)})));function n(t){return r.apply(this,arguments)}return n}()})}(r(293),r(756),r(623),r(715))},623:function(t,e,r){!function(t,e,r,n,o){\"use strict\";var i={INTERNAL_ERROR:-32603,INVALID_PARAMS:-32602,METHOD_NOT_FOUND:-32601},a=function(t,e){return Object.assign(new Error(t),{status:e})},u=function(t){return a('The requested method called \"'.concat(t,'\" is not supported.'),i.METHOD_NOT_FOUND)},c=function(t){return a('The handler of the method called \"'.concat(t,'\" returned no required result.'),i.INTERNAL_ERROR)},s=function(t){return a('The handler of the method called \"'.concat(t,'\" returned an unexpected result.'),i.INTERNAL_ERROR)},f=function(t){return a('The specified parameter called \"portId\" with the given value \"'.concat(t,'\" does not identify a port connected to this worker.'),i.INVALID_PARAMS)},l=function(t,n){return function(){var o=e(r.mark((function e(o){var i,a,f,l,p,h,d,v,y,m,x,g,b;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=o.data,a=i.id,f=i.method,l=i.params,p=n[f],e.prev=2,void 0!==p){e.next=5;break}throw u(f);case 5:if(void 0!==(h=void 0===l?p():p(l))){e.next=8;break}throw c(f);case 8:if(!(h instanceof Promise)){e.next=14;break}return e.next=11,h;case 11:e.t0=e.sent,e.next=15;break;case 14:e.t0=h;case 15:if(d=e.t0,null!==a){e.next=21;break}if(void 0===d.result){e.next=19;break}throw s(f);case 19:e.next=25;break;case 21:if(void 0!==d.result){e.next=23;break}throw s(f);case 23:v=d.result,y=d.transferables,m=void 0===y?[]:y,t.postMessage({id:a,result:v},m);case 25:e.next=31;break;case 27:e.prev=27,e.t1=e.catch(2),x=e.t1.message,g=e.t1.status,b=void 0===g?-32603:g,t.postMessage({error:{code:b,message:x},id:a});case 31:case\"end\":return e.stop()}}),e,null,[[2,27]])})));return function(t){return o.apply(this,arguments)}}()},p=function(){return new Promise((function(t){var e=new ArrayBuffer(0),r=new MessageChannel,n=r.port1,o=r.port2;n.onmessage=function(e){var r=e.data;return t(null!==r)},o.postMessage(e,[e])}))};function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var v=new Map,y=function(t,n,i){return d(d({},n),{},{connect:function(e){var r=e.port;r.start();var i=t(r,n),a=o.generateUniqueNumber(v);return v.set(a,(function(){i(),r.close(),v.delete(a)})),{result:a}},disconnect:function(t){var e=t.portId,r=v.get(e);if(void 0===r)throw f(e);return r(),{result:null}},isSupported:function(){var t=e(r.mark((function t(){var e,n;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p();case 2:if(!t.sent){t.next=14;break}if(!((e=i())instanceof Promise)){t.next=11;break}return t.next=8,e;case 8:t.t0=t.sent,t.next=12;break;case 11:t.t0=e;case 12:return n=t.t0,t.abrupt(\"return\",{result:n});case 14:return t.abrupt(\"return\",{result:!1});case 15:case\"end\":return t.stop()}}),t)})));function n(){return t.apply(this,arguments)}return n}()})},m=function(t,e){var r=y(m,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0}),n=l(t,r);return t.addEventListener(\"message\",n),function(){return t.removeEventListener(\"message\",n)}};t.createWorker=m,t.isSupported=p}(e,r(293),r(756),r(693),r(389))},633:(t,e,r)=>{var n=r(738).default;function o(){\"use strict\";t.exports=o=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var e,r={},i=Object.prototype,a=i.hasOwnProperty,u=Object.defineProperty||function(t,e,r){t[e]=r.value},c=\"function\"==typeof Symbol?Symbol:{},s=c.iterator||\"@@iterator\",f=c.asyncIterator||\"@@asyncIterator\",l=c.toStringTag||\"@@toStringTag\";function p(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},\"\")}catch(e){p=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),a=new A(n||[]);return u(i,\"_invoke\",{value:k(t,r,a)}),i}function d(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}r.wrap=h;var v=\"suspendedStart\",y=\"suspendedYield\",m=\"executing\",x=\"completed\",g={};function b(){}function w(){}function _(){}var O={};p(O,s,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(I([])));j&&j!==i&&a.call(j,s)&&(O=j);var L=_.prototype=b.prototype=Object.create(O);function M(t){[\"next\",\"throw\",\"return\"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function r(o,i,u,c){var s=d(t[o],t,i);if(\"throw\"!==s.type){var f=s.arg,l=f.value;return l&&\"object\"==n(l)&&a.call(l,\"__await\")?e.resolve(l.__await).then((function(t){r(\"next\",t,u,c)}),(function(t){r(\"throw\",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return r(\"throw\",t,u,c)}))}c(s.arg)}var o;u(this,\"_invoke\",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function k(t,r,n){var o=v;return function(i,a){if(o===m)throw Error(\"Generator is already running\");if(o===x){if(\"throw\"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=N(u,n);if(c){if(c===g)continue;return c}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===v)throw o=x,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=m;var s=d(t,r,n);if(\"normal\"===s.type){if(o=n.done?x:y,s.arg===g)continue;return{value:s.arg,done:n.done}}\"throw\"===s.type&&(o=x,n.method=\"throw\",n.arg=s.arg)}}}function N(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,\"throw\"===n&&t.iterator.return&&(r.method=\"return\",r.arg=e,N(t,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),g;var i=d(o,t.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=e),r.delegate=null,g):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t||\"\"===t){var r=t[s];if(r)return r.call(t);if(\"function\"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+\" is not iterable\")}return w.prototype=_,u(L,\"constructor\",{value:_,configurable:!0}),u(_,\"constructor\",{value:w,configurable:!0}),w.displayName=p(_,l,\"GeneratorFunction\"),r.isGeneratorFunction=function(t){var e=\"function\"==typeof t&&t.constructor;return!!e&&(e===w||\"GeneratorFunction\"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,p(t,l,\"GeneratorFunction\")),t.prototype=Object.create(L),t},r.awrap=function(t){return{__await:t}},M(P.prototype),p(P.prototype,f,(function(){return this})),r.AsyncIterator=P,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new P(h(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},M(L),p(L,l,\"Generator\"),p(L,s,(function(){return this})),p(L,\"toString\",(function(){return\"[object Generator]\"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=I,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method=\"next\",this.arg=e,this.tryEntries.forEach(S),!t)for(var r in this)\"t\"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(\"throw\"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type=\"throw\",u.arg=t,r.next=n,o&&(r.method=\"next\",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if(\"root\"===i.tryLoc)return n(\"end\");if(i.tryLoc<=this.prev){var c=a.call(i,\"catchLoc\"),s=a.call(i,\"finallyLoc\");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw Error(\"try statement without catch or finally\");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,\"finallyLoc\")&&this.prev<n.finallyLoc){var o=n;break}}o&&(\"break\"===t||\"continue\"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method=\"next\",this.next=o.finallyLoc,g):this.complete(i)},complete:function(t,e){if(\"throw\"===t.type)throw t.arg;return\"break\"===t.type||\"continue\"===t.type?this.next=t.arg:\"return\"===t.type?(this.rval=this.arg=t.arg,this.method=\"return\",this.next=\"end\"):\"normal\"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;S(r)}return o}}throw Error(\"illegal catch attempt\")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=e),g}},r}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},693:(t,e,r)=>{var n=r(736);t.exports=function(t,e,r){return(e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.__esModule=!0,t.exports.default=t.exports},715:(t,e,r)=>{var n=r(987),o=r(156),i=r(122),a=r(752);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},736:(t,e,r)=>{var n=r(738).default,o=r(45);t.exports=function(t){var e=o(t,\"string\");return\"symbol\"==n(e)?e:e+\"\"},t.exports.__esModule=!0,t.exports.default=t.exports},738:t=>{function e(r){return t.exports=e=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},752:t=>{t.exports=function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")},t.exports.__esModule=!0,t.exports.default=t.exports},756:(t,e,r)=>{var n=r(633)();t.exports=n;try{regeneratorRuntime=n}catch(t){\"object\"==typeof globalThis?globalThis.regeneratorRuntime=n:Function(\"r\",\"regeneratorRuntime = r\")(n)}},987:t=>{t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{\"use strict\";r(472)})()})();"; // tslint:disable-line:max-line-length
28
28
 
29
29
  var loadOrReturnBroker = createLoadOrReturnBroker(workerTimersBroker.load, worker);
30
30
  var clearInterval = function clearInterval(timerId) {
package/package.json CHANGED
@@ -15,21 +15,21 @@
15
15
  }
16
16
  ],
17
17
  "dependencies": {
18
- "@babel/runtime": "^7.26.0",
18
+ "@babel/runtime": "^7.26.9",
19
19
  "tslib": "^2.8.1",
20
- "worker-timers-broker": "^7.1.9",
21
- "worker-timers-worker": "^8.0.10"
20
+ "worker-timers-broker": "^8.0.1",
21
+ "worker-timers-worker": "^9.0.1"
22
22
  },
23
23
  "description": "A replacement for setInterval() and setTimeout() which works in unfocused windows.",
24
24
  "devDependencies": {
25
25
  "@babel/cli": "^7.26.4",
26
- "@babel/core": "^7.26.0",
26
+ "@babel/core": "^7.26.9",
27
27
  "@babel/plugin-external-helpers": "^7.25.9",
28
- "@babel/plugin-transform-runtime": "^7.25.9",
29
- "@babel/preset-env": "^7.26.0",
28
+ "@babel/plugin-transform-runtime": "^7.26.9",
29
+ "@babel/preset-env": "^7.26.9",
30
30
  "@babel/register": "^7.25.9",
31
- "@commitlint/cli": "^19.6.1",
32
- "@commitlint/config-angular": "^19.7.0",
31
+ "@commitlint/cli": "^19.7.1",
32
+ "@commitlint/config-angular": "^19.7.1",
33
33
  "@rollup/plugin-babel": "^6.0.4",
34
34
  "@rollup/plugin-replace": "^6.0.2",
35
35
  "babel-loader": "^9.2.1",
@@ -50,22 +50,22 @@
50
50
  "karma-sinon-chai": "^2.0.2",
51
51
  "karma-webkit-launcher": "^2.6.0",
52
52
  "karma-webpack": "^5.0.1",
53
- "lint-staged": "^15.3.0",
53
+ "lint-staged": "^15.4.3",
54
54
  "load-grunt-config": "^4.0.1",
55
- "memfs": "^4.15.3",
55
+ "memfs": "^4.17.0",
56
56
  "mocha": "^10.8.2",
57
- "prettier": "^3.4.2",
57
+ "prettier": "^3.5.1",
58
58
  "rimraf": "^6.0.1",
59
- "rollup": "^4.30.0",
59
+ "rollup": "^4.34.8",
60
60
  "sinon": "^17.0.2",
61
61
  "sinon-chai": "^3.7.0",
62
62
  "terser-webpack-plugin": "^5.3.11",
63
- "ts-loader": "^9.5.1",
63
+ "ts-loader": "^9.5.2",
64
64
  "tsconfig-holy-grail": "^15.0.2",
65
65
  "tslint": "^6.1.3",
66
66
  "tslint-config-holy-grail": "^56.0.6",
67
- "typescript": "^5.7.2",
68
- "webpack": "^5.97.1",
67
+ "typescript": "^5.7.3",
68
+ "webpack": "^5.98.0",
69
69
  "webpack-cli": "^6.0.1"
70
70
  },
71
71
  "files": [
@@ -102,5 +102,5 @@
102
102
  "test": "grunt lint && grunt test"
103
103
  },
104
104
  "types": "build/es2019/module.d.ts",
105
- "version": "8.0.13"
105
+ "version": "8.0.15"
106
106
  }
@@ -1,2 +1,2 @@
1
1
  // This is the minified and stringified code of the worker-timers-worker package.
2
- export const worker = `(()=>{"use strict";const e=new Map,t=new Map,r=t=>{const r=e.get(t);return void 0!==r&&(clearTimeout(r),e.delete(t),!0)},s=e=>{const r=t.get(e);return void 0!==r&&(clearTimeout(r),t.delete(e),!0)},o=(e,t)=>{const r=performance.now(),s=e+t-r-performance.timeOrigin;return{expected:r+s,remainingDelay:s}},i=(e,t,r,s)=>{const o=r-performance.now();o>0?e.set(t,setTimeout(i,o,e,t,r,s)):(e.delete(t),postMessage({id:null,method:"call",params:{timerId:t,timerType:s}}))};addEventListener("message",(({data:n})=>{try{if("clear"===n.method){const{id:e,params:{timerId:t,timerType:o}}=n;if("interval"===o)postMessage({id:e,result:r(t)});else{if("timeout"!==o)throw new Error('The given type "'.concat(o,'" is not supported'));postMessage({id:e,result:s(t)})}}else{if("set"!==n.method)throw new Error('The given method "'.concat(n.method,'" is not supported'));{const{params:{delay:r,now:s,timerId:a,timerType:m}}=n;if("interval"===m)((t,r,s)=>{const{expected:n,remainingDelay:a}=o(t,s);e.set(r,setTimeout(i,a,e,r,n,"interval"))})(r,a,s);else{if("timeout"!==m)throw new Error('The given type "'.concat(m,'" is not supported'));((e,r,s)=>{const{expected:n,remainingDelay:a}=o(e,s);t.set(r,setTimeout(i,a,t,r,n,"timeout"))})(r,a,s)}}}}catch(e){postMessage({error:{message:e.message},id:n.id,result:null})}}))})();`; // tslint:disable-line:max-line-length
2
+ export const worker = `(()=>{var e={455:function(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,s=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<s?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*s);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,u=r(i),c=a(u,i),d=t(c);e.addUniqueNumber=d,e.generateUniqueNumber=c}(t)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}(()=>{"use strict";const e=-32603,t=-32602,n=-32601,o=(e,t)=>Object.assign(new Error(e),{status:t}),s=t=>o('The handler of the method called "'.concat(t,'" returned an unexpected result.'),e),a=(t,r)=>async({data:{id:a,method:i,params:u}})=>{const c=r[i];try{if(void 0===c)throw(e=>o('The requested method called "'.concat(e,'" is not supported.'),n))(i);const r=void 0===u?c():c(u);if(void 0===r)throw(t=>o('The handler of the method called "'.concat(t,'" returned no required result.'),e))(i);const d=r instanceof Promise?await r:r;if(null===a){if(void 0!==d.result)throw s(i)}else{if(void 0===d.result)throw s(i);const{result:e,transferables:r=[]}=d;t.postMessage({id:a,result:e},r)}}catch(e){const{message:r,status:n=-32603}=e;t.postMessage({error:{code:n,message:r},id:a})}};var i=r(455);const u=new Map,c=(e,r,n)=>({...r,connect:({port:t})=>{t.start();const n=e(t,r),o=(0,i.generateUniqueNumber)(u);return u.set(o,(()=>{n(),t.close(),u.delete(o)})),{result:o}},disconnect:({portId:e})=>{const r=u.get(e);if(void 0===r)throw(e=>o('The specified parameter called "portId" with the given value "'.concat(e,'" does not identify a port connected to this worker.'),t))(e);return r(),{result:null}},isSupported:async()=>{if(await new Promise((e=>{const t=new ArrayBuffer(0),{port1:r,port2:n}=new MessageChannel;r.onmessage=({data:t})=>e(null!==t),n.postMessage(t,[t])}))){const e=n();return{result:e instanceof Promise?await e:e}}return{result:!1}}}),d=(e,t,r=()=>!0)=>{const n=c(d,t,r),o=a(e,n);return e.addEventListener("message",o),()=>e.removeEventListener("message",o)},l=e=>t=>{const r=e.get(t);if(void 0===r)return Promise.resolve(!1);const[n,o]=r;return clearTimeout(n),e.delete(t),o(!1),Promise.resolve(!0)},f=(e,t,r)=>(n,o,s)=>{const{expected:a,remainingDelay:i}=e(n,o);return new Promise((e=>{t.set(s,[setTimeout(r,i,a,t,e,s),e])}))},m=(e,t)=>{const r=performance.now(),n=e+t-r-performance.timeOrigin;return{expected:r+n,remainingDelay:n}},p=(e,t,r,n)=>{const o=e-performance.now();o>0?t.set(n,[setTimeout(p,o,e,t,r,n),r]):(t.delete(n),r(!0))},h=new Map,v=l(h),w=new Map,g=l(w),M=f(m,h,p),y=f(m,w,p);d(self,{clear:async({timerId:e,timerType:t})=>({result:await("interval"===t?v(e):g(e))}),set:async({delay:e,now:t,timerId:r,timerType:n})=>({result:await("interval"===n?M:y)(e,t,r)})})})()})();`; // tslint:disable-line:max-line-length