Skip to content

Commit

Permalink
fix: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eythaann committed Nov 1, 2023
1 parent d8054b0 commit aa70fbd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/modules/iterators/infrastructure.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ export type TupleFind<
* }
* type result = UnionMap<1 | 2 | 3, $callback>; // '1' | '2' | '3'
*/
export type UnionMap<T, $callback extends $<{ current: unknown }>> = T extends infer U ? Call<$callback, { current: U }> : never;
export type UnionMap<T, $callback extends $<[current: unknown]>> = T extends infer U ? Call<$callback, [current: U]> : never;
4 changes: 2 additions & 2 deletions lib/modules/iterators/infrastructure.spec-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ describeType('TupleFind', () => {
});

describeType('UnionMap', () => {
interface $callback extends $<{ current: number }> {
return: `${this['current']}`;
interface $callback extends $<[current: number]> {
return: `${this[0]}`;
}

testType('Should correctly map each number in a union to its string representation', () => {
Expand Down
10 changes: 5 additions & 5 deletions lib/modules/objects/app/ModifyPlusOrderedCombinations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { InternalAdd } from '../../numbers/math/app/addition';
import { InternalBiggerThan } from '../../numbers/math/app/arimetic';
import { $, TupleReduce, UnionMap } from '../../infrastructure';

interface $CreateGroup<T, maxLenght, Result extends unknown[], lastKey> extends $<{ current: unknown }> {
return: InternalBiggerThan<[lastKey], [this['current']]> extends true
interface $CreateGroup<T, maxLenght, Result extends unknown[], lastKey> extends $<[current: unknown]> {
return: InternalBiggerThan<[lastKey], [this[0]]> extends true
? never
: GetUnionGroupByNumericOrder<Exclude<T, this['current']>, maxLenght, [...Result, this['current']], this['current']>;
: GetUnionGroupByNumericOrder<Exclude<T, this[0]>, maxLenght, [...Result, this[0]], this[0]>;
}

type GetUnionGroupByNumericOrder<
Expand All @@ -35,8 +35,8 @@ interface $CreateAcumulativeModified<U, K extends string> extends $<[acc: unknow
}>;
}

interface $CreateAllAcumulativeModified<T, U, K extends string> extends $<{ current: nLengthTuple<string> }> {
return: TupleReduce<this['current'], $CreateAcumulativeModified<U, K>, T & { [_ in K]: [] }>;
interface $CreateAllAcumulativeModified<T, U, K extends string> extends $<[current: nLengthTuple<string>]> {
return: TupleReduce<this[0], $CreateAcumulativeModified<U, K>, T & { [_ in K]: [] }>;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/readable-test-types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ interface IValidationsPublic<T, I extends boolean = false> {
toBePromise: propertyCallableOnPass<isPromise<T>, I, 'promise'>;

/** Type should has the property passed */
toHaveProperty: <U>() => InvertIf<I, hasProperty<T, U>> extends true ? RTT_PASS : RTT_FAIL<FailMsgs<I>['property']>;
toHaveProperty: <U extends Readonly<PropertyKey>>(v?: U) => InvertIf<I, hasProperty<T, U>> extends true ? RTT_PASS : RTT_FAIL<FailMsgs<I>['property']>;
}

type IValidationsInternal<T> = IValidationsPublic<T> & {
Expand Down

0 comments on commit aa70fbd

Please sign in to comment.