whitelist.js 187 B

12345
  1. import assertString from './util/assertString';
  2. export default function whitelist(str, chars) {
  3. assertString(str);
  4. return str.replace(new RegExp("[^".concat(chars, "]+"), 'g'), '');
  5. }