1
0
mirror of https://github.com/flarum/core.git synced 2025-08-04 23:47:32 +02:00

TS: Be more specific in type assertion

See https://stackoverflow.com/a/33404548.
This commit is contained in:
Franz Liedke
2020-09-18 14:09:28 +02:00
parent 32767d6321
commit 4a0947db4b

View File

@@ -108,7 +108,7 @@ export default abstract class Component<T extends ComponentAttrs = any> implemen
* and checking for common issues.
*/
private setAttrs(attrs: T = {} as T): void {
(this.constructor as any).initAttrs(attrs);
(this.constructor as typeof Component).initAttrs(attrs);
if (attrs) {
if ('children' in attrs) {