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.

processor.js 683B

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. const parseStyle = require("./parse-style");
  3. function getSyntax (config, syntax) {
  4. if (typeof syntax !== "string") {
  5. return syntax;
  6. }
  7. let syntaxConfig = config[syntax];
  8. if (syntaxConfig) {
  9. syntaxConfig = getSyntax(config, syntaxConfig);
  10. } else {
  11. syntaxConfig = {
  12. extract: require(syntax.toLowerCase().replace(/^(postcss-)?/i, "postcss-") + "/extract"),
  13. };
  14. config[syntax] = syntaxConfig;
  15. }
  16. return syntaxConfig;
  17. }
  18. function processor (source, lang, opts) {
  19. const syntax = getSyntax(opts.syntax.config, lang);
  20. const styles = (syntax.extract || syntax)(source, opts) || [];
  21. return parseStyle(source, opts, styles);
  22. }
  23. module.exports = processor;