mirror of
https://github.com/cudr/slate-collaborative.git
synced 2026-03-02 03:40:18 +00:00
feat: add test annotations
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
import toSync from './toSync'
|
||||
import hexGen from './hexGen'
|
||||
|
||||
export const toJS = node => JSON.parse(JSON.stringify(node))
|
||||
export const toJS = node => {
|
||||
try {
|
||||
return JSON.parse(JSON.stringify(node))
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
export const cloneNode = node => toSync(toJS(node))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user