2021-11-26 22:04:15 +00:00
|
|
|
/* This is some sort of PEP440 subset */
|
|
|
|
type Join<T extends unknown[], D extends string> = T extends []
|
|
|
|
? ''
|
|
|
|
: T extends [string | number | boolean | bigint]
|
|
|
|
? `${T[0]}`
|
|
|
|
: T extends [string | number | boolean | bigint, ...infer U]
|
|
|
|
? `${T[0]}${D}${Join<U, D>}`
|
|
|
|
: string;
|
|
|
|
type BaseVersion = Join<[number, number], '.'> | Join<[number, number, number], '.'>;
|
|
|
|
type PreRelease = Join<[['a' | 'b' | 'rc'], number], '.'>;
|
|
|
|
type PRVersion = BaseVersion | `${BaseVersion}${PreRelease}`;
|
|
|
|
|
|
|
|
/** A PEP440 subset used to describe backend module versions */
|
2021-12-05 13:21:18 +00:00
|
|
|
declare type PEP440Version = PRVersion | `${PRVersion}.dev${number}`;
|