UNPKG
@20minutes/draft-convert
Version:
latest (3.0.3)
3.0.3
3.0.2
3.0.1
3.0.0
Extensibly serialize & deserialize Draft.js ContentState
20minutes/draft-convert
@20minutes/draft-convert
/
esm
/
util
/
blockTypeObjectFunction.js
9 lines
•
253 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
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
]; }; });