isAscii.js 551 B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = isAscii;
  6. var _assertString = _interopRequireDefault(require("./util/assertString"));
  7. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8. /* eslint-disable no-control-regex */
  9. var ascii = /^[\x00-\x7F]+$/;
  10. /* eslint-enable no-control-regex */
  11. function isAscii(str) {
  12. (0, _assertString.default)(str);
  13. return ascii.test(str);
  14. }
  15. module.exports = exports.default;
  16. module.exports.default = exports.default;