Skip to content

Commit

Permalink
refactor: rename select types
Browse files Browse the repository at this point in the history
  • Loading branch information
unional committed Oct 16, 2023
1 parent 2b8811a commit 0ee75d2
Show file tree
Hide file tree
Showing 52 changed files with 392 additions and 393 deletions.
10 changes: 5 additions & 5 deletions type-plus/ts/bigint/is_bigint.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SelectWithDistribute } from '../type_plus/branch/select_with_distribute.js'
import type { $Select } from '../type_plus/branch/$select.js'

/**
* 🎭 *predicate*
Expand Down Expand Up @@ -52,10 +52,10 @@ import type { SelectWithDistribute } from '../type_plus/branch/select_with_distr
* type R = IsBigint<string, $SelectionBranch> // $Else
* ```
*/
export type IsBigint<T, $O extends IsBigint.$Options = {}> = SelectWithDistribute<T, bigint, $O>
export type IsBigint<T, $O extends IsBigint.$Options = {}> = $Select<T, bigint, $O>

export namespace IsBigint {
export type $Options = SelectWithDistribute.$Options
export type $Default = SelectWithDistribute.$Default
export type $Branch = SelectWithDistribute.$Branch
export type $Options = $Select.$Options
export type $Default = $Select.$Default
export type $Branch = $Select.$Branch
}
10 changes: 5 additions & 5 deletions type-plus/ts/bigint/is_not_bigint.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SelectInvertWithDistribute } from '../type_plus/branch/select_invert_with_distribute.js'
import type { $SelectInvert } from '../type_plus/branch/$select_invert.js'

/**
* 🎭 *predicate*
Expand Down Expand Up @@ -49,10 +49,10 @@ import type { SelectInvertWithDistribute } from '../type_plus/branch/select_inve
* type R = IsNotBigint<bigint, $SelectionBranch> // $Else
* ```
*/
export type IsNotBigint<T, $O extends IsNotBigint.$Options = {}> = SelectInvertWithDistribute<T, bigint, $O>
export type IsNotBigint<T, $O extends IsNotBigint.$Options = {}> = $SelectInvert<T, bigint, $O>

export namespace IsNotBigint {
export type $Options = SelectInvertWithDistribute.$Options
export type $Default = SelectInvertWithDistribute.$Default
export type $Branch = SelectInvertWithDistribute.$Branch
export type $Options = $SelectInvert.$Options
export type $Default = $SelectInvert.$Default
export type $Branch = $SelectInvert.$Branch
}
10 changes: 5 additions & 5 deletions type-plus/ts/bigint/is_not_strict_bigint.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IsAnyOrNever } from '../mix_types/is_any_or_never.js'
import type { $ResolveOptions } from '../type_plus/$resolve_options.js'
import type { $ResolveBranch } from '../type_plus/branch/$resolve_branch.js'
import type { SelectWithDistribute } from '../type_plus/branch/select_with_distribute.js'
import type { $Select } from '../type_plus/branch/$select.js'
import type { $Else, $SelectionBranch, $Then } from '../type_plus/branch/selection.js'

