|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
300 bytes
|
| Line | |
|---|
| 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.