options.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.defaultOptions = void 0;
  6. exports.getOptions = getOptions;
  7. const defaultOptions = {
  8. sourceType: "script",
  9. sourceFilename: undefined,
  10. startColumn: 0,
  11. startLine: 1,
  12. allowAwaitOutsideFunction: false,
  13. allowReturnOutsideFunction: false,
  14. allowNewTargetOutsideFunction: false,
  15. allowImportExportEverywhere: false,
  16. allowSuperOutsideMethod: false,
  17. allowUndeclaredExports: false,
  18. plugins: [],
  19. strictMode: null,
  20. ranges: false,
  21. tokens: false,
  22. createParenthesizedExpressions: false,
  23. errorRecovery: false,
  24. attachComment: true,
  25. annexB: true
  26. };
  27. exports.defaultOptions = defaultOptions;
  28. function getOptions(opts) {
  29. if (opts && opts.annexB != null && opts.annexB !== false) {
  30. throw new Error("The `annexB` option can only be set to `false`.");
  31. }
  32. const options = {};
  33. for (const key of Object.keys(defaultOptions)) {
  34. options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];
  35. }
  36. return options;
  37. }
  38. //# sourceMappingURL=options.js.map