worker-timers
Advanced tools
Comparing version 7.0.56 to 7.0.57
@@ -1,7 +0,6 @@ | ||
export * from './types/index'; | ||
import { TWorkerTimers } from './types'; | ||
export declare const clearInterval: TWorkerTimers['clearInterval']; | ||
export declare const clearTimeout: TWorkerTimers['clearTimeout']; | ||
export declare const setInterval: TWorkerTimers['setInterval']; | ||
export declare const setTimeout: TWorkerTimers['setTimeout']; | ||
import { load } from 'worker-timers-broker'; | ||
export declare const clearInterval: ReturnType<typeof load>['clearInterval']; | ||
export declare const clearTimeout: ReturnType<typeof load>['clearTimeout']; | ||
export declare const setInterval: ReturnType<typeof load>['setInterval']; | ||
export declare const setTimeout: ReturnType<typeof load>['setTimeout']; | ||
//# sourceMappingURL=module.d.ts.map |
import { load } from 'worker-timers-broker'; | ||
import { createLoadWorkerTimers } from './factories/load-worker-timers'; | ||
import { createLoadOrReturnBroker } from './factories/load-or-return-broker'; | ||
import { worker } from './worker/worker'; | ||
/* | ||
* @todo Explicitly referencing the barrel file seems to be necessary when enabling the | ||
* isolatedModules compiler option. | ||
*/ | ||
export * from './types/index'; | ||
const loadWorkerTimers = createLoadWorkerTimers(load, worker); | ||
export const clearInterval = (timerId) => loadWorkerTimers().clearInterval(timerId); | ||
export const clearTimeout = (timerId) => loadWorkerTimers().clearTimeout(timerId); | ||
export const setInterval = (func, delay) => loadWorkerTimers().setInterval(func, delay); | ||
export const setTimeout = (func, delay) => loadWorkerTimers().setTimeout(func, delay); | ||
const loadOrReturnBroker = createLoadOrReturnBroker(load, worker); | ||
export const clearInterval = (timerId) => loadOrReturnBroker().clearInterval(timerId); | ||
export const clearTimeout = (timerId) => loadOrReturnBroker().clearTimeout(timerId); | ||
export const setInterval = (func, delay) => loadOrReturnBroker().setInterval(func, delay); | ||
export const setTimeout = (func, delay) => loadOrReturnBroker().setTimeout(func, delay); | ||
//# sourceMappingURL=module.js.map |
@@ -7,7 +7,7 @@ (function (global, factory) { | ||
var workerTimers = null; | ||
var createLoadWorkerTimers = function createLoadWorkerTimers(load, worker) { | ||
var createLoadOrReturnBroker = function createLoadOrReturnBroker(loadBroker, worker) { | ||
var broker = null; | ||
return function () { | ||
if (workerTimers !== null) { | ||
return workerTimers; | ||
if (broker !== null) { | ||
return broker; | ||
} | ||
@@ -18,8 +18,8 @@ var blob = new Blob([worker], { | ||
var url = URL.createObjectURL(blob); | ||
workerTimers = load(url); | ||
// Bug #1: Edge doesn't like the URL to be revoked directly. | ||
workerTimers.setTimeout(function () { | ||
broker = loadBroker(url); | ||
// Bug #1: Edge up until v18 didn't like the URL to be revoked directly. | ||
setTimeout(function () { | ||
return URL.revokeObjectURL(url); | ||
}, 0); | ||
return workerTimers; | ||
}); | ||
return broker; | ||
}; | ||
@@ -31,14 +31,14 @@ }; | ||
var loadWorkerTimers = createLoadWorkerTimers(workerTimersBroker.load, worker); | ||
var loadOrReturnBroker = createLoadOrReturnBroker(workerTimersBroker.load, worker); | ||
var clearInterval = function clearInterval(timerId) { | ||
return loadWorkerTimers().clearInterval(timerId); | ||
return loadOrReturnBroker().clearInterval(timerId); | ||
}; | ||
var clearTimeout = function clearTimeout(timerId) { | ||
return loadWorkerTimers().clearTimeout(timerId); | ||
return loadOrReturnBroker().clearTimeout(timerId); | ||
}; | ||
var setInterval = function setInterval(func, delay) { | ||
return loadWorkerTimers().setInterval(func, delay); | ||
return loadOrReturnBroker().setInterval(func, delay); | ||
}; | ||
var setTimeout = function setTimeout(func, delay) { | ||
return loadWorkerTimers().setTimeout(func, delay); | ||
var setTimeout$1 = function setTimeout(func, delay) { | ||
return loadOrReturnBroker().setTimeout(func, delay); | ||
}; | ||
@@ -49,3 +49,3 @@ | ||
exports.setInterval = setInterval; | ||
exports.setTimeout = setTimeout; | ||
exports.setTimeout = setTimeout$1; | ||
@@ -52,0 +52,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
@@ -18,4 +18,4 @@ { | ||
"dependencies": { | ||
"@babel/runtime": "^7.19.4", | ||
"tslib": "^2.4.0", | ||
"@babel/runtime": "^7.20.1", | ||
"tslib": "^2.4.1", | ||
"worker-timers-broker": "^6.0.77", | ||
@@ -26,2 +26,3 @@ "worker-timers-worker": "^7.0.43" | ||
"devDependencies": { | ||
"@babel/cli": "^7.19.3", | ||
"@babel/core": "^7.19.6", | ||
@@ -31,7 +32,8 @@ "@babel/plugin-external-helpers": "^7.18.6", | ||
"@babel/preset-env": "^7.19.4", | ||
"@commitlint/cli": "^17.1.2", | ||
"@commitlint/config-angular": "^17.1.0", | ||
"@babel/register": "^7.18.9", | ||
"@commitlint/cli": "^17.2.0", | ||
"@commitlint/config-angular": "^17.2.0", | ||
"@rollup/plugin-babel": "^5.3.1", | ||
"@rollup/plugin-replace": "^4.0.0", | ||
"babel-loader": "^8.2.5", | ||
"babel-loader": "^8.3.0", | ||
"chai": "^4.3.6", | ||
@@ -55,4 +57,4 @@ "commitizen": "^4.2.5", | ||
"load-grunt-config": "^4.0.1", | ||
"memfs": "^3.4.7", | ||
"mocha": "^9.2.2", | ||
"memfs": "^3.4.10", | ||
"mocha": "^10.1.0", | ||
"prettier": "^2.7.1", | ||
@@ -102,3 +104,3 @@ "pretty-quick": "^3.1.3", | ||
"types": "build/es2019/module.d.ts", | ||
"version": "7.0.56" | ||
"version": "7.0.57" | ||
} |
import { load } from 'worker-timers-broker'; | ||
import { createLoadWorkerTimers } from './factories/load-worker-timers'; | ||
import { createLoadOrReturnBroker } from './factories/load-or-return-broker'; | ||
import { worker } from './worker/worker'; | ||
/* | ||
* @todo Explicitly referencing the barrel file seems to be necessary when enabling the | ||
* isolatedModules compiler option. | ||
*/ | ||
export * from './types/index'; | ||
const loadOrReturnBroker = createLoadOrReturnBroker(load, worker); | ||
const loadWorkerTimers = createLoadWorkerTimers(load, worker); | ||
export const clearInterval: ReturnType<typeof load>['clearInterval'] = (timerId) => loadOrReturnBroker().clearInterval(timerId); | ||
import { TWorkerTimers } from './types'; | ||
export const clearTimeout: ReturnType<typeof load>['clearTimeout'] = (timerId) => loadOrReturnBroker().clearTimeout(timerId); | ||
export const clearInterval: TWorkerTimers['clearInterval'] = (timerId) => loadWorkerTimers().clearInterval(timerId); | ||
export const setInterval: ReturnType<typeof load>['setInterval'] = (func, delay) => loadOrReturnBroker().setInterval(func, delay); | ||
export const clearTimeout: TWorkerTimers['clearTimeout'] = (timerId) => loadWorkerTimers().clearTimeout(timerId); | ||
export const setInterval: TWorkerTimers['setInterval'] = (func, delay) => loadWorkerTimers().setInterval(func, delay); | ||
export const setTimeout: TWorkerTimers['setTimeout'] = (func, delay) => loadWorkerTimers().setTimeout(func, delay); | ||
export const setTimeout: ReturnType<typeof load>['setTimeout'] = (func, delay) => loadOrReturnBroker().setTimeout(func, delay); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23115
45
20
127
Updated@babel/runtime@^7.20.1
Updatedtslib@^2.4.1