1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-30 09:52:58 +02:00
slate/test/helpers/strip-dynamic.js

24 lines
322 B
JavaScript

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