Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

normalize-opts.js 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = normalizeOptions;
  6. function _path() {
  7. const data = require("path");
  8. _path = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. function normalizeOptions(config) {
  14. const {
  15. filename,
  16. cwd,
  17. filenameRelative = typeof filename === "string" ? _path().relative(cwd, filename) : "unknown",
  18. sourceType = "module",
  19. inputSourceMap,
  20. sourceMaps = !!inputSourceMap,
  21. sourceRoot = config.options.moduleRoot,
  22. sourceFileName = _path().basename(filenameRelative),
  23. comments = true,
  24. compact = "auto"
  25. } = config.options;
  26. const opts = config.options;
  27. const options = Object.assign({}, opts, {
  28. parserOpts: Object.assign({
  29. sourceType: _path().extname(filenameRelative) === ".mjs" ? "module" : sourceType,
  30. sourceFileName: filename,
  31. plugins: []
  32. }, opts.parserOpts),
  33. generatorOpts: Object.assign({
  34. filename,
  35. auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
  36. auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
  37. retainLines: opts.retainLines,
  38. comments,
  39. shouldPrintComment: opts.shouldPrintComment,
  40. compact,
  41. minified: opts.minified,
  42. sourceMaps,
  43. sourceRoot,
  44. sourceFileName
  45. }, opts.generatorOpts)
  46. });
  47. for (const plugins of config.passes) {
  48. for (const plugin of plugins) {
  49. if (plugin.manipulateOptions) {
  50. plugin.manipulateOptions(options, options.parserOpts);
  51. }
  52. }
  53. }
  54. return options;
  55. }