0.1.11 #11
@@ -36,7 +36,7 @@ export class TraitExpressionBuilder<
|
|||||||
]) as TraitExpressionBuilder.SpreadSupertraits<T>
|
]) as TraitExpressionBuilder.SpreadSupertraits<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
static uniqTraits<
|
static traitsUniq<
|
||||||
const T extends Trait<
|
const T extends Trait<
|
||||||
TraitExpression<
|
TraitExpression<
|
||||||
typeof TraitExpression.NullSuperclass,
|
typeof TraitExpression.NullSuperclass,
|
||||||
@@ -49,7 +49,7 @@ export class TraitExpressionBuilder<
|
|||||||
>(
|
>(
|
||||||
traits: T
|
traits: T
|
||||||
) {
|
) {
|
||||||
return uniq(traits) as TraitExpressionBuilder.UniqTraits<T>
|
return uniq(traits) as TraitExpressionBuilder.TraitsUniq<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ export class TraitExpressionBuilder<
|
|||||||
return new this.constructor(
|
return new this.constructor(
|
||||||
this.expressionSuperclass,
|
this.expressionSuperclass,
|
||||||
|
|
||||||
this.constructor.uniqTraits([
|
this.constructor.traitsUniq([
|
||||||
...this.expressionTraits,
|
...this.expressionTraits,
|
||||||
...this.constructor.spreadSupertraits(traits),
|
...this.constructor.spreadSupertraits(traits),
|
||||||
]),
|
]),
|
||||||
@@ -103,7 +103,7 @@ export class TraitExpressionBuilder<
|
|||||||
return new this.constructor(
|
return new this.constructor(
|
||||||
this.expressionSuperclass,
|
this.expressionSuperclass,
|
||||||
|
|
||||||
this.constructor.uniqTraits([
|
this.constructor.traitsUniq([
|
||||||
...this.constructor.spreadSupertraits(traits),
|
...this.constructor.spreadSupertraits(traits),
|
||||||
...this.expressionTraits,
|
...this.expressionTraits,
|
||||||
]),
|
]),
|
||||||
@@ -148,14 +148,14 @@ export namespace TraitExpressionBuilder {
|
|||||||
: []
|
: []
|
||||||
)
|
)
|
||||||
|
|
||||||
export type UniqTraits<Traits> = (
|
export type TraitsUniq<Traits> = (
|
||||||
Traits extends [
|
Traits extends [
|
||||||
...infer Rest,
|
...infer Rest,
|
||||||
infer El extends Trait<any, any, any, any>,
|
infer El extends Trait<any, any, any, any>,
|
||||||
]
|
]
|
||||||
? IsTraitInTupleFromRight<Rest, El> extends true
|
? IsTraitInTupleFromRight<Rest, El> extends true
|
||||||
? UniqTraits<Rest>
|
? TraitsUniq<Rest>
|
||||||
: [...UniqTraits<Rest>, El]
|
: [...TraitsUniq<Rest>, El]
|
||||||
: []
|
: []
|
||||||
)
|
)
|
||||||
type IsTraitInTupleFromRight<Traits, T> = (
|
type IsTraitInTupleFromRight<Traits, T> = (
|
||||||
|
|||||||
Reference in New Issue
Block a user