main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
300 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import { Action } from '../types/actions'
|
---|
| 2 | import isPlainObject from './isPlainObject'
|
---|
| 3 |
|
---|
| 4 | export 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 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.