diff --git a/src/Utils.ts b/src/Utils.ts index 3e6601ef..b09ab4ad 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -4,6 +4,22 @@ export type OmitNested : I[key]; }; +/** + * @see https://github.com/microsoft/TypeScript/issues/43505#issuecomment-1686128430 + */ +export type NumericRange< + start extends number, + end extends number, + arr extends unknown[] = [], + acc extends number = never, +> = arr['length'] extends end + ? acc | start | end + : NumericRange; + +export type OmitNested> = { + [key in keyof I]: key extends K ? Omit : I[key]; +}; + /** * @see https://github.com/microsoft/TypeScript/issues/43505#issuecomment-1686128430 */