/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tools/dgeni/patch-log-service.ts
26 строк
929 B
Paul Gschwendtner
build: fix warnings for api docs generation not printed
28 янв 2022, 21:26
28 янв 2022, 21:26
1f5648f
Код
Авторство
О чём код?
/** Regular expression that matches TypeScript mixin names inside of the project. */ const mixinNameRegex = /_\w+Base/; /** * Function that patches Dgeni's instantiated log service. The patch will hide warnings about * unresolved TypeScript symbols for the mixin base classes. * * ``` * warn: Unresolved TypeScript symbol(s): _MatToolbarMixinBase - doc "material/toolbar/MatToolbar" * (class) - from file "material/toolbar/toolbar.ts" - starting at line 37, ending at line 98 * ``` * * Those warnings are valid, but are not fixable because the base class is created dynamically * through mixin functions and will be stored as a constant. */ export function patchLogService(log: any) { const _warnFn = log.warn; log.warn = function (message: string) { if (message.includes('Unresolved TypeScript symbol') && mixinNameRegex.test(message)) { return; } _warnFn.apply(log, [message]); }; }