coworker-cli
Version:
Template path parser for 58.com velocity templates, which can read your target template and output the main template path.
20 lines (18 loc) • 420 B
JavaScript
/**
* Created by wangyujing on 11/17/15.
*/
var pattern = /#parse\(\"([^)]+)\)/g;
module.exports = function (str) {
var result = null,
temppath;
var tmparr = str.match(pattern);
if (tmparr) {
result = tmparr.map(function (item) {
temppath = item.split(/\"/)[1];
if (temppath) {
return temppath;
}
});
}
return result;
};