We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a03dda9 + c46003b commit 3cd5ff5Copy full SHA for 3cd5ff5
is.ts
@@ -59,6 +59,10 @@ export type TupleOf<T extends readonly Predicate<unknown>[]> = {
59
* const _: [number, string, boolean] = a;
60
* }
61
* ```
62
+ *
63
+ * Note that `predTup` must be `readonly` (`as const`) to infer the type of `a` correctly.
64
+ * TypeScript won't argues if `predTup` is not `readonly` because of its design limitation.
65
+ * https://github.com/microsoft/TypeScript/issues/34274#issuecomment-541691353
66
*/
67
export function isTupleOf<T extends readonly Predicate<unknown>[]>(
68
predTup: T,
0 commit comments