File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export function isArrayOf<T>(
50
50
}
51
51
52
52
export type TupleOf < T extends readonly Predicate < unknown > [ ] > = {
53
- - readonly [ P in keyof T ] : T [ P ] extends Predicate < infer U > ? U : never ;
53
+ [ P in keyof T ] : T [ P ] extends Predicate < infer U > ? U : never ;
54
54
} ;
55
55
56
56
/**
@@ -63,7 +63,7 @@ export type TupleOf<T extends readonly Predicate<unknown>[]> = {
63
63
* const a: unknown = [0, "a", true];
64
64
* if (is.TupleOf(predTup)(a)) {
65
65
* // a is narrowed to [number, string, boolean]
66
- * const _: [number, string, boolean] = a;
66
+ * const _: readonly [number, string, boolean] = a;
67
67
* }
68
68
* ```
69
69
*
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ Deno.test("isTupleOf<T>", async (t) => {
104
104
const predTup = [ isNumber , isString , isBoolean ] as const ;
105
105
const a : unknown = [ 0 , "a" , true ] ;
106
106
if ( isTupleOf ( predTup ) ( a ) ) {
107
- const _ : [ number , string , boolean ] = a ;
107
+ const _ : readonly [ number , string , boolean ] = a ;
108
108
}
109
109
} ) ;
110
110
await t . step ( "returns true on T tuple" , ( ) => {
You can’t perform that action at this time.
0 commit comments