isHalfWidth.js 523 B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = isHalfWidth;
  6. exports.halfWidth = void 0;
  7. var _assertString = _interopRequireDefault(require("./util/assertString"));
  8. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9. var halfWidth = /[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;
  10. exports.halfWidth = halfWidth;
  11. function isHalfWidth(str) {
  12. (0, _assertString.default)(str);
  13. return halfWidth.test(str);
  14. }