1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-24 17:23:07 +01:00
slate/test/helpers/strip-dynamic.js
2016-07-24 18:57:09 -07:00

24 lines
342 B
JavaScript

/**
* Strip all of the dynamic properties from a `json` object.
*
* @param {Object} json
* @return {Object}
*/
function stripDynamic(json) {
const { key, cache, decorations, ...props } = json
if (props.nodes) {
props.nodes = props.nodes.map(stripDynamic)
}
return props
}
/**
* Export.
*/
export default stripDynamic