UNPKG

@atlaskit/adf-schema

Version:

Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs

9 lines 258 B
export const toJSON = node => ({ // eslint-disable-next-line @typescript-eslint/no-explicit-any attrs: Object.keys(node.attrs).reduce((obj, key) => { if (node.attrs[key] !== null) { obj[key] = node.attrs[key]; } return obj; }, {}) });