UNPKG

@softwareventures/maintain-project

Version:

Automatically create and maintain TypeScript projects with standard settings for Software Ventures Limited

11 lines 488 B
import { chain } from "@softwareventures/chain"; import { initial, last, mapFn } from "@softwareventures/array"; import { looseSort } from "../semver/loose-sort.js"; export function nodeVersionRange(versions) { return chain(versions) .map(looseSort) .map(mapFn(version => `^${version}`)) .map(ranges => [...initial(ranges), last(ranges)?.replace(/^\^/u, ">=")]) .map(versions => versions.join(" || ")).value; } //# sourceMappingURL=version-range.js.map