/**
Expand Down Expand Up @@ -59,15 +59,15 @@ export type IsNotStrictBigint<
> =
IsAnyOrNever<T, $SelectionBranch> extends infer R
? R extends $Then ? $ResolveBranch<T, $O, [$Then]>
: R extends $Else ? ($ResolveOptions<[$O['distributive'], SelectWithDistribute.$Default['distributive']]> extends true
: R extends $Else ? ($ResolveOptions<[$O['distributive'], $Select.$Default['distributive']]> extends true
? IsNotStrictBigint._D<T, $O>
: IsNotStrictBigint._N<T, $O>)
: never : never

export namespace IsNotStrictBigint {
export type $Options = SelectWithDistribute.$Options
export type $Default = SelectWithDistribute.$Default
export type $Branch = SelectWithDistribute.$Branch
export type $Options = $Select.$Options
export type $Default = $Select.$Default
export type $Branch = $Select.$Branch
export type _D<T, $O extends IsNotStrictBigint.$Options> =
T extends bigint
? (`${T}` extends `${number}`
Expand Down
10 changes: 5 additions & 5 deletions type-plus/ts/bigint/is_strict_bigint.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IsAnyOrNever } from '../mix_types/is_any_or_never.js'
import type { $ResolveOptions } from '../type_plus/$resolve_options.js'
import type { $ResolveBranch } from '../type_plus/branch/$resolve_branch.js'
import type { SelectWithDistribute } from '../type_plus/branch/select_with_distribute.js'
import type { $Select } from '../type_plus/branch/$select.js'
import type { $Else, $SelectionBranch, $Then } from '../type_plus/branch/selection.js'

/**
Expand Down Expand Up @@ -62,15 +62,15 @@ export type IsStrictBigint<
> =
IsAnyOrNever<T, $SelectionBranch> extends infer R
? R extends $Then ? $ResolveBranch<T, $O, [$Else]>
: R extends $Else ? ($ResolveOptions<[$O['distributive'], SelectWithDistribute.$Default['distributive']]> extends true
: R extends $Else ? ($ResolveOptions<[$O['distributive'], $Select.$Default['distributive']]> extends true
? IsStrictBigint._D<T, $O>
: IsStrictBigint._N<T, $O>)
: never : never

export namespace IsStrictBigint {
export type $Options = SelectWithDistribute.$Options
export type $Default = SelectWithDistribute.$Default
export type $Branch = SelectWithDistribute.$Branch
export type $Options = $Select.$Options
export type $Default = $Select.$Default
export type $Branch = $Select.$Branch
export type _D<T, $O extends IsStrictBigint.$Options> =
T extends bigint
? (
Expand Down
10 changes: 5 additions & 5 deletions type-plus/ts/boolean/is_boolean.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SelectWithDistribute } from '../type_plus/branch/select_with_distribute.js'
import type { $Select } from '../type_plus/branch/$select.js'

/**
* 🎭 *predicate*
Expand Down Expand Up @@ -51,10 +51,10 @@ import type { SelectWithDistribute } from '../type_plus/branch/select_with_distr
* type R = IsBoolean<string, $SelectionBranch> // $Else
* ```
*/
export type IsBoolean<T, $O extends IsBoolean.$Options = {}> = SelectWithDistribute<T, boolean, $O>
export type IsBoolean<T, $O extends IsBoolean.$Options = {}> = $Select<T, boolean, $O>

export namespace IsBoolean {
export type $Options = SelectWithDistribute.$Options
export type $Default = SelectWithDistribute.$Default
export type $Branch = SelectWithDistribute.$Branch
export type $Options = $Select.$Options
export type $Default = $Select.$Default
export type $Branch = $Select.$Branch
}
10 changes: 5 additions & 5 deletions type-plus/ts/boolean/is_false.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SelectWithDistribute } from '../type_plus/branch/select_with_distribute.js'
import type { $Select } from '../type_plus/branch/$select.js'

/**
* 🎭 *predicate*
Expand Down Expand Up @@ -53,10 +53,10 @@ import type { SelectWithDistribute } from '../type_plus/branch/select_with_distr
* type R = IsFalse<string, $SelectionBranch> // $Else
* ```
*/
export type IsFalse<T, $O extends IsFalse.$Options = {}> = SelectWithDistribute<T, false, $O>
export type IsFalse<T, $O extends IsFalse.$Options = {}> = $Select<T, false, $O>

export namespace IsFalse {
export type $Options = SelectWithDistribute.$Options
export type $Default = SelectWithDistribute.$Default
export type $Branch = SelectWithDistribute.$Branch
export type $Options = $Select.$Options
export type $Default = $Select.$Default
export type $Branch = $Select.$Branch
}
10 changes: 5 additions & 5 deletions type-plus/ts/boolean/is_not_boolean.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SelectInvertWithDistribute } from '../type_plus/branch/select_invert_with_distribute.js'
import type { $SelectInvert } from '../type_plus/branch/$select_invert.js'

/**
* 🎭 *predicate*
Expand Down Expand Up @@ -51,10 +51,10 @@ import type { SelectInvertWithDistribute } from '../type_plus/branch/select_inve
* type R = IsNotBoolean<string, $SelectionBranch> // $Then
* ```
*/
export type IsNotBoolean<T, $O extends IsNotBoolean.$Options = {}> = SelectInvertWithDistribute<T, boolean, $O>
export type IsNotBoolean<T, $O extends IsNotBoolean.$Options = {}> = $SelectInvert<T, boolean, $O>

