UNPKG

300 BPlain TextView Raw
1import { Action } from '../types/actions'
2import isPlainObject from './isPlainObject'
3
4export default function isAction(action: unknown): action is Action<string> {
5 return (
6 isPlainObject(action) &&
7 'type' in action &&
8 typeof (action as Record<'type', unknown>).type === 'string'
9 )
10}