Skip to content

Commit

Permalink
chore: move eslint-disable to the top of types
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxken committed Nov 23, 2023
1 parent 3de1f88 commit 41cbe0d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pattern/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* eslint-disable @typescript-eslint/ban-types */
/* eslint-disable @typescript-eslint/no-unused-vars */

type Split<S extends string, D extends string> =
string extends S ? Array<string> :
S extends "" ? [] :
Expand All @@ -6,15 +9,12 @@ type Split<S extends string, D extends string> =
type Trim<T> = T extends `${" "}${infer U}` ?
Trim<U> : T extends `${infer U}${" "}` ? Trim<U> : T;

// eslint-disable-next-line @typescript-eslint/no-unused-vars
type ExtractPattern<Pattern extends string> = Pattern extends `${infer A}<${infer Name}>${infer B}` ?
type ExtractPattern<Pattern extends string> = Pattern extends `${infer _}<${infer Name}>${infer _}` ?
Name extends "_" ? never : Trim<Name> : never;

type TupleToObject<T extends Array<string>> = {
[key in ExtractPattern<T[number]>]: string
};

// eslint-disable-next-line @typescript-eslint/ban-types
type Simplify<T> = {[KeyType in keyof T]: T[KeyType]} & {};

type Concat<T extends Array<string>> = T extends [
Expand Down

0 comments on commit 41cbe0d

Please sign in to comment.