deno.land / std@0.224.0 / log / warn.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.// This module is browser compatible.
import { getLogger } from "./get_logger.ts";import type { GenericFunction } from "./logger.ts";
/** Log with warning level, using default logger. */export function warn<T>(msg: () => T, ...args: unknown[]): T | undefined;export function warn<T>( msg: T extends GenericFunction ? never : T, ...args: unknown[]): T;export function warn<T>( msg: (T extends GenericFunction ? never : T) | (() => T), ...args: unknown[]): T | undefined { // Assist TS compiler with pass-through generic type if (msg instanceof Function) { return getLogger("default").warn(msg, ...args); } return getLogger("default").warn(msg, ...args);}
std

Version Info

Tagged at
3 weeks ago