* Check if a value is a `History` object.
(value: any)
| 24 | */ |
| 25 | |
| 26 | isHistoryStack(value: any): value is HistoryStack { |
| 27 | return ( |
| 28 | isPlainObject(value) && |
| 29 | Array.isArray(value.redos) && |
| 30 | Array.isArray(value.undos) && |
| 31 | (value.redos.length === 0 || Operation.isOperationList(value.redos[0].operations)) && |
| 32 | (value.undos.length === 0 || Operation.isOperationList(value.undos[0].operations)) |
| 33 | ) |
| 34 | }, |
| 35 | |
| 36 | set(editor: Editor, stack: HistoryStack = { undos: [], redos: [] }): void { |
| 37 | HISTORY_STACK.set(editor, stack) |
nothing calls this directly
no test coverage detected
searching dependent graphs…