features.js 820 B

12345678910111213141516171819202122232425262728293031
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.FEATURES = void 0;
  6. exports.enableFeature = enableFeature;
  7. exports.featuresKey = void 0;
  8. exports.hasFeature = hasFeature;
  9. exports.runtimeKey = void 0;
  10. const FEATURES = Object.freeze({
  11. unicodeFlag: 1 << 0,
  12. dotAllFlag: 1 << 1,
  13. unicodePropertyEscape: 1 << 2,
  14. namedCaptureGroups: 1 << 3,
  15. unicodeSetsFlag_syntax: 1 << 4,
  16. unicodeSetsFlag: 1 << 5
  17. });
  18. exports.FEATURES = FEATURES;
  19. const featuresKey = "@babel/plugin-regexp-features/featuresKey";
  20. exports.featuresKey = featuresKey;
  21. const runtimeKey = "@babel/plugin-regexp-features/runtimeKey";
  22. exports.runtimeKey = runtimeKey;
  23. function enableFeature(features, feature) {
  24. return features | feature;
  25. }
  26. function hasFeature(features, feature) {
  27. return !!(features & feature);
  28. }