diff --git a/src/webpack/common/menu.ts b/src/webpack/common/menu.ts index 91a40bd50..4c231d241 100644 --- a/src/webpack/common/menu.ts +++ b/src/webpack/common/menu.ts @@ -25,5 +25,5 @@ export const Menu = findByProps("MenuItem", "MenuSliderControl"); export const ContextMenuApi: t.ContextMenuApi = mapMangledModule('type:"CONTEXT_MENU_OPEN', { closeContextMenu: filters.byCode("CONTEXT_MENU_CLOSE"), openContextMenu: filters.byCode("renderLazy:"), - openContextMenuLazy: e => typeof e === "function" && e.toString().length < 100 + openContextMenuLazy: e => typeof e === "function" && String(e).length < 100 }); diff --git a/src/webpack/common/utils.ts b/src/webpack/common/utils.ts index 250361c12..918c460bc 100644 --- a/src/webpack/common/utils.ts +++ b/src/webpack/common/utils.ts @@ -154,7 +154,7 @@ const openExpressionPickerMatcher = canonicalizeMatch(/setState\({activeView:\i, // TODO: type export const ExpressionPickerStore: t.ExpressionPickerStore = mapMangledModule("expression-picker-last-active-view", { closeExpressionPicker: filters.byCode("setState({activeView:null"), - openExpressionPicker: m => typeof m === "function" && openExpressionPickerMatcher.test(m.toString()), + openExpressionPicker: m => typeof m === "function" && openExpressionPickerMatcher.test(String(m)), }); export const PopoutActions: t.PopoutActions = mapMangledModule('type:"POPOUT_WINDOW_OPEN"', {