Skip to content

Commit 2d90f04

Browse files
committed
properly enforce non-function properties and fix expansion in docs
1 parent 0a5917f commit 2d90f04

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/BaseComponent.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,16 @@
1818
/**
1919
* Non-readonly non-method keys
2020
*/
21-
type WritableKeys<T> = Extract<
22-
{
21+
type WritableKeys<T> = {
2322
[Prop in keyof T]: (
2423
(<G>() => G extends Pick<T, Prop> ? 1 : 2) extends
2524
(<G>() => G extends Record<Prop, T[Prop]> ? 1 : 2)
2625
? true
2726
: false
2827
) extends false
2928
? never
30-
: Prop;
31-
}[keyof T],
32-
{
33-
[K in keyof T]: T[K] extends Function ? never : K;
34-
}[keyof T]
35-
>;
29+
: (T[Prop] extends Function | null ? never : Prop);
30+
}[keyof T];
3631

3732

3833
/**

0 commit comments

Comments
 (0)