isAscii.js 242 B

12345678910
  1. import assertString from './util/assertString';
  2. /* eslint-disable no-control-regex */
  3. var ascii = /^[\x00-\x7F]+$/;
  4. /* eslint-enable no-control-regex */
  5. export default function isAscii(str) {
  6. assertString(str);
  7. return ascii.test(str);
  8. }