shipped-proposals.js 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. /* eslint sort-keys: "error" */
  2. // These mappings represent the syntax proposals that have been
  3. // shipped by browsers, and are enabled by the `shippedProposals` option.
  4. const proposalPlugins = new Set([
  5. "proposal-class-static-block",
  6. "proposal-private-property-in-object",
  7. ]);
  8. // use intermediary object to enforce alphabetical key order
  9. const pluginSyntaxObject = {
  10. "proposal-async-generator-functions": "syntax-async-generators",
  11. "proposal-class-properties": "syntax-class-properties",
  12. "proposal-class-static-block": "syntax-class-static-block",
  13. "proposal-json-strings": "syntax-json-strings",
  14. "proposal-nullish-coalescing-operator": "syntax-nullish-coalescing-operator",
  15. "proposal-numeric-separator": "syntax-numeric-separator",
  16. "proposal-object-rest-spread": "syntax-object-rest-spread",
  17. "proposal-optional-catch-binding": "syntax-optional-catch-binding",
  18. "proposal-optional-chaining": "syntax-optional-chaining",
  19. // note: we don't have syntax-private-methods
  20. "proposal-private-methods": "syntax-class-properties",
  21. "proposal-private-property-in-object": "syntax-private-property-in-object",
  22. "proposal-unicode-property-regex": null,
  23. };
  24. const pluginSyntaxEntries = Object.keys(pluginSyntaxObject).map(function (key) {
  25. return [key, pluginSyntaxObject[key]];
  26. });
  27. const pluginSyntaxMap = new Map(pluginSyntaxEntries);
  28. module.exports = { pluginSyntaxMap, proposalPlugins };