unescape.js 414 B

1234567891011121314151617181920
  1. var staticEscapeMap = require('./staticEscapeMap')
  2. var helperFormatEscaper = require('./helperFormatEscaper')
  3. var each = require('./each')
  4. var unescapeMap = {}
  5. each(staticEscapeMap, function (item, key) {
  6. unescapeMap[staticEscapeMap[key]] = key
  7. })
  8. /**
  9. * 反转escape
  10. *
  11. * @param {String} str 字符串
  12. * @return {String}
  13. */
  14. var unescape = helperFormatEscaper(unescapeMap)
  15. module.exports = unescape