mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-02-24 17:23:07 +01:00
24 lines
342 B
JavaScript
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
|