fix dynamic variable parse
This commit is contained in:
@@ -417,10 +417,8 @@ function buildOperators (tags) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
case 'end': {
|
case 'end': {
|
||||||
const popped = stack.pop()
|
if (stack.length > 1) {
|
||||||
|
stack.pop().operator.endTag = tag
|
||||||
if (popped.operator) {
|
|
||||||
popped.operator.endTag = tag
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
@@ -434,7 +432,13 @@ function buildOperators (tags) {
|
|||||||
return operators
|
return operators
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hasBlankKey (keyString) {
|
||||||
|
return !keyString || keyString.split('.').some((key) => !key.trim())
|
||||||
|
}
|
||||||
|
|
||||||
function assignNestedSchema (propertiesHash, parentProperties, keyString, value) {
|
function assignNestedSchema (propertiesHash, parentProperties, keyString, value) {
|
||||||
|
if (hasBlankKey(keyString)) return
|
||||||
|
|
||||||
const keys = keyString.split('.')
|
const keys = keyString.split('.')
|
||||||
const lastKey = keys.pop()
|
const lastKey = keys.pop()
|
||||||
|
|
||||||
@@ -460,6 +464,8 @@ function assignNestedSchema (propertiesHash, parentProperties, keyString, value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
function assignNestedSchemaWithPriority (propertiesHash, parentProperties, keyString, newType) {
|
function assignNestedSchemaWithPriority (propertiesHash, parentProperties, keyString, newType) {
|
||||||
|
if (hasBlankKey(keyString)) return
|
||||||
|
|
||||||
const keys = keyString.split('.')
|
const keys = keyString.split('.')
|
||||||
const lastKey = keys.pop()
|
const lastKey = keys.pop()
|
||||||
|
|
||||||
@@ -523,6 +529,8 @@ function processOperators (operators, propertiesHash = {}, parentProperties = {}
|
|||||||
processOperators(op.elseChildren, propertiesHash, parentProperties)
|
processOperators(op.elseChildren, propertiesHash, parentProperties)
|
||||||
break
|
break
|
||||||
case 'for': {
|
case 'for': {
|
||||||
|
if (hasBlankKey(op.variableName)) break
|
||||||
|
|
||||||
const parts = op.variableName.split('.')
|
const parts = op.variableName.split('.')
|
||||||
const singularKey = singularize(parts[parts.length - 1])
|
const singularKey = singularize(parts[parts.length - 1])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user