stripLow.js 672 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = stripLow;
  6. var _assertString = require('./util/assertString');
  7. var _assertString2 = _interopRequireDefault(_assertString);
  8. var _blacklist = require('./blacklist');
  9. var _blacklist2 = _interopRequireDefault(_blacklist);
  10. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11. function stripLow(str, keep_new_lines) {
  12. (0, _assertString2.default)(str);
  13. var chars = keep_new_lines ? '\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F' : '\\x00-\\x1F\\x7F';
  14. return (0, _blacklist2.default)(str, chars);
  15. }
  16. module.exports = exports['default'];