/
githubmirror
/
redux
Обзор
Документация
Войти
/
githubmirror
/
redux
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/utils/isAction.ts
10 строк
305 B
EskiMojo14
some more type imports
12 фев 2024, 23:48
12 фев 2024, 23:48
dfcfab2
Код
Авторство
О чём код?
import type { Action } from '../types/actions' import isPlainObject from './isPlainObject' export default function isAction(action: unknown): action is Action<string> { return ( isPlainObject(action) && 'type' in action && typeof (action as Record<'type', unknown>).type === 'string' ) }