Minor changes
This commit is contained in:
@@ -69,15 +69,10 @@ export function parseTemplateStringE(
|
|||||||
variables: Environment["variables"],
|
variables: Environment["variables"],
|
||||||
myVariables?: Variables
|
myVariables?: Variables
|
||||||
) {
|
) {
|
||||||
/*
|
|
||||||
if (!variables || !str ) {
|
|
||||||
return E.right(str)
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (!variables || !str || !myVariables) {
|
if (!variables || !str || !myVariables) {
|
||||||
return E.right(str)
|
return E.right(str)
|
||||||
}
|
}
|
||||||
|
|
||||||
let result = str
|
let result = str
|
||||||
let depth = 0
|
let depth = 0
|
||||||
let errorBound = 0
|
let errorBound = 0
|
||||||
@@ -97,11 +92,8 @@ export function parseTemplateStringE(
|
|||||||
)
|
)
|
||||||
errorBound++
|
errorBound++
|
||||||
}
|
}
|
||||||
if(depth > ENV_MAX_EXPAND_LIMIT && errorBound <= ENV_MAX_EXPAND_LIMIT) {
|
|
||||||
return E.right(result)
|
return depth <= ENV_MAX_EXPAND_LIMIT && errorBound <= ENV_MAX_EXPAND_LIMIT ? E.right(result) : E.left(ENV_EXPAND_LOOP);
|
||||||
}else{
|
|
||||||
return E.left(ENV_EXPAND_LOOP)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user