source: trip-planner-front/node_modules/@babel/types/lib/validators/is.js@ 6c1585f

Last change on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 747 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = is;
7
8var _shallowEqual = require("../utils/shallowEqual");
9
10var _isType = require("./isType");
11
12var _isPlaceholderType = require("./isPlaceholderType");
13
14var _definitions = require("../definitions");
15
16function is(type, node, opts) {
17 if (!node) return false;
18 const matches = (0, _isType.default)(node.type, type);
19
20 if (!matches) {
21 if (!opts && node.type === "Placeholder" && type in _definitions.FLIPPED_ALIAS_KEYS) {
22 return (0, _isPlaceholderType.default)(node.expectedNode, type);
23 }
24
25 return false;
26 }
27
28 if (typeof opts === "undefined") {
29 return true;
30 } else {
31 return (0, _shallowEqual.default)(node, opts);
32 }
33}
Note: See TracBrowser for help on using the repository browser.