{"version":3,"file":"resolve-export.d.ts","sourceRoot":"","sources":["../../src/resolve-export.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,+DAqBzB,CAAA","sourcesContent":["export const resolveExport = (\n  exp: any,\n  conditions: string[],\n): string | undefined | null => {\n  if (typeof exp === 'string') return exp\n  if (typeof exp !== 'object') return undefined\n  if (exp === null) return exp\n  if (Array.isArray(exp)) {\n    for (const e of exp) {\n      const u = resolveExport(e, conditions)\n      if (u || u === null) return u\n    }\n    return undefined\n  }\n  const conds = [...conditions, 'node', 'default']\n  for (const [c, e] of Object.entries(exp)) {\n    if (conds.includes(c)) {\n      const u = resolveExport(e, conditions)\n      if (u || u === null) return u\n    }\n  }\n}\n"]}