mirror of
https://github.com/cudr/slate-collaborative.git
synced 2024-10-27 20:34:06 +00:00
10 lines
258 B
TypeScript
10 lines
258 B
TypeScript
|
import toSync from './toSync'
|
||
|
|
||
|
export const toJS = node => JSON.parse(JSON.stringify(node))
|
||
|
|
||
|
export const cloneNode = node => toSync(toJS(node))
|
||
|
|
||
|
const toSlatePath = path => (path ? path.filter(d => Number.isInteger(d)) : [])
|
||
|
|
||
|
export { toSync, toSlatePath }
|