summaryrefslogtreecommitdiff
path: root/bin/wiki/ImportarDesdeURL/node_modules/smartquotes/lib/string.js
blob: 8878908df7250cd6ae17fda8c958d4529fd6b829 (plain)
1
2
3
4
5
6
7
8
9
10
const replacements = require('./replacements');

module.exports = function(str, options) {
  options = options || {};
  replacements.forEach( replace => {
    const replacement = typeof replace[1] === 'function' ? replace[1](options.retainLength) : replace[1];
    str = str.replace(replace[0], replacement);
  });
  return str;
};