You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Return a type predicate function that returns `true` if the type of `x` is `ParametersOf<T>` or `ParametersOf<T, E>`.
756
+
*
757
+
* This is similar to `TupleOf<T>` or `TupleOf<T, E>`, but if `is.OptionalOf()` is specified at the trailing, the trailing elements becomes optional and makes variable-length tuple.
758
+
*
759
+
* To enhance performance, users are advised to cache the return value of this function and mitigate the creation cost.
760
+
*
761
+
* ```ts
762
+
* import { is } from "https://deno.land/x/unknownutil@$MODULE_VERSION/mod.ts";
763
+
*
764
+
* const isMyType = is.ParametersOf([
765
+
* is.Number,
766
+
* is.OptionalOf(is.String),
767
+
* is.Boolean,
768
+
* is.OptionalOf(is.Number),
769
+
* is.OptionalOf(is.String),
770
+
* is.OptionalOf(is.Boolean),
771
+
* ] as const);
772
+
* const a: unknown = [0, undefined, "a"];
773
+
* if (isMyType(a)) {
774
+
* // a is narrowed to [number, string | undefined, boolean, number?, string?, boolean?]
0 commit comments