From 9ac958a77af06ed9dd76e27a80970f621e2284ef Mon Sep 17 00:00:00 2001 From: "S. Elliott Johnson" Date: Mon, 8 May 2023 21:51:21 -0600 Subject: [PATCH] Manual cleanup of src/runtime/internal/environment.js --- src/runtime/internal/environment.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/runtime/internal/environment.js b/src/runtime/internal/environment.js index af613b902d..821b3a413c 100644 --- a/src/runtime/internal/environment.js +++ b/src/runtime/internal/environment.js @@ -1,13 +1,18 @@ -import { noop } from './utils'; +import { noop } from './utils.js'; + export const is_client = typeof window !== 'undefined'; + /** @type {() => number} */ export let now = is_client ? () => window.performance.now() : () => Date.now(); + export let raf = is_client ? (cb) => requestAnimationFrame(cb) : noop; + // used internally for testing /** @returns {void} */ export function set_now(fn) { now = fn; } + /** @returns {void} */ export function set_raf(fn) { raf = fn;