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>(
5050}
5151
5252export 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 ;
5454} ;
5555
5656/**
@@ -63,7 +63,7 @@ export type TupleOf<T extends readonly Predicate<unknown>[]> = {
6363 * const a: unknown = [0, "a", true];
6464 * if (is.TupleOf(predTup)(a)) {
6565 * // a is narrowed to [number, string, boolean]
66- * const _: [number, string, boolean] = a;
66+ * const _: readonly [number, string, boolean] = a;
6767 * }
6868 * ```
6969 *
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ Deno.test("isTupleOf<T>", async (t) => {
104104 const predTup = [ isNumber , isString , isBoolean ] as const ;
105105 const a : unknown = [ 0 , "a" , true ] ;
106106 if ( isTupleOf ( predTup ) ( a ) ) {
107- const _ : [ number , string , boolean ] = a ;
107+ const _ : readonly [ number , string , boolean ] = a ;
108108 }
109109 } ) ;
110110 await t . step ( "returns true on T tuple" , ( ) => {
You can’t perform that action at this time.
0 commit comments