cudr_slate-collaborative/packages/bridge/src/utils/index.ts

10 lines
258 B
TypeScript
Raw Normal View History

2019-10-05 08:44:49 +00:00
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 }