Skip to content

Commit 859b33a

Browse files
committed
explicitly type cast to unknown
1 parent 9c77258 commit 859b33a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/core/src/utils-hoist/object.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export function fill(source: { [key: string]: any }, name: string, replacementFa
2525
return;
2626
}
2727

28-
const original = source[name];
28+
// explicitly casting to unknown because we don't know the type of the method initially at all
29+
const original = source[name] as unknown;
30+
2931
if (typeof original !== 'function') {
3032
return;
3133
}

packages/core/test/utils-hoist/object.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('fill()', () => {
6363

6464
fill(source, name, replacement);
6565

66-
expect(source.foo).toEqual(propValue);
66+
expect(source.foo).toBe(propValue);
6767
expect(replacement).not.toBeCalled();
6868
});
6969

0 commit comments

Comments
 (0)