0.1.20 #20
@@ -36,7 +36,7 @@ export class TraitExpressionBuilder<
|
||||
]) as readonly Trait<any, any, any, any>[] as TraitExpressionBuilder.SpreadSupertraits<T>
|
||||
}
|
||||
|
||||
static traitsUniq<
|
||||
static traitsUnique<
|
||||
const T extends readonly Trait<
|
||||
TraitExpression<
|
||||
typeof TraitExpression.NullSuperclass,
|
||||
@@ -49,7 +49,7 @@ export class TraitExpressionBuilder<
|
||||
>(
|
||||
traits: T
|
||||
) {
|
||||
return unique(traits) as readonly Trait<any, any, any, any>[] as TraitExpressionBuilder.TraitsUniq<T>
|
||||
return unique(traits) as readonly Trait<any, any, any, any>[] as TraitExpressionBuilder.TraitsUnique<T>
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ export class TraitExpressionBuilder<
|
||||
return new this.constructor(
|
||||
this.expressionSuperclass,
|
||||
|
||||
this.constructor.traitsUniq([
|
||||
this.constructor.traitsUnique([
|
||||
...this.expressionTraits,
|
||||
...this.constructor.spreadSupertraits(traits),
|
||||
]),
|
||||
@@ -109,7 +109,7 @@ export class TraitExpressionBuilder<
|
||||
return new this.constructor(
|
||||
this.expressionSuperclass,
|
||||
|
||||
this.constructor.traitsUniq([
|
||||
this.constructor.traitsUnique([
|
||||
...this.constructor.spreadSupertraits(traits),
|
||||
...this.expressionTraits,
|
||||
]),
|
||||
@@ -154,14 +154,14 @@ export namespace TraitExpressionBuilder {
|
||||
: readonly []
|
||||
)
|
||||
|
||||
export type TraitsUniq<Traits> = (
|
||||
export type TraitsUnique<Traits> = (
|
||||
Traits extends readonly [
|
||||
...infer Rest,
|
||||
infer El extends Trait<any, any, any, any>,
|
||||
]
|
||||
? IsTraitInTupleFromRight<Rest, El> extends true
|
||||
? TraitsUniq<Rest>
|
||||
: readonly [...TraitsUniq<Rest>, El]
|
||||
? TraitsUnique<Rest>
|
||||
: readonly [...TraitsUnique<Rest>, El]
|
||||
: readonly []
|
||||
)
|
||||
type IsTraitInTupleFromRight<Traits, T> = (
|
||||
@@ -176,7 +176,7 @@ export namespace TraitExpressionBuilder {
|
||||
Traits extends readonly Trait<any, any, any, any>[],
|
||||
T extends readonly Trait<any, any, any, any>[],
|
||||
> = (
|
||||
TraitExpressionBuilder.TraitsUniq<readonly [
|
||||
TraitExpressionBuilder.TraitsUnique<readonly [
|
||||
...Traits,
|
||||
...TraitExpressionBuilder.SpreadSupertraits<T>,
|
||||
]>
|
||||
@@ -186,7 +186,7 @@ export namespace TraitExpressionBuilder {
|
||||
Traits extends readonly Trait<any, any, any, any>[],
|
||||
T extends readonly Trait<any, any, any, any>[],
|
||||
> = (
|
||||
TraitExpressionBuilder.TraitsUniq<readonly [
|
||||
TraitExpressionBuilder.TraitsUnique<readonly [
|
||||
...TraitExpressionBuilder.SpreadSupertraits<T>,
|
||||
...Traits,
|
||||
]>
|
||||
|
||||
Reference in New Issue
Block a user