Skip to content

Commit 2e3909b

Browse files
committed
Add explicit type casting
1 parent dbafd70 commit 2e3909b

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

packages/base/src/utils/deprecateObject.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ const PROPERTY_DENYLIST = new Set<string | symbol>([
1515
'valueOf'
1616
]);
1717

18-
export default function deprecateNamespace<T extends { [key: string | symbol]: any }>(
19-
namespace: T,
20-
message: string
21-
): T {
18+
export default function deprecateObject<T extends { [key: string | symbol]: any }>(namespace: T, message: string): T {
2219
const warnDeprecation = warnOnce(message);
2320

2421
return new Proxy<T>(namespace, {

packages/bundle/src/boot/exports/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import * as hooks from '../actual/hook/full';
2121
const deprecatedHooks = deprecateObject(
2222
hooks,
2323
"`import { hooks } from 'botframework-webchat'` has been deprecated, use `import { %s } from 'botframework-webchat/hook'` instead."
24-
);
24+
) as typeof hooks; // Need explicit type casting.
2525

2626
export { deprecatedHooks as hooks };
2727

@@ -30,7 +30,7 @@ import * as Components from '../actual/component/full';
3030
const deprecatedComponents = deprecateObject(
3131
Components,
3232
"`import { Components } from 'botframework-webchat'` has been deprecated, use `import { %s } from 'botframework-webchat/component'` instead."
33-
);
33+
) as typeof Components; // Need explicit type casting.
3434

3535
export { deprecatedComponents as Components };
3636
// #endregion

0 commit comments

Comments
 (0)