features.js 759 B

1234567891011121314151617181920212223242526272829
  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. });
  16. exports.FEATURES = FEATURES;
  17. const featuresKey = "@babel/plugin-regexp-features/featuresKey";
  18. exports.featuresKey = featuresKey;
  19. const runtimeKey = "@babel/plugin-regexp-features/runtimeKey";
  20. exports.runtimeKey = runtimeKey;
  21. function enableFeature(features, feature) {
  22. return features | feature;
  23. }
  24. function hasFeature(features, feature) {
  25. return !!(features & feature);
  26. }