1 | (function (factory) {
|
2 | if (typeof module === "object" && typeof module.exports === "object") {
|
3 | var v = factory(require, exports);
|
4 | if (v !== undefined) module.exports = v;
|
5 | }
|
6 | else if (typeof define === "function" && define.amd) {
|
7 | define(["require", "exports", "tslib", "@theintern/common"], factory);
|
8 | }
|
9 | })(function (require, exports) {
|
10 | "use strict";
|
11 | Object.defineProperty(exports, "__esModule", { value: true });
|
12 | exports.now = exports.clearInterval = exports.setInterval = exports.clearTimeout = exports.setTimeout = void 0;
|
13 | var tslib_1 = require("tslib");
|
14 | var common_1 = require("@theintern/common");
|
15 | var _setTimeout = common_1.global.setTimeout;
|
16 | var _clearTimeout = common_1.global.clearTimeout;
|
17 | var _setInterval = common_1.global.setInterval;
|
18 | var _clearInterval = common_1.global.clearInterval;
|
19 | var now = Date.now;
|
20 | function createProxy(func, context) {
|
21 | return function () {
|
22 | var args = [];
|
23 | for (var _i = 0; _i < arguments.length; _i++) {
|
24 | args[_i] = arguments[_i];
|
25 | }
|
26 | return func.call.apply(func, tslib_1.__spreadArray([context], args));
|
27 | };
|
28 | }
|
29 | var proxySetTimeout = createProxy(_setTimeout, common_1.global);
|
30 | exports.setTimeout = proxySetTimeout;
|
31 | var proxySetInterval = createProxy(_setInterval, common_1.global);
|
32 | exports.setInterval = proxySetInterval;
|
33 | var proxyClearTimeout = createProxy(_clearTimeout, common_1.global);
|
34 | exports.clearTimeout = proxyClearTimeout;
|
35 | var proxyClearInterval = createProxy(_clearInterval, common_1.global);
|
36 | exports.clearInterval = proxyClearInterval;
|
37 | var proxyNow = createProxy(now, Date);
|
38 | exports.now = proxyNow;
|
39 | });
|
40 |
|
\ | No newline at end of file |