Files
number_zj/20220330_Vote/Ewide.Web.Entry/wwwroot/lib/xe-utils/helperFormatEscaper.js
毛财君 197b38ca6f 1
2023-07-06 17:37:33 +08:00

14 lines
372 B
JavaScript

var toValueString = require('./toValueString')
var keys = require('./keys')
function helperFormatEscaper (dataMap) {
var replaceRegexp = new RegExp('(?:' + keys(dataMap).join('|') + ')', 'g')
return function (str) {
return toValueString(str).replace(replaceRegexp, function (match) {
return dataMap[match]
})
}
}
module.exports = helperFormatEscaper