support raw booleans in block extensions
This commit is contained in:
parent
b959330af6
commit
6626035439
1 changed files with 9 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { compact, forOwn, keys, isString, isFunction, isArray, isNumber, isNull, isObject, isUndefined, map, isRegExp, sortBy } from 'lodash-es'
|
||||
import { compact, forOwn, keys, isBoolean, isString, isFunction, isArray, isNumber, isNull, isObject, isUndefined, map, isRegExp, sortBy } from 'lodash-es'
|
||||
|
||||
|
||||
const
|
||||
|
|
@ -13,7 +13,10 @@ const quotedKey = key =>
|
|||
: key
|
||||
|
||||
const renderValue = (value, tab=TAB) => {
|
||||
if (isString(value)) {
|
||||
if (isBoolean(value)) {
|
||||
return renderBoolean(value)
|
||||
|
||||
} else if (isString(value)) {
|
||||
return renderString(value)
|
||||
|
||||
} else if (isRegExp(value) || isNull(value) || isNumber(value) || isUndefined(value) || value === false) {
|
||||
|
|
@ -48,6 +51,10 @@ const renderString = stringValue => {
|
|||
return `"${stringValue}"`
|
||||
}
|
||||
|
||||
const renderBoolean = boolValue => {
|
||||
return `${boolValue}`
|
||||
}
|
||||
|
||||
const renderFunction = (func, indentation=TAB) => {
|
||||
const
|
||||
functionString = func.toString(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue