import shallowEqual from "../utils/shallowEqual.js";
import isType from "./isType.js";
import isPlaceholderType from "./isPlaceholderType.js";
import { FLIPPED_ALIAS_KEYS } from "../definitions/index.js";
export default function is(type, node, opts) {
  if (!node) return false;
  const matches = isType(node.type, type);
  if (!matches) {
    if (!opts && node.type === "Placeholder" && type in FLIPPED_ALIAS_KEYS) {
      return isPlaceholderType(node.expectedNode, type);
    }
    return false;
  }
  if (typeof opts === "undefined") {
    return true;
  } else {
    return shallowEqual(node, opts);
  }
}

//# sourceMappingURL=is.js.map
