/
githubmirror
/
lerna
Обзор
Документация
Войти
/
githubmirror
/
lerna
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
libs/core/src/lib/command/default-options.ts
27 строк
817 B
amorscher
chore(core): remove some ts-ignore comments and any types (#3556)
08 мар 2023, 15:21
Не верифицирован
08 мар 2023, 15:21
9eed42d
Код
Авторство
О чём код?
// _.defaults(), but simplified: // * All inputs are plain objects import { CommandConfigOptions } from "../project"; // * Only own keys, not inherited export function defaultOptions<T extends CommandConfigOptions>(...sources: any[]): T { const options: CommandConfigOptions = {}; for (const source of sources) { if (source != null) { for (const key of Object.keys(source)) { // TODO: refactor to address type issues // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore if (options[key] === undefined) { // TODO: refactor to address type issues // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore options[key] = source[key]; } } } } return options as T; }