From 02e7e800acc0de0049a04bb4871faa6989c765da Mon Sep 17 00:00:00 2001 From: Jongsun Suh Date: Sat, 25 Nov 2023 20:04:46 -0800 Subject: [PATCH] Apply linter fixes --- src/digit-list/compare.ts | 20 +++++----- src/digit-list/decrement.ts | 4 +- src/digit-list/divide-by-subtraction.ts | 8 ++-- src/digit-list/divide.ts | 8 ++-- src/digit-list/first.ts | 4 +- src/digit-list/increment.ts | 4 +- src/digit-list/last.ts | 4 +- src/digit-list/pop.ts | 4 +- src/digit-list/shift.ts | 4 +- src/list/accumulate.ts | 4 +- src/list/at.ts | 4 +- src/list/iterate.ts | 18 ++++----- src/list/last.ts | 8 ++-- src/list/pair.ts | 4 +- src/list/range.ts | 12 +++--- src/list/reduce.ts | 26 +++++++------ src/list/reverse.ts | 8 ++-- src/list/slice.ts | 4 +- src/list/some.ts | 8 +++- src/list/splice.ts | 52 ++++++++++++------------- src/list/times.ts | 4 +- src/list/zip.ts | 4 +- src/natural-number-theory/factorial.ts | 10 ++--- src/natural-number/to-list.ts | 4 +- src/number/compare.ts | 16 ++++---- src/number/negate.ts | 4 +- src/number/sign.ts | 4 +- src/object/merge.ts | 4 +- src/parser/letters.ts | 6 +-- src/parser/many1.ts | 16 ++++---- src/parser/object-sequence.ts | 8 ++-- src/parser/sequence.ts | 4 +- src/parser/take-sequence.ts | 8 ++-- src/string/first.ts | 4 +- src/string/from-list.ts | 4 +- src/string/join.ts | 20 +++++----- src/string/last.ts | 4 +- src/string/length.ts | 4 +- src/string/replace.ts | 8 ++-- src/string/split.ts | 12 +++--- src/string/tail.ts | 4 +- src/string/to-list.ts | 8 ++-- src/test/expect-not.ts | 4 +- src/test/expect.ts | 4 +- src/type/display.ts | 8 ++-- src/union/length.ts | 4 +- 46 files changed, 197 insertions(+), 191 deletions(-) diff --git a/src/digit-list/compare.ts b/src/digit-list/compare.ts index 26aee9c85..6984cf5c9 100644 --- a/src/digit-list/compare.ts +++ b/src/digit-list/compare.ts @@ -78,16 +78,16 @@ type _$compare3< RESULT extends 1 | 0 | -1 = IS_SAME_LENGTH extends false ? _$compare3 : A extends [] - ? B extends [] - ? 0 - : -1 - : B extends [] - ? 1 - : BOTH_SINGLE_DIGIT extends true - ? COMP - : COMP extends 0 - ? _$compare3 - : COMP + ? B extends [] + ? 0 + : -1 + : B extends [] + ? 1 + : BOTH_SINGLE_DIGIT extends true + ? COMP + : COMP extends 0 + ? _$compare3 + : COMP > = RESULT type _$compare2< diff --git a/src/digit-list/decrement.ts b/src/digit-list/decrement.ts index 37f33737e..dfc59cfc3 100644 --- a/src/digit-list/decrement.ts +++ b/src/digit-list/decrement.ts @@ -78,8 +78,8 @@ type _$decrement2< > = A extends '0'[] ? FINAL_RESULT : CARRY extends '0' - ? SHORT_CIRCUIT - : _$decrement2 + ? SHORT_CIRCUIT + : _$decrement2 /** * `_$decrement` is a type-level function that takes in a digit list `A` and diff --git a/src/digit-list/divide-by-subtraction.ts b/src/digit-list/divide-by-subtraction.ts index a9cc6c91c..ff4f6d2e3 100644 --- a/src/digit-list/divide-by-subtraction.ts +++ b/src/digit-list/divide-by-subtraction.ts @@ -116,10 +116,10 @@ export type _$divideBySubtraction< > = B extends [Digit.Zero] ? [Digit.Zero] : B extends ['1'] - ? OPERATION extends 'DIVIDE' - ? A - : [Digit.Zero] - : _$divideBySubtraction2 + ? OPERATION extends 'DIVIDE' + ? A + : [Digit.Zero] + : _$divideBySubtraction2 interface DivideBySubtraction_T extends Kind.Kind { diff --git a/src/digit-list/divide.ts b/src/digit-list/divide.ts index 22e5e6848..fea9471c7 100644 --- a/src/digit-list/divide.ts +++ b/src/digit-list/divide.ts @@ -121,10 +121,10 @@ export type _$divide< > = B extends [Digit.Zero] ? [Digit.Zero] : B extends ['1'] - ? OPERATION extends 'DIVIDE' - ? A - : [Digit.Zero] - : _$divide2 + ? OPERATION extends 'DIVIDE' + ? A + : [Digit.Zero] + : _$divide2 interface Divide_T extends Kind.Kind { f(x: Type._$cast): _$divide diff --git a/src/digit-list/first.ts b/src/digit-list/first.ts index 791f37127..10f2f11ad 100644 --- a/src/digit-list/first.ts +++ b/src/digit-list/first.ts @@ -16,8 +16,8 @@ import { Digit, DigitList, Kind, Type } from '../' export type _$first = T extends [] ? Digit.Zero : T extends [infer X, ...unknown[]] - ? X - : Digit.Zero + ? X + : Digit.Zero /** * `First` is a type-level function that returns the first digit of a digit list. diff --git a/src/digit-list/increment.ts b/src/digit-list/increment.ts index a8c71c7db..227ba1d39 100644 --- a/src/digit-list/increment.ts +++ b/src/digit-list/increment.ts @@ -56,8 +56,8 @@ export type _$increment< > = A extends [] ? FINAL_RESULT : CARRY extends '0' - ? SHORT_CIRCUIT - : _$increment + ? SHORT_CIRCUIT + : _$increment /** * `Increment` is a type-level function that increments a digit list. diff --git a/src/digit-list/last.ts b/src/digit-list/last.ts index aec8f3e48..78bc21129 100644 --- a/src/digit-list/last.ts +++ b/src/digit-list/last.ts @@ -16,8 +16,8 @@ import { Type, Kind, Digit, DigitList } from '..' export type _$last = T extends [] ? Digit.Zero : T extends [...unknown[], infer X] - ? X - : Digit.Zero + ? X + : Digit.Zero /** * `Last` is a type-level function that gets the last digit of a digit list. diff --git a/src/digit-list/pop.ts b/src/digit-list/pop.ts index fdf2088a1..c708c8fa7 100644 --- a/src/digit-list/pop.ts +++ b/src/digit-list/pop.ts @@ -24,8 +24,8 @@ import { Type, Kind, DigitList } from '..' export type _$pop = T extends [] ? [] : T extends [...infer X, unknown] - ? X - : [] + ? X + : [] /** * `Pop` is a type-level function that removes the last digit from a digit list. diff --git a/src/digit-list/shift.ts b/src/digit-list/shift.ts index 019dde117..0ab2e4387 100644 --- a/src/digit-list/shift.ts +++ b/src/digit-list/shift.ts @@ -21,8 +21,8 @@ import { Type, Kind, DigitList } from '..' export type _$shift = T extends [] ? [] : T extends [unknown, ...infer X] - ? X - : [] + ? X + : [] /** * `Shift` is a type-level function that removes the first digit from a digit list. diff --git a/src/list/accumulate.ts b/src/list/accumulate.ts index 84a27d8de..389b03286 100644 --- a/src/list/accumulate.ts +++ b/src/list/accumulate.ts @@ -32,8 +32,8 @@ export type _$accumulate< RESULT extends Kind._$inputOf[] = X extends [] ? M : ACC extends Kind._$inputOf - ? _$accumulate> - : never + ? _$accumulate> + : never > = 0 extends 1 ? never : RESULT interface Accumulate_T2< diff --git a/src/list/at.ts b/src/list/at.ts index bb865566b..def3003d4 100644 --- a/src/list/at.ts +++ b/src/list/at.ts @@ -40,8 +40,8 @@ export type _$at< ? POS_ABS : never : DigitList._$compare extends -1 - ? never - : DigitList._$subtract, + ? never + : DigitList._$subtract, INDEX extends number = DigitList._$toNumber > = POS_NORM extends never ? never : T[INDEX] diff --git a/src/list/iterate.ts b/src/list/iterate.ts index e56427b95..e9608f6bc 100644 --- a/src/list/iterate.ts +++ b/src/list/iterate.ts @@ -23,15 +23,15 @@ export type _$iterate< RESULT extends Kind._$inputOf[] = COUNT extends 0 ? M : ACC extends Kind._$inputOf - ? _$iterate< - F, - O, - N, - NaturalNumber._$decrement, - List._$push, - ACC - > - : never + ? _$iterate< + F, + O, + N, + NaturalNumber._$decrement, + List._$push, + ACC + > + : never > = 0 extends 1 ? never : RESULT interface Iterate_T2 diff --git a/src/list/last.ts b/src/list/last.ts index 6a565bf24..21daf95c0 100644 --- a/src/list/last.ts +++ b/src/list/last.ts @@ -17,10 +17,10 @@ import { Type, Kind } from '..' export type _$last = T extends [infer X] ? X : T extends [unknown, ...infer Tail] - ? _$last - : T extends [...unknown[], infer X] - ? X - : T[number] + ? _$last + : T extends [...unknown[], infer X] + ? X + : T[number] /** * `Last` is a type-level function that returns the last element of a tuple. diff --git a/src/list/pair.ts b/src/list/pair.ts index d91057a2d..0950b1a0f 100644 --- a/src/list/pair.ts +++ b/src/list/pair.ts @@ -19,8 +19,8 @@ export type _$pair< > = T extends [infer X1, infer X2, ...infer Rest] ? _$pair<[X2, ...Rest], [...O, [X1, X2]]> : number extends T['length'] - ? [T[number], T[number]][] - : O + ? [T[number], T[number]][] + : O /** * `Pair` is a type-level function that generates a tuple of pairs from a tuple, diff --git a/src/list/range.ts b/src/list/range.ts index 9ed015222..4d3038922 100644 --- a/src/list/range.ts +++ b/src/list/range.ts @@ -23,18 +23,18 @@ type _$range2< ? true : false : NaturalNumber._$compare extends -1 | 0 - ? true - : false, + ? true + : false, RESULT extends Number.Number[] = START extends Kind._$inputOf ? List._$iterate : never > = 0 extends 1 ? never : VALIDATE extends true - ? COUNT extends 0 - ? [] - : RESULT - : never + ? COUNT extends 0 + ? [] + : RESULT + : never /** * `_$range` is a type-level function that generates a range of numbers. diff --git a/src/list/reduce.ts b/src/list/reduce.ts index 8b43bc067..7352d7fdb 100644 --- a/src/list/reduce.ts +++ b/src/list/reduce.ts @@ -28,20 +28,22 @@ export type _$reduce< > = 0 extends 1 ? never : X extends [infer H, ...infer T] - ? $< - $>>, - Type._$cast< - H, - Kind._$inputOf< - Function._$returnType< - (F & { readonly [Kind._]: Type._$cast> })['f'] + ? $< + $>>, + Type._$cast< + H, + Kind._$inputOf< + Function._$returnType< + (F & { + readonly [Kind._]: Type._$cast> + })['f'] + > > > - > - > extends infer R - ? _$reduce - : never - : O + > extends infer R + ? _$reduce + : never + : O interface Reduce_T2 Kind.Kind>, X> extends Kind.Kind { diff --git a/src/list/reverse.ts b/src/list/reverse.ts index 0bbf5abc9..b77a148e6 100644 --- a/src/list/reverse.ts +++ b/src/list/reverse.ts @@ -8,8 +8,8 @@ type _$reverse2 = T extends [ ? [...O, Last] : _$reverse2 : T extends [infer Head, ...unknown[]] - ? Head - : [...O, ...T] + ? Head + : [...O, ...T] /** * `_$reverse` is a type-level function that reverses a tuple. @@ -26,8 +26,8 @@ export type _$reverse< > = T extends [infer Head, ...infer Tail] ? _$reverse : T extends [] - ? O - : [..._$reverse2, ...O] + ? O + : [..._$reverse2, ...O] /** * `Reverse` is a type-level function that reverses a tuple. diff --git a/src/list/slice.ts b/src/list/slice.ts index db76b206e..59dac4d18 100644 --- a/src/list/slice.ts +++ b/src/list/slice.ts @@ -51,8 +51,8 @@ export type _$slice< DigitList.DigitList = Number._$isNatural extends true ? START_ABS : DigitList._$compare extends -1 - ? [Digit.Zero] - : DigitList._$subtract, + ? [Digit.Zero] + : DigitList._$subtract, POP_NORM extends DigitList.DigitList = Number._$isNatural extends true ? DigitList._$compare extends -1 ? [Digit.Zero] diff --git a/src/list/some.ts b/src/list/some.ts index 8e366089d..20791f29b 100644 --- a/src/list/some.ts +++ b/src/list/some.ts @@ -18,8 +18,12 @@ export type _$some< > = 0 extends 1 ? never : T extends [infer Head, ...infer Rest] - ? _$some>>>> - : O + ? _$some< + F, + Rest, + Boolean._$or>>> + > + : O interface Some_T boolean>> extends Kind.Kind { f(x: Type._$cast[]>): _$some diff --git a/src/list/splice.ts b/src/list/splice.ts index 11a7c51ae..8c5a6cc22 100644 --- a/src/list/splice.ts +++ b/src/list/splice.ts @@ -24,38 +24,38 @@ type _$splice2< DigitList.DigitList = Number._$isNatural extends true ? START_ABS : DigitList._$compare extends -1 - ? [Digit.Zero] - : DigitList._$subtract, + ? [Digit.Zero] + : DigitList._$subtract, RESULT extends List.List = DigitList._$compare< START_NORM, NaturalNumber._$toList > extends 1 | 0 ? List._$concat : DEL_COUNT extends [Digit.Zero] - ? START_NORM extends [Digit.Zero] - ? [...PRE, ...INSERTS, ...POST] - : _$splice2< - T, - DigitList._$toNumber>, - [Digit.Zero], - INSERTS, - List._$push, - List._$shift - > - : START_NORM extends [Digit.Zero] - ? [ - ...PRE, - ...INSERTS, - ...List._$shiftN> - ] - : _$splice2< - T, - DigitList._$toNumber>, - DEL_COUNT, - INSERTS, - List._$push, - List._$shift - > + ? START_NORM extends [Digit.Zero] + ? [...PRE, ...INSERTS, ...POST] + : _$splice2< + T, + DigitList._$toNumber>, + [Digit.Zero], + INSERTS, + List._$push, + List._$shift + > + : START_NORM extends [Digit.Zero] + ? [ + ...PRE, + ...INSERTS, + ...List._$shiftN> + ] + : _$splice2< + T, + DigitList._$toNumber>, + DEL_COUNT, + INSERTS, + List._$push, + List._$shift + > > = RESULT /** diff --git a/src/list/times.ts b/src/list/times.ts index 9ffa728ca..c34774323 100644 --- a/src/list/times.ts +++ b/src/list/times.ts @@ -9,8 +9,8 @@ type _$times2< > = 0 extends 1 ? never : COUNTER extends ['0'] - ? STATE - : _$times2 + ? STATE + : _$times2 /** * `_$times` is a type-level function that generates a list of numbers from 0 to N-1. diff --git a/src/list/zip.ts b/src/list/zip.ts index 83ecae2f6..1bd4b7529 100644 --- a/src/list/zip.ts +++ b/src/list/zip.ts @@ -40,8 +40,8 @@ export type _$zip< RESULT extends List.List = MIN_LENGTH extends Number.MAX_SAFE_INTEGER ? [] : IDX extends MIN_LENGTH - ? ACC - : _$zip, List._$push> + ? ACC + : _$zip, List._$push> > = RESULT /** diff --git a/src/natural-number-theory/factorial.ts b/src/natural-number-theory/factorial.ts index 5652cf71d..ff77abe02 100644 --- a/src/natural-number-theory/factorial.ts +++ b/src/natural-number-theory/factorial.ts @@ -18,11 +18,11 @@ export type _$factorial< > = 0 extends 1 ? never : DONE extends true - ? VALUE - : _$factorial< - NaturalNumber._$decrement, - NaturalNumber._$multiply - > + ? VALUE + : _$factorial< + NaturalNumber._$decrement, + NaturalNumber._$multiply + > /** * `Factorial` is a type-level function that calculates the factorial of a number. diff --git a/src/natural-number/to-list.ts b/src/natural-number/to-list.ts index 0e6bb0bf3..89bf391f0 100644 --- a/src/natural-number/to-list.ts +++ b/src/natural-number/to-list.ts @@ -19,8 +19,8 @@ export type _$toList< > = Number._$toString extends `${infer Head}${infer Tail}` ? _$toList : O extends DigitList.DigitList - ? O - : ['0'] + ? O + : ['0'] /** * Represents a type-level utility to convert a natural number into a list of its digits. diff --git a/src/number/compare.ts b/src/number/compare.ts index a146133f4..fc8868b99 100644 --- a/src/number/compare.ts +++ b/src/number/compare.ts @@ -66,10 +66,10 @@ type _$compare2< : DigitList._$compare : 1 : B_SGN extends '+' - ? -1 - : A_INT extends B_INT - ? _$decimalCompare - : DigitList._$compare + ? -1 + : A_INT extends B_INT + ? _$decimalCompare + : DigitList._$compare > = RESULT type _$decimalCompare< @@ -113,10 +113,10 @@ type _$decimalCompare< ? 0 : -1 : B extends [] - ? 1 - : COMP extends 0 - ? _$decimalCompare - : COMP + ? 1 + : COMP extends 0 + ? _$decimalCompare + : COMP > = RESULT /** diff --git a/src/number/negate.ts b/src/number/negate.ts index 6f1cb63fa..8112d1f73 100644 --- a/src/number/negate.ts +++ b/src/number/negate.ts @@ -20,8 +20,8 @@ export type _$negate< RESULT extends Number.Number = T extends 0 ? 0 : `${T}` extends `-${infer U extends number}` - ? U - : Number._$fromString<`-${T}`> + ? U + : Number._$fromString<`-${T}`> > = RESULT /** diff --git a/src/number/sign.ts b/src/number/sign.ts index baa4b6944..1c8d81b68 100644 --- a/src/number/sign.ts +++ b/src/number/sign.ts @@ -14,8 +14,8 @@ import { Type, Kind, Number } from '..' export type _$sign = number extends T ? '+' | '-' : `${T}` extends `-${string}` - ? '-' - : '+' + ? '-' + : '+' /** * `Number.Sign` is a type-level function that returns the sign of a number. diff --git a/src/object/merge.ts b/src/object/merge.ts index 598f7b0da..87499e3b1 100644 --- a/src/object/merge.ts +++ b/src/object/merge.ts @@ -7,8 +7,8 @@ export type _$merge< [K in keyof A | keyof B]: K extends keyof B ? B[K] : K extends keyof A - ? A[K] - : never + ? A[K] + : never }> interface Merge_T> extends Kind.Kind { diff --git a/src/parser/letters.ts b/src/parser/letters.ts index 976837542..22fd1f48a 100644 --- a/src/parser/letters.ts +++ b/src/parser/letters.ts @@ -6,10 +6,10 @@ export type _$letters2< > = 0 extends 1 ? never : S extends `${infer Head}${infer Tail}` - ? Head extends Parser.__$letter - ? _$letters2 + ? Head extends Parser.__$letter + ? _$letters2 + : MATCH : MATCH - : MATCH export type _$letters< STATE extends Parser._$state, diff --git a/src/parser/many1.ts b/src/parser/many1.ts index 0180575fd..a95a997ee 100644 --- a/src/parser/many1.ts +++ b/src/parser/many1.ts @@ -12,14 +12,14 @@ export type _$many1< > = 0 extends 1 ? never : Conditional._$equals extends true - ? RESULTS extends [] - ? never - : { - input: STATE['input'] - index: STATE['index'] - result: RESULTS - } - : _$many1 + ? RESULTS extends [] + ? never + : { + input: STATE['input'] + index: STATE['index'] + result: RESULTS + } + : _$many1 interface Many1_T

extends Parser.Parser { f(x: Type._$cast): _$many1 diff --git a/src/parser/object-sequence.ts b/src/parser/object-sequence.ts index 0d8a5e355..9d07b6b9a 100644 --- a/src/parser/object-sequence.ts +++ b/src/parser/object-sequence.ts @@ -12,8 +12,8 @@ export type _$objectSequence< NEXT_STATE extends Parser._$state = ACTIVE_PX extends [string, Parser.Parser] ? $>> : ACTIVE_PX extends Parser.Parser - ? $>> - : never, + ? $>> + : never, NEXT_RESULTS extends Record = ACTIVE_PX extends [ string, Parser.Parser @@ -23,8 +23,8 @@ export type _$objectSequence< IS_DONE extends boolean = NEXT_PX extends [] ? true : NEXT_STATE extends never - ? false - : false + ? false + : false > = IS_DONE extends true ? NEXT_STATE extends never ? never diff --git a/src/parser/sequence.ts b/src/parser/sequence.ts index c05af24e2..77b3fd6f7 100644 --- a/src/parser/sequence.ts +++ b/src/parser/sequence.ts @@ -17,8 +17,8 @@ export type _$sequence< IS_DONE extends boolean = NEXT_PX extends [] ? true : NEXT_STATE extends never - ? false - : false + ? false + : false > = IS_DONE extends true ? NEXT_STATE extends never ? never diff --git a/src/parser/take-sequence.ts b/src/parser/take-sequence.ts index bae68c495..51dc7e6aa 100644 --- a/src/parser/take-sequence.ts +++ b/src/parser/take-sequence.ts @@ -12,16 +12,16 @@ type _$takeSequence< NEXT_STATE extends Parser._$state = ACTIVE_PX extends [Parser.Parser] ? $>> : ACTIVE_PX extends Parser.Parser - ? $>> - : never, + ? $>> + : never, NEXT_RESULT extends unknown = ACTIVE_PX extends [Parser.Parser] ? NEXT_STATE['result'] : RESULT, IS_DONE extends boolean = NEXT_PX extends [] ? true : NEXT_STATE extends never - ? false - : false + ? false + : false > = IS_DONE extends true ? NEXT_STATE extends never ? never diff --git a/src/string/first.ts b/src/string/first.ts index 448141245..8dd9bded6 100644 --- a/src/string/first.ts +++ b/src/string/first.ts @@ -12,8 +12,8 @@ import { Type, Kind } from '..' export type _$first = S extends `${infer Head}${string}` ? Head : string extends S - ? S - : '' + ? S + : '' /** * `String.First` is a type-level function that extracts the first character from a string. diff --git a/src/string/from-list.ts b/src/string/from-list.ts index c906fe602..52c15bb89 100644 --- a/src/string/from-list.ts +++ b/src/string/from-list.ts @@ -13,8 +13,8 @@ import { Type, Kind } from '..' export type _$fromList = 0 extends 1 ? never : T extends [infer Head, ...infer Tail] - ? _$fromList}`> - : O + ? _$fromList}`> + : O /** * `String.FromList` is a type-level function that joins a list of strings into a single string. diff --git a/src/string/join.ts b/src/string/join.ts index 054a8027d..33f5d147b 100644 --- a/src/string/join.ts +++ b/src/string/join.ts @@ -18,16 +18,16 @@ export type _$join< > = List._$isVariadic extends true ? string : T extends [infer Head, ...infer Tail] - ? Tail extends [] - ? `${O}${O extends '' ? '' : D}${Type._$cast}` - : _$join< - Type._$cast, - D, - `${O}${O extends '' ? '' : D}${Type._$cast}` - > - : string[] extends T - ? `${O}${string}` - : O + ? Tail extends [] + ? `${O}${O extends '' ? '' : D}${Type._$cast}` + : _$join< + Type._$cast, + D, + `${O}${O extends '' ? '' : D}${Type._$cast}` + > + : string[] extends T + ? `${O}${string}` + : O /** * `String.Join_T` is an intermediate interface for currying. diff --git a/src/string/last.ts b/src/string/last.ts index 819c43a4f..72fe8420e 100644 --- a/src/string/last.ts +++ b/src/string/last.ts @@ -14,8 +14,8 @@ export type _$last = S extends `${string}${infer Tail}` ? S : _$last : string extends S - ? S - : '' + ? S + : '' /** * `String.Last` is a type-level function that extracts the last character from a string. diff --git a/src/string/length.ts b/src/string/length.ts index 790df1897..1c80421e4 100644 --- a/src/string/length.ts +++ b/src/string/length.ts @@ -12,8 +12,8 @@ import { Type, Kind, String } from '..' export type _$length = String._$isTemplate extends true ? number : string extends S - ? number - : String._$toList['length'] + ? number + : String._$toList['length'] /** * `String.Length` is a type-level function that returns the length of a string. diff --git a/src/string/replace.ts b/src/string/replace.ts index 2938ccd47..48f1c693b 100644 --- a/src/string/replace.ts +++ b/src/string/replace.ts @@ -30,10 +30,10 @@ export type _$replace< > = String._$isTemplate extends true ? string : string extends From - ? string - : From extends '' - ? `${To}${_$replace2}` - : _$replace2 + ? string + : From extends '' + ? `${To}${_$replace2}` + : _$replace2 /** * `Replace_T2` is an intermediate interface for currying. diff --git a/src/string/split.ts b/src/string/split.ts index a1583b821..d1b88b020 100644 --- a/src/string/split.ts +++ b/src/string/split.ts @@ -17,12 +17,12 @@ export type _$split< > = String._$isTemplate extends true ? string[] : string extends Delimiter - ? string[] - : S extends `${infer Head}${Delimiter}${infer Tail}` - ? _$split - : S extends Delimiter - ? O - : [...O, S] + ? string[] + : S extends `${infer Head}${Delimiter}${infer Tail}` + ? _$split + : S extends Delimiter + ? O + : [...O, S] interface Split_T extends Kind.Kind { f(x: Type._$cast): _$split diff --git a/src/string/tail.ts b/src/string/tail.ts index f0832ffc9..0c09d8539 100644 --- a/src/string/tail.ts +++ b/src/string/tail.ts @@ -14,8 +14,8 @@ export type _$tail = S extends `${string}${infer Tail}` ? S : Tail : string extends S - ? S - : '' + ? S + : '' /** * `String.Tail` is a type-level function that extracts every element after the first element of a string. diff --git a/src/string/to-list.ts b/src/string/to-list.ts index 38685cc08..5c6966db9 100644 --- a/src/string/to-list.ts +++ b/src/string/to-list.ts @@ -12,10 +12,10 @@ import { Type, Kind } from '..' export type _$toList = 0 extends 1 ? never : string extends S - ? [string] - : S extends `${infer Head}${infer Tail}` - ? _$toList - : O + ? [string] + : S extends `${infer Head}${infer Tail}` + ? _$toList + : O /** * `String.ToList` is a type-level function that splits a string into a list of its characters. diff --git a/src/test/expect-not.ts b/src/test/expect-not.ts index 32c0cbddc..3908b0663 100644 --- a/src/test/expect-not.ts +++ b/src/test/expect-not.ts @@ -17,5 +17,5 @@ export type ExpectNot< > = Type._$isNever extends true ? X : Type._$isNever extends true - ? ExpectNot - : X + ? ExpectNot + : X diff --git a/src/test/expect.ts b/src/test/expect.ts index 6c23d1a17..e27958602 100644 --- a/src/test/expect.ts +++ b/src/test/expect.ts @@ -34,5 +34,5 @@ export type Expect< > = Type._$isNever extends true ? X : Type._$isNever extends true - ? Expect - : X + ? Expect + : X diff --git a/src/type/display.ts b/src/type/display.ts index 8ed57fc32..abe829c7c 100644 --- a/src/type/display.ts +++ b/src/type/display.ts @@ -12,10 +12,10 @@ import { Kind } from '..' export type _$display = T extends (...args: never[]) => unknown ? T : T extends abstract new (...args: never[]) => unknown - ? T - : { - [key in keyof T]: T[key] - } + ? T + : { + [key in keyof T]: T[key] + } /** * `Display` is a type-level function that forces the compiler to resolve diff --git a/src/union/length.ts b/src/union/length.ts index 557fe9380..1eb3d14bf 100644 --- a/src/union/length.ts +++ b/src/union/length.ts @@ -14,8 +14,8 @@ import { Kind, Union, Type } from '..' export type _$length = Type._$isNever extends true ? 0 : Union._$toList extends infer X extends unknown[] - ? X['length'] - : never + ? X['length'] + : never /** * `Union.Length` is a type-level function that returns the length of a union.