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.

is.js 747B

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = is;
  6. var _shallowEqual = require("../utils/shallowEqual");
  7. var _isType = require("./isType");
  8. var _isPlaceholderType = require("./isPlaceholderType");
  9. var _definitions = require("../definitions");
  10. function is(type, node, opts) {
  11. if (!node) return false;
  12. const matches = (0, _isType.default)(node.type, type);
  13. if (!matches) {
  14. if (!opts && node.type === "Placeholder" && type in _definitions.FLIPPED_ALIAS_KEYS) {
  15. return (0, _isPlaceholderType.default)(node.expectedNode, type);
  16. }
  17. return false;
  18. }
  19. if (typeof opts === "undefined") {
  20. return true;
  21. } else {
  22. return (0, _shallowEqual.default)(node, opts);
  23. }
  24. }