UNPKG
@20minutes/draft-convert
Version:
latest (3.1.3)
3.1.3
3.1.2
3.1.1
3.1.0
3.0.3
3.0.2
3.0.1
3.0.0
Extensibly serialize & deserialize Draft.js ContentState
20minutes/draft-convert
@20minutes/draft-convert
/
dist
/
util
/
blockTypeObjectFunction.mjs
8 lines
(7 loc)
•
250 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
export
default
(
(
typeObject
)=>
(
block
)=>
{
if
(
typeof
typeObject ===
'function'
) {
// handle case where typeObject is already a function
return
typeObject
(block); }
return
typeObject[block.
type
]; });