Open
Description
Document says
interface IsNumber extends Fn {
return: this["arg0"] extends number ? true : false;
}
type T0 = Call<Tuples.GroupBy<IsNumber>, [1, "str", 2]>;
// ^? { true: [1, 2], false: ["str"] }
type T2 = Call<Tuples.GroupBy<Strings.StartsWith<"a">>, ["alice", "bob", "carl"]>;
// ^? { true: ["alice"], false: ["bob", "carl"] }
But it's actually
interface IsNumber extends Fn {
return: this['arg0'] extends number ? true : false;
}
type T0 = Call<Tuples.GroupBy<IsNumber>, [1, 'str', 2]>;
// never
type T2 = Call<Tuples.GroupBy<Strings.StartsWith<'a'>>, ['alice', 'bob', 'carl']>;
// never
Because boolean can not be the property name
Metadata
Metadata
Assignees
Labels
No labels