Comparing version 0.5.3 to 0.5.4
@@ -45,4 +45,4 @@ var helper = require("../lib/util"); | ||
tpl = tpl.replace(/<!--\s{0,}#eachInclude[^\->]*?file\s{0,}=\s{0,}(["'])\s{0,}([^"']*?)\s{0,}\1\s{1,}(.+)\s{1,}as\s{1,}(.+)[^>]*?-->/gi, function (i, m1, m2, m3, m4) { | ||
var tempPath = pathLib.join(param.rootdir || "src", m2); | ||
return "{@each " + m3 + " as " + m4 + "}" + helper.getUnicode(tempPath) + "{@/each}"; | ||
var tempPath = pathLib.join(htmljsfile.replace(reqOpt.path, ''), m2); | ||
return "{@each " + m3 + " as " + m4 + "}" + (helper.getUnicode(tempPath) || '') + "{@/each}"; | ||
}); | ||
@@ -49,0 +49,0 @@ |
@@ -17,14 +17,20 @@ var fsLib = require("fs"); | ||
/* 获取应用filter规则后的url */ | ||
exports.filteredUrl = function (_url, filter) { | ||
filter = filter || {}; | ||
var regx; | ||
var ori_url; | ||
for (var fk in filter) { | ||
regx = new RegExp(fk); | ||
exports.filteredUrl = function (_url, _filter) { | ||
_filter = _filter || {}; | ||
var jsonstr = JSON.stringify(_filter).replace(/\\{2}/g, '\\'); | ||
var filter = []; | ||
jsonstr.replace(/[\{\,]"([^"]*?)"/g, function (all, key) { | ||
filter.push(key); | ||
}); | ||
var regx, ori_url; | ||
for (var k = 0, len = filter.length; k < len; k++) { | ||
regx = new RegExp(filter[k]); | ||
if (regx.test(_url)) { | ||
ori_url = _url; | ||
_url = _url.replace(regx, filter[fk]); | ||
_url = _url.replace(regx, _filter[filter[k]]); | ||
} | ||
} | ||
console.log(_url) | ||
return _url; | ||
}; |
{ | ||
"name": "dac", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "Dynamic Assets Compiler", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
6250
169