UNPKG

@molejs/mole-tools

Version:

Configuration and scripts for Mole App.

19 lines (16 loc) 417 B
const path = require('path'); exports.getDir = function (base, target) { return path.resolve(base, target); } exports.formatString = function (str, data) { for (const key in data) { if (data.hasOwnProperty(key)) { const element = data[key]; const reg = new RegExp("\\$\\{"+key+"\\}", "g"); str = str.replace(reg, element); } } return str; } exports.isProdcution = function() { }