cmacc-compiler
Advanced tools
Comparing version 2.0.19 to 2.0.20
{ | ||
"name": "cmacc-compiler", | ||
"version": "2.0.19", | ||
"version": "2.0.20", | ||
"description": "Cmacc Compiler", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -23,3 +23,2 @@ const find = require('./find'); | ||
from.data = x.data | ||
} | ||
@@ -30,3 +29,12 @@ | ||
from.type = to.type | ||
from.data = to.data | ||
if( to.type === 'string'){ | ||
from.data = to.data.replace(/\{\{([^}]*)\}\}/g, (match, variable) =>{ | ||
const split = x.data.split('.'); | ||
const res = split.slice(0, split.length - 1).join('.') + '.' + variable; | ||
console.log(res) | ||
return `{{${res}}}`; | ||
}) | ||
}else{ | ||
from.data = to.data | ||
} | ||
@@ -33,0 +41,0 @@ } |
@@ -80,4 +80,6 @@ const helpers = require('./helpers'); | ||
content: val.replace(/{{([^{]*)}}/g, function (match, name) { | ||
const res = split.reduce((ast, val) => ast[val], ast); | ||
return res[name] | ||
const split2 = split.concat(name.split('.')); | ||
const last = split2.pop(); | ||
const res = split2.reduce((ast, val) => ast[val], ast); | ||
return res[last] | ||
}), | ||
@@ -84,0 +86,0 @@ variable: x.variable, |
@@ -5,3 +5,3 @@ const url = require('path'); | ||
describe('variable_in_string', function () { | ||
describe('variable_in_mask_complex', function () { | ||
@@ -8,0 +8,0 @@ global.fs = require('fs'); |
@@ -5,3 +5,3 @@ const url = require('path'); | ||
describe('variable_in_string', function () { | ||
describe('variable_in_mask', function () { | ||
@@ -8,0 +8,0 @@ global.fs = require('fs'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70769
163
1997
46