export namespace IsNotBoolean {
export type $Options = SelectInvertWithDistribute.$Options
export type $Default = SelectInvertWithDistribute.$Default
export type $Branch = SelectInvertWithDistribute.$Branch
export type $Options = $SelectInvert.$Options
export type $Default = $SelectInvert.$Default
export type $Branch = $SelectInvert.$Branch
}
10 changes: 5 additions & 5 deletions type-plus/ts/boolean/is_not_false.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SelectInvertWithDistribute } from '../type_plus/branch/select_invert_with_distribute.js'
import type { $SelectInvert } from '../type_plus/branch/$select_invert.js'

/**
* 🎭 *predicate*
Expand Down Expand Up @@ -54,10 +54,10 @@ import type { SelectInvertWithDistribute } from '../type_plus/branch/select_inve
* type R = IsNotFalse<string, $SelectionBranch> // $Then
* ```
*/
export type IsNotFalse<T, $O extends IsNotFalse.$Options = {}> = SelectInvertWithDistribute<T, false, $O>
export type IsNotFalse<T, $O extends IsNotFalse.$Options = {}> = $SelectInvert<T, false, $O>

export namespace IsNotFalse {
export type $Options = SelectInvertWithDistribute.$Options
export type $Default = SelectInvertWithDistribute.$Default
export type $Branch = SelectInvertWithDistribute.$Branch
export type $Options = $SelectInvert.$Options
export type $Default = $SelectInvert.$Default
export type $Branch = $SelectInvert.$Branch
}
12 changes: 6 additions & 6 deletions type-plus/ts/boolean/is_not_strict_boolean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { IsNever } from '../never/is_never.js'
import type { $Never } from '../never/never.js'
import type { $ResolveOptions } from '../type_plus/$resolve_options.js'
import type { $ResolveBranch } from '../type_plus/branch/$resolve_branch.js'
import type { SelectInvertStrictWithDistribute } from '../type_plus/branch/select_invert_strict_with_distribute.js'
import type { $SelectInvertStrict } from '../type_plus/branch/$select_invert_strict.js'
import type { $Else, $Then } from '../type_plus/branch/selection.js'
import type { IsUnknown } from '../unknown/is_unknown.js'
import type { $Unknown } from '../unknown/unknown.js'
Expand Down Expand Up @@ -78,15 +78,15 @@ export type IsNotStrictBoolean<T, $O extends IsNotStrictBoolean.$Options = {}> =
$then: $ResolveBranch<T, $O, [$Unknown, $Then]>,
$else:
(
$ResolveOptions<[$O['distributive'], SelectInvertStrictWithDistribute.$Default['distributive']]> extends true
$ResolveOptions<[$O['distributive'], $SelectInvertStrict.$Default['distributive']]> extends true
? (
IsStrictBoolean._DistributeMap<T> extends infer R
? ['aBcD' | 'AbCd' | 'abcd'] extends [R] ? $ResolveBranch<Exclude<T, boolean>, $O, [$Then | $Else]>
: ['aBcD' | 'AbCd'] extends [R] ? $ResolveBranch<T, $O, [$Else]>
: ['aBcd' | 'Abcd'] extends [R] ? $ResolveBranch<T, $O, [$Else]> : $ResolveBranch<T, $O, [$Then]>
: never
)
: SelectInvertStrictWithDistribute._N<T, boolean, $O>
: $SelectInvertStrict._N<T, boolean, $O>
)
}
>
Expand All @@ -95,7 +95,7 @@ export type IsNotStrictBoolean<T, $O extends IsNotStrictBoolean.$Options = {}> =
>

export namespace IsNotStrictBoolean {
export type $Options = SelectInvertStrictWithDistribute.$Options
export type $Default = SelectInvertStrictWithDistribute.$Default
export type $Branch = SelectInvertStrictWithDistribute.$Branch
export type $Options = $SelectInvertStrict.$Options
export type $Default = $SelectInvertStrict.$Default
export type $Branch = $SelectInvertStrict.$Branch
}
10 changes: 5 additions & 5 deletions type-plus/ts/boolean/is_not_true.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SelectInvertWithDistribute } from '../type_plus/branch/select_invert_with_distribute.js'
import type { $SelectInvert } from '../type_plus/branch/$select_invert.js'

/**
* 🎭 *predicate*
Expand Down Expand Up @@ -55,10 +55,10 @@ import type { SelectInvertWithDistribute } from '../type_plus/branch/select_inve
* type R = IsNotTrue<string, $SelectionBranch> // $Then
* ```
*/
export type IsNotTrue<T, $O extends IsNotTrue.$Options = {}> = SelectInvertWithDistribute<T, true, $O>
export type IsNotTrue<T, $O extends IsNotTrue.$Options = {}> = $SelectInvert<T, true, $O>

export namespace IsNotTrue {
export type $Options = SelectInvertWithDistribute.$Options
export type $Default = SelectInvertWithDistribute.$Default
export type $Branch = SelectInvertWithDistribute.$Branch
export type $Options = $SelectInvert.$Options
export type $Default = $SelectInvert.$Default
export type $Branch = $SelectInvert.$Branch
}
12 changes: 6 additions & 6 deletions type-plus/ts/boolean/is_strict_boolean.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IsAnyOrNever } from '../mix_types/is_any_or_never.js'
import type { $ResolveOptions } from '../type_plus/$resolve_options.js'
import type { $ResolveBranch } from '../type_plus/branch/$resolve_branch.js'
import type { SelectStrictWithDistribute } from '../type_plus/branch/select_strict_with_distribute.js'
import type { $SelectStrict } from '../type_plus/branch/$select_strict.js'
import type { $Else, $SelectionBranch, $Then } from '../type_plus/branch/selection.js'

/**
Expand Down Expand Up @@ -64,22 +64,22 @@ export type IsStrictBoolean<T, $O extends IsStrictBoolean.$Options = {}> = IsAny
> extends infer R
? R extends $Then ? $ResolveBranch<T, $O, [$Else]>
: R extends $Else ? (
$ResolveOptions<[$O['distributive'], SelectStrictWithDistribute.$Default['distributive']]> extends true
$ResolveOptions<[$O['distributive'], $SelectStrict.$Default['distributive']]> extends true
? (
IsStrictBoolean._DistributeMap<T> extends infer R
? ['aBcD' | 'AbCd' | 'abcd'] extends [R] ? $ResolveBranch<boolean, $O, [$Then]> | $ResolveBranch<Exclude<T, boolean>, $O, [$Else]>
: ['aBcD' | 'AbCd'] extends [R] ? $ResolveBranch<T, $O, [$Then]>
: ['aBcd' | 'Abcd'] extends [R] ? $ResolveBranch<T, $O, [$Then]> : $ResolveBranch<T, $O, [$Else]>
: never
)
: SelectStrictWithDistribute._N<T, boolean, $O>
: $SelectStrict._N<T, boolean, $O>
)
: never : never

export namespace IsStrictBoolean {
export type $Options = SelectStrictWithDistribute.$Options
export type $Default = SelectStrictWithDistribute.$Default
export type $Branch = SelectStrictWithDistribute.$Branch
export type $Options = $SelectStrict.$Options
export type $Default = $SelectStrict.$Default
export type $Branch = $SelectStrict.$Branch

export type _DistributeMap<T> = T extends true
? (T extends false
Expand Down
10 changes: 5 additions & 5 deletions type-plus/ts/boolean/is_true.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SelectWithDistribute } from '../type_plus/branch/select_with_distribute.js'
import type { $Select } from '../type_plus/branch/$select.js'

/**
* 🎭 *predicate*
Expand Down Expand Up @@ -53,10 +53,10 @@ import type { SelectWithDistribute } from '../type_plus/branch/select_with_distr
* type R = IsTrue<string, $SelectionBranch> // $Else
* ```
*/
export type IsTrue<T, $O extends IsTrue.$Options = {}> = SelectWithDistribute<T, true, $O>
export type IsTrue<T, $O extends IsTrue.$Options = {}> = $Select<T, true, $O>

export namespace IsTrue {
export type $Options = SelectWithDistribute.$Options
export type $Default = SelectWithDistribute.$Default
export type $Branch = SelectWithDistribute.$Branch
export type $Options = $Select.$Options
export type $Default = $Select.$Default
export type $Branch = $Select.$Branch
}
10 changes: 5 additions & 5 deletions type-plus/ts/function/is_function.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SelectWithDistribute } from '../type_plus/branch/select_with_distribute.js'
import type { $Select } from '../type_plus/branch/$select.js'

/**
* Is `T` a `Function`.
Expand All @@ -14,10 +14,10 @@ import type { SelectWithDistribute } from '../type_plus/branch/select_with_distr
* ```
*/

export type IsFunction<T, $O extends IsFunction.$Options = {}> = SelectWithDistribute<T, Function, $O>
export type IsFunction<T, $O extends IsFunction.$Options = {}> = $Select<T, Function, $O>

export namespace IsFunction {
export type $Options = SelectWithDistribute.$Options
export type $Default = SelectWithDistribute.$Default
export type $Branch = SelectWithDistribute.$Branch
export type $Options = $Select.$Options
export type $Default = $Select.$Default
export type $Branch = $Select.$Branch
}
10 changes: 5 additions & 5 deletions type-plus/ts/function/is_not_function.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SelectInvertWithDistribute } from '../type_plus/branch/select_invert_with_distribute.js'
import type { $SelectInvert } from '../type_plus/branch/$select_invert.js'

/**
* Is `T` not a `Function`.
Expand All @@ -13,10 +13,10 @@ import type { SelectInvertWithDistribute } from '../type_plus/branch/select_inve
* ```
*/

export type IsNotFunction<T, $O extends IsNotFunction.$Options = {}> = SelectInvertWithDistribute<T, Function, $O>
export type IsNotFunction<T, $O extends IsNotFunction.$Options = {}> = $SelectInvert<T, Function, $O>

export namespace IsNotFunction {
export type $Options = SelectInvertWithDistribute.$Options
export type $Default = SelectInvertWithDistribute.$Default
export type $Branch = SelectInvertWithDistribute.$Branch
export type $Options = $SelectInvert.$Options
export type $Default = $SelectInvert.$Default
export type $Branch = $SelectInvert.$Branch
}
12 changes: 6 additions & 6 deletions type-plus/ts/function/is_not_strict_function.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IsAnyOrNever } from '../mix_types/is_any_or_never.js'
import type { $ResolveOptions } from '../type_plus/$resolve_options.js'
import type { $ResolveBranch } from '../type_plus/branch/$resolve_branch.js'
import type { SelectInvertStrictWithDistribute } from '../type_plus/branch/select_invert_strict_with_distribute.js'
import type { $SelectInvertStrict } from '../type_plus/branch/$select_invert_strict.js'
import type { $Else, $SelectionBranch, $Then } from '../type_plus/branch/selection.js'

/**
Expand All @@ -22,16 +22,16 @@ export type IsNotStrictFunction<T, $O extends IsNotStrictFunction.$Options = {}>
> extends infer R
? R extends $Then ? $ResolveBranch<T, $O, [$Then]>
: R extends $Else ? (
$ResolveOptions<[$O['distributive'], SelectInvertStrictWithDistribute.$Default['distributive']]> extends true
$ResolveOptions<[$O['distributive'], $SelectInvertStrict.$Default['distributive']]> extends true
? IsNotStrictFunction._D<T, $O>
: SelectInvertStrictWithDistribute._N<T, Function, $O>
: $SelectInvertStrict._N<T, Function, $O>
)
: never : never

export namespace IsNotStrictFunction {
export type $Options = SelectInvertStrictWithDistribute.$Options
export type $Default = SelectInvertStrictWithDistribute.$Default
export type $Branch = SelectInvertStrictWithDistribute.$Branch
export type $Options = $SelectInvertStrict.$Options
export type $Default = $SelectInvertStrict.$Default
export type $Branch = $SelectInvertStrict.$Branch
export type _D<T, $O extends IsNotStrictFunction.$Options> =
T extends Function
? T extends (...args: any[]) => any
Expand Down
Loading

0 comments on commit 0ee75d2

Please sign in to comment.