Skip to content

Commit f078803

Browse files
committed
fix(decorators): cast generic to object
1 parent 19c54ba commit f078803

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/decorators.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export const Inspectable = <T, P = object>(
1414
serialize(instance) {
1515
const payload = (options.serialize?.(instance) || {}) as P;
1616

17-
for (const property of (Reflect.getMetadata(kInspectProperties, instance) || [])) {
17+
// eslint-disable-next-line @typescript-eslint/ban-types, max-len
18+
for (const property of (Reflect.getMetadata(kInspectProperties, instance as Object) || [])) {
1819
payload[property as keyof P] = (instance as unknown as P)[property as keyof P];
1920
}
2021

0 commit comments

Comments
 (0)