"use strict";
const common_vendor = require("../../../../common/vendor.js");
function $parent(componentName, _instance = null) {
  var _a;
  const instance = _instance || common_vendor.getCurrentInstance();
  let parent = instance && instance.parent;
  if (!componentName)
    return parent;
  while (parent) {
    const name = (_a = parent.type) == null ? void 0 : _a.name;
    if (name === componentName) {
      return parent;
    }
    parent = parent.parent;
  }
  return null;
}
exports.$parent = $parent;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-pro/libs/function/_parent.js.map
