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.

removeProperties.js 765B

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = removeProperties;
  6. var _constants = require("../constants");
  7. const CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"];
  8. const CLEAR_KEYS_PLUS_COMMENTS = _constants.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS);
  9. function removeProperties(node, opts = {}) {
  10. const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;
  11. for (const key of map) {
  12. if (node[key] != null) node[key] = undefined;
  13. }
  14. for (const key of Object.keys(node)) {
  15. if (key[0] === "_" && node[key] != null) node[key] = undefined;
  16. }
  17. const symbols = Object.getOwnPropertySymbols(node);
  18. for (const sym of symbols) {
  19. node[sym] = null;
  20. }
  21. }