| 1 | import semver from "semver"; |
| 2 | import { unreleasedLabelsscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`targets.ts`/unreleasedLabels. } from "./targets"scip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`targets.ts`/; |
| 3 | import type { Targetsscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`types.d.ts`/Targets#, Targetscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`types.d.ts`/Target# } from "./types"scip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`types.d.ts`/; |
| 4 | |
| 5 | export function prettifyVersionscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`pretty.ts`/prettifyVersion().(versionscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`pretty.ts`/prettifyVersion().(version): string) { |
| 6 | if (typeof versionscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`pretty.ts`/prettifyVersion().(version) !== "string") { |
| 7 | return versionscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`pretty.ts`/prettifyVersion().(version); |
| 8 | } |
| 9 | |
| 10 | const { major, minor, patch } = semver.parse(versionscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`pretty.ts`/prettifyVersion().(version)); |
| 11 | |
| 12 | const parts = [major]; |
| 13 | |
| 14 | if (minor || patch) { |
| 15 | parts.pushscip-typescript npm typescript 5.9.3 lib/`lib.es5.d.ts`/Array#push().(minor); |
| 16 | } |
| 17 | |
| 18 | if (patch) { |
| 19 | parts.pushscip-typescript npm typescript 5.9.3 lib/`lib.es5.d.ts`/Array#push().(patch); |
| 20 | } |
| 21 | |
| 22 | return parts.joinscip-typescript npm typescript 5.9.3 lib/`lib.es5.d.ts`/Array#join().("."); |
| 23 | } |
| 24 | |
| 25 | export function prettifyTargetsscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`pretty.ts`/prettifyTargets().(targetsscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`pretty.ts`/prettifyTargets().(targets): Targetsscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`types.d.ts`/Targets#): Targetsscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`types.d.ts`/Targets# { |
| 26 | return Objectscip-typescript npm typescript 5.9.3 lib/`lib.es5.d.ts`/Object#.keysscip-typescript npm typescript 5.9.3 lib/`lib.es5.d.ts`/ObjectConstructor#keys().(targetsscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`pretty.ts`/prettifyTargets().(targets)).reducescip-typescript npm typescript 5.9.3 lib/`lib.es5.d.ts`/Array#reduce().((results, target: Targetscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`types.d.ts`/Target#) => { |
| 27 | let value = targetsscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`pretty.ts`/prettifyTargets().(targets)[target]; |
| 28 | |
| 29 | const unreleasedLabel = |
| 30 | // @ts-expect-error undefined is strictly compared with string later |
| 31 | unreleasedLabelsscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`targets.ts`/unreleasedLabels.[target]; |
| 32 | if (typeof value === "string" && unreleasedLabel !== value) { |
| 33 | value = prettifyVersionscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`pretty.ts`/prettifyVersion().(value); |
| 34 | } |
| 35 | |
| 36 | results[target] = value; |
| 37 | return results; |
| 38 | }, {} as Targetsscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`types.d.ts`/Targets#); |
| 39 | } |