feat: add test annotations

This commit is contained in:
cudr
2019-10-10 22:45:31 +03:00
parent ab3b8c4ee3
commit 2a4d64b074
10 changed files with 153 additions and 24 deletions

View File

@@ -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))