matchesEntirely.js 564 B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports["default"] = matchesEntirely;
  6. /**
  7. * Checks whether the entire input sequence can be matched
  8. * against the regular expression.
  9. * @return {boolean}
  10. */
  11. function matchesEntirely(text, regular_expression) {
  12. // If assigning the `''` default value is moved to the arguments above,
  13. // code coverage would decrease for some weird reason.
  14. text = text || '';
  15. return new RegExp('^(?:' + regular_expression + ')$').test(text);
  16. }
  17. //# sourceMappingURL=matchesEntirely.js.map