/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/common/src/pipes/utils.ts
29 строк
804 B
SkyZeroZx
refactor(common): log a warning when a KeyValuePipe receives a signal
25 фев 2026, 19:11
25 фев 2026, 19:11
97ed3d9
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import { Type, ɵRuntimeError as RuntimeError, ɵstringify as stringify, isSignal, } from '@angular/core'; import {RuntimeErrorCode} from '../errors'; export function invalidPipeArgumentError(type: Type<any>, value: Object) { return new RuntimeError( RuntimeErrorCode.INVALID_PIPE_ARGUMENT, ngDevMode && `InvalidPipeArgument: '${value}' for pipe '${stringify(type)}'`, ); } export function warnIfSignal(pipeName: string, value: unknown): void { if (isSignal(value)) { console.warn(`The ${pipeName} does not unwrap signals. Received a signal with value:`, value()); } }