/
githubmirror
/
slo-tests
Обзор
Документация
Войти
/
githubmirror
/
slo-tests
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/utils/groupDecorator.ts
21 строка
527 B
Ilya Shevchenko
fix: fix eslint errors
17 май 2023, 18:58
17 май 2023, 18:58
6ff6506
Код
Авторство
О чём код?
import * as core from '@actions/core' export function logGroup<T>(name: string, fun: () => Promise<T>): Promise<T> export function logGroup<T>(name: string, fun: () => T): T // eslint-disable-next-line @typescript-eslint/promise-function-async export function logGroup<T>( name: string, fun: () => Promise<T> | T ): Promise<T> | T { core.startGroup(name) const res = fun() if (res instanceof Promise) { return res.finally(() => { core.endGroup() }) } else { core.endGroup() return res } }