@tldraw/utils 5.1.0 → 5.2.0-canary.083e81484bc9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,4 +40,4 @@ export function omitFromStackTrace<Args extends Array<unknown>, Return>(
40
40
  * Does nothing, but it's really really good at it.
41
41
  * @internal
42
42
  */
43
- export const noop: () => void = () => {}
43
+ export function noop(): void {}
@@ -32,7 +32,7 @@
32
32
  *
33
33
  * @public
34
34
  */
35
- export const isAvifAnimated = (buffer: ArrayBuffer) => {
35
+ export function isAvifAnimated(buffer: ArrayBuffer) {
36
36
  const view = new Uint8Array(buffer)
37
37
  return view[3] === 44
38
38
  }
@@ -24,7 +24,7 @@ export async function fetch(input: RequestInfo | URL, init?: RequestInit): Promi
24
24
  * @returns HTMLImageElement with referrerPolicy set to 'strict-origin-when-cross-origin'
25
25
  * @internal
26
26
  */
27
- export const Image = (width?: number, height?: number) => {
27
+ export function Image(width?: number, height?: number) {
28
28
  // eslint-disable-next-line tldraw/no-restricted-properties
29
29
  const img = new window.Image(width, height)
30
30
  img.referrerPolicy = 'strict-origin-when-cross-origin'
package/src/lib/url.ts CHANGED
@@ -38,7 +38,7 @@
38
38
  *
39
39
  * @public
40
40
  */
41
- export const safeParseUrl = (url: string, baseUrl?: string | URL) => {
41
+ export function safeParseUrl(url: string, baseUrl?: string | URL) {
42
42
  try {
43
43
  return new URL(url, baseUrl)
44
44
  } catch {
@@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
2
2
  import { clearRegisteredVersionsForTests, registerTldrawLibraryVersion } from './version'
3
3
 
4
4
  describe('version utilities', () => {
5
- let mockConsoleLog: ReturnType<typeof vi.fn>
5
+ let mockConsoleLog: ReturnType<typeof vi.fn<(...args: any[]) => any>>
6
6
 
7
7
  beforeEach(() => {
8
8
  mockConsoleLog = vi.fn()