match-curriculum / node_modules / @babel / helper-compilation-targets / lib / debug.js.map
debug.js.map
Raw
{"version":3,"names":["getInclusionReasons","item","targetVersions","list","minVersions","Object","keys","reduce","result","env","minVersion","getLowestImplementedVersion","targetVersion","prettifyVersion","minIsUnreleased","isUnreleasedVersion","targetIsUnreleased","semver","lt","toString","semverify"],"sources":["../src/debug.ts"],"sourcesContent":["import semver from \"semver\";\nimport { prettifyVersion } from \"./pretty\";\nimport {\n  semverify,\n  isUnreleasedVersion,\n  getLowestImplementedVersion,\n} from \"./utils\";\nimport type { Target, Targets } from \"./types\";\n\nexport function getInclusionReasons(\n  item: string,\n  targetVersions: Targets,\n  list: { [key: string]: Targets },\n) {\n  const minVersions = list[item] || {};\n\n  return (Object.keys(targetVersions) as Target[]).reduce((result, env) => {\n    const minVersion = getLowestImplementedVersion(minVersions, env);\n    const targetVersion = targetVersions[env];\n\n    if (!minVersion) {\n      result[env] = prettifyVersion(targetVersion);\n    } else {\n      const minIsUnreleased = isUnreleasedVersion(minVersion, env);\n      const targetIsUnreleased = isUnreleasedVersion(targetVersion, env);\n\n      if (\n        !targetIsUnreleased &&\n        (minIsUnreleased ||\n          semver.lt(targetVersion.toString(), semverify(minVersion)))\n      ) {\n        result[env] = prettifyVersion(targetVersion);\n      }\n    }\n\n    return result;\n  }, {} as Partial<Record<Target, string>>);\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAOO,SAASA,mBAAmB,CACjCC,IAAY,EACZC,cAAuB,EACvBC,IAAgC,EAChC;EACA,MAAMC,WAAW,GAAGD,IAAI,CAACF,IAAI,CAAC,IAAI,CAAC,CAAC;EAEpC,OAAQI,MAAM,CAACC,IAAI,CAACJ,cAAc,CAAC,CAAcK,MAAM,CAAC,CAACC,MAAM,EAAEC,GAAG,KAAK;IACvE,MAAMC,UAAU,GAAG,IAAAC,kCAA2B,EAACP,WAAW,EAAEK,GAAG,CAAC;IAChE,MAAMG,aAAa,GAAGV,cAAc,CAACO,GAAG,CAAC;IAEzC,IAAI,CAACC,UAAU,EAAE;MACfF,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAI,uBAAe,EAACD,aAAa,CAAC;IAC9C,CAAC,MAAM;MACL,MAAME,eAAe,GAAG,IAAAC,0BAAmB,EAACL,UAAU,EAAED,GAAG,CAAC;MAC5D,MAAMO,kBAAkB,GAAG,IAAAD,0BAAmB,EAACH,aAAa,EAAEH,GAAG,CAAC;MAElE,IACE,CAACO,kBAAkB,KAClBF,eAAe,IACdG,OAAM,CAACC,EAAE,CAACN,aAAa,CAACO,QAAQ,EAAE,EAAE,IAAAC,gBAAS,EAACV,UAAU,CAAC,CAAC,CAAC,EAC7D;QACAF,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAI,uBAAe,EAACD,aAAa,CAAC;MAC9C;IACF;IAEA,OAAOJ,MAAM;EACf,CAAC,EAAE,CAAC,CAAC,CAAoC;AAC3C"}