UNPKG

@blazhkoma/draft-convert

Version:

Extensibly serialize & deserialize Draft.js ContentState

9 lines 253 B
export default (function (typeObject) { return function (block) { if (typeof typeObject === 'function') { // handle case where typeObject is already a function return typeObject(block); } return typeObject[block.type]; }; });