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.

load-syntax.js 567B

1234567891011121314151617181920212223
  1. "use strict";
  2. const getSyntax = require("./get-syntax");
  3. const cache = {};
  4. function loadSyntax (opts, id) {
  5. const cssSyntax = getSyntax("css", opts);
  6. const modulePath = id + "/template-" + (cssSyntax.parse.name === "safeParse" ? "safe-" : "") + "parse";
  7. let syntax = cache[modulePath];
  8. if (!syntax) {
  9. syntax = {
  10. parse: require(modulePath),
  11. };
  12. try {
  13. syntax.stringify = require(id + "/template-stringify");
  14. } catch (ex) {
  15. syntax.stringify = cssSyntax.stringify;
  16. }
  17. cache[modulePath] = syntax;
  18. }
  19. return syntax;
  20. }
  21. module.exports = loadSyntax;