@@ -35,22 +35,21 @@ function replaceVariable(elem, variables, functionArgs, forceVariableAsString, e
3535 if ( associatedValue instanceof Element ) {
3636 // Nothing to be done in here.
3737 return associatedValue ;
38- } else if ( [ 'number' , 'string' , 'boolean' ] . includes ( typeof associatedValue ) ) {
39- if ( typeof associatedValue === 'boolean' ) {
40- return new IdentElement (
41- associatedValue . toString ( ) , startPos , endPos , lineNumber ) ;
42- } else if ( typeof associatedValue === 'number' ||
43- // eslint-disable-next-line no-extra-parens
44- ( ! forceVariableAsString && matchInteger ( associatedValue ) === true ) ) {
45- return new NumberElement ( associatedValue , startPos , endPos , lineNumber ) ;
46- }
38+ } else if ( typeof associatedValue === 'boolean' ) {
39+ return new IdentElement ( associatedValue . toString ( ) , startPos , endPos , lineNumber ) ;
40+ } else if ( typeof associatedValue === 'string' || forceVariableAsString ) {
4741 return new StringElement (
4842 associatedValue ,
4943 startPos ,
5044 endPos ,
5145 `"${ cleanString ( associatedValue ) } "` ,
5246 lineNumber ,
5347 ) ;
48+ } else if ( typeof associatedValue === 'number' ||
49+ // eslint-disable-next-line no-extra-parens
50+ ( ! forceVariableAsString && matchInteger ( associatedValue ) === true )
51+ ) {
52+ return new NumberElement ( associatedValue , startPos , endPos , lineNumber ) ;
5453 }
5554 // this is a JSON dict and it should be parsed.
5655 const p = new Parser ( JSON . stringify ( associatedValue ) ) ;
0 commit comments