UNPKG

2.1 kBSource Map (JSON)View Raw
1{"version":3,"file":"time.js","sourceRoot":"","sources":["../../../../src/lib/common/time.ts"],"names":[],"mappings":";;;;;;;;;;;;;IAAA,4CAA2C;IAI3C,IAAM,WAAW,GAAG,eAAM,CAAC,UAAU,CAAC;IACtC,IAAM,aAAa,GAAG,eAAM,CAAC,YAAY,CAAC;IAC1C,IAAM,YAAY,GAAG,eAAM,CAAC,WAAW,CAAC;IACxC,IAAM,cAAc,GAAG,eAAM,CAAC,aAAa,CAAC;IAG5C,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;IAKrB,SAAS,WAAW,CAAoC,IAAO,EAAE,OAAY;QAC3E,OAAO;YAAC,cAAsB;iBAAtB,UAAsB,EAAtB,qBAAsB,EAAtB,IAAsB;gBAAtB,yBAAsB;;YAC5B,OAAO,IAAI,CAAC,IAAI,OAAT,IAAI,yBAAM,OAAO,GAAK,IAAI,GAAE;QACrC,CAAC,CAAC;IACJ,CAAC;IAED,IAAM,eAAe,GAAG,WAAW,CAAC,WAAW,EAAE,eAAM,CAAC,CAAC;IAOpC,qCAAU;IAN/B,IAAM,gBAAgB,GAAG,WAAW,CAAC,YAAY,EAAE,eAAM,CAAC,CAAC;IAQrC,uCAAW;IAPjC,IAAM,iBAAiB,GAAG,WAAW,CAAC,aAAa,EAAE,eAAM,CAAC,CAAC;IAMtC,yCAAY;IALnC,IAAM,kBAAkB,GAAG,WAAW,CAAC,cAAc,EAAE,eAAM,CAAC,CAAC;IAOvC,2CAAa;IANrC,IAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAO1B,uBAAG","sourcesContent":["import { global } from '@theintern/common';\n\n// Take a copy of the original timer functions so that they can be safely\n// stubbed in test code and not affect core functionality\nconst _setTimeout = global.setTimeout;\nconst _clearTimeout = global.clearTimeout;\nconst _setInterval = global.setInterval;\nconst _clearInterval = global.clearInterval;\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst now = Date.now;\n\n/**\n * Create a proxy function that will call a given function with a given context\n */\nfunction createProxy<F extends (...args: any[]) => any>(func: F, context: any) {\n return (...args: Parameters<F>) => {\n return func.call(context, ...args);\n };\n}\n\nconst proxySetTimeout = createProxy(_setTimeout, global);\nconst proxySetInterval = createProxy(_setInterval, global);\nconst proxyClearTimeout = createProxy(_clearTimeout, global);\nconst proxyClearInterval = createProxy(_clearInterval, global);\nconst proxyNow = createProxy(now, Date);\n\nexport {\n proxySetTimeout as setTimeout,\n proxyClearTimeout as clearTimeout,\n proxySetInterval as setInterval,\n proxyClearInterval as clearInterval,\n proxyNow as now\n};\n"]}
\No newline at end of file