Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

worker-timers-worker

Package Overview
Dependencies
Maintainers
1
Versions
168
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

worker-timers-worker - npm Package Compare versions

Comparing version 4.0.3 to 4.0.4

9

build/es5/bundle.js

@@ -1,3 +0,6 @@

(function () {
'use strict';
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
(factory());
}(this, (function () { 'use strict';

@@ -109,2 +112,2 @@ var scheduledIntervalIdentifiers = new Map();

}());
})));

@@ -1,1 +0,1 @@

!function(){"use strict";var e=new Map,t=new Map,r=function(t){var r=e.get(t);if(void 0===r)throw new Error('There is no interval scheduled with the given id "'+t+'".');clearTimeout(r),e.delete(t)},i=function(e){var r=t.get(e);if(void 0===r)throw new Error('There is no timeout scheduled with the given id "'+e+'".');clearTimeout(r),t.delete(e)},n=function(e,t){var r=void 0,i=void 0;if("performance"in self){var n=performance.now();r=n,i=e-Math.max(0,n-t)}else r=Date.now(),i=e;return{expected:r+i,remainingDelay:i}},o=function e(t,r,i,n){var o="performance"in self?performance.now():Date.now();o>i?postMessage({id:null,method:"call",params:{timerId:r,timerType:n}}):t.set(r,setTimeout(e,i-o,t,r,i,n))},a=function(t,r,i){var a=n(t,i),s=a.expected,d=a.remainingDelay;e.set(r,setTimeout(o,d,e,r,s,"interval"))},s=function(e,r,i){var a=n(e,i),s=a.expected,d=a.remainingDelay;t.set(r,setTimeout(o,d,t,r,s,"timeout"))};addEventListener("message",function(e){var t=e.data;try{if("clear"===t.method){var n=t.id,o=t.params,d=o.timerId,m=o.timerType;if("interval"===m)r(d),postMessage({error:null,id:n});else{if("timeout"!==m)throw new Error('The given type "'+m+'" is not supported');i(d),postMessage({error:null,id:n})}}else{if("set"!==t.method)throw new Error('The given method "'+t.method+'" is not supported');var l=t.params,u=l.delay,p=l.now,v=l.timerId,c=l.timerType;if("interval"===c)a(u,v,p);else{if("timeout"!==c)throw new Error('The given type "'+c+'" is not supported');s(u,v,p)}}}catch(e){postMessage({error:{message:e.message},id:t.id,result:null})}})}();
!function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1);addEventListener("message",function(e){var t=e.data;try{if("clear"===t.method){var r=t.id,i=t.params,o=i.timerId,a=i.timerType;if("interval"===a)Object(n.a)(o),postMessage({error:null,id:r});else{if("timeout"!==a)throw new Error('The given type "'+a+'" is not supported');Object(n.b)(o),postMessage({error:null,id:r})}}else{if("set"!==t.method)throw new Error('The given method "'+t.method+'" is not supported');var s=t.params,u=s.delay,c=s.now,d=s.timerId,l=s.timerType;if("interval"===l)Object(n.c)(u,d,c);else{if("timeout"!==l)throw new Error('The given type "'+l+'" is not supported');Object(n.d)(u,d,c)}}}catch(e){postMessage({error:{message:e.message},id:t.id,result:null})}})},function(e,t,r){"use strict";r.d(t,"a",function(){return o}),r.d(t,"b",function(){return a}),r.d(t,"c",function(){return c}),r.d(t,"d",function(){return d});var n=new Map,i=new Map,o=function(e){var t=n.get(e);if(void 0===t)throw new Error('There is no interval scheduled with the given id "'+e+'".');clearTimeout(t),n.delete(e)},a=function(e){var t=i.get(e);if(void 0===t)throw new Error('There is no timeout scheduled with the given id "'+e+'".');clearTimeout(t),i.delete(e)},s=function(e,t){var r=void 0,n=void 0;if("performance"in self){var i=performance.now(),o=Math.max(0,i-t);r=i,n=e-o}else r=Date.now(),n=e;return{expected:r+n,remainingDelay:n}},u=function e(t,r,n,i){var o="performance"in self?performance.now():Date.now();o>n?postMessage({id:null,method:"call",params:{timerId:r,timerType:i}}):t.set(r,setTimeout(e,n-o,t,r,n,i))},c=function(e,t,r){var i=s(e,r),o=i.expected,a=i.remainingDelay;n.set(t,setTimeout(u,a,n,t,o,"interval"))},d=function(e,t,r){var n=s(e,r),o=n.expected,a=n.remainingDelay;i.set(t,setTimeout(u,a,i,t,o,"timeout"))}}]);

@@ -6,5 +6,10 @@ {

},
"dependencies": {
"babel-runtime": "^6.26.0",
"tslib": "^1.7.1"
},
"description": "The worker which is used by the worker-timers package.",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-external-helpers": "^6.22.0",

@@ -19,6 +24,6 @@ "babel-plugin-transform-runtime": "^6.23.0",

"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-uglify": "^3.0.0",
"grunt-karma": "^2.0.0",
"grunt-sh": "^0.2.0",
"grunt-tslint": "^5.0.0",
"grunt-webpack": "^3.0.2",
"gruntify-eslint": "^4.0.0",

@@ -69,7 +74,3 @@ "husky": "^0.14.3",

"types": "build/es2015/module.d.ts",
"version": "4.0.3",
"dependencies": {
"babel-runtime": "^6.26.0",
"tslib": "^1.7.1"
}
"version": "4.0.4"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc