MCPcopy
hub / github.com/vuejs/core / warnOnce

Function warnOnce

packages/compiler-sfc/src/warn.ts:3–10  ·  view source on GitHub ↗
(msg: string)

Source from the content-addressed store, hash-verified

1const hasWarned: Record<string, boolean> = {}
2
3export function warnOnce(msg: string): void {
4 const isNodeProd =
5 typeof process !== 'undefined' && process.env.NODE_ENV === 'production'
6 if (!isNodeProd && !__TEST__ && !hasWarned[msg]) {
7 hasWarned[msg] = true
8 warn(msg)
9 }
10}
11
12export function warn(msg: string): void {
13 console.warn(

Callers 2

compileScriptFunction · 0.90
doCompileTemplateFunction · 0.90

Calls 1

warnFunction · 0.70

Tested by

no test coverage detected