/
lizardking
/
react_final
Обзор
Документация
Войти
/
lizardking
/
react_final
Код
Запросы
1
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
src/shared/utils/common.ts
18 строк
456 B
LizardKing
Initial commit
22 ноя 2025, 15:56
22 ноя 2025, 15:56
0df0d9e
Код
Авторство
О чём код?
export const objectHasProperty = <P extends PropertyKey>( obj: unknown, prop: P ): obj is object & Record<P, unknown> => typeof obj === 'object' && !!obj && Object.hasOwn(obj, prop) export const mockFetch = <V>(values: V, ms: number) => new Promise((resolve, reject) => { setTimeout(() => { if (Math.random() > 0.5) { resolve(values) } else { reject({ message: 'Error', }) } }, ms) })