Remove usages of in (#276333)

* Remove usages of in

* Update extensions/ipynb/src/serializers.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Don Jayamanne
2025-11-09 07:07:11 +00:00
committed by GitHub
parent 2fac2d47c7
commit b282eee40c
12 changed files with 62 additions and 36 deletions

View File

@@ -76,8 +76,8 @@ const domEval = (container: Element) => {
};
function getAltText(outputInfo: OutputItem) {
const metadata = outputInfo.metadata;
if (typeof metadata === 'object' && metadata && 'vscode_altText' in metadata && typeof metadata.vscode_altText === 'string') {
const metadata = outputInfo.metadata as Record<string, unknown> | undefined;
if (typeof metadata === 'object' && metadata && typeof metadata.vscode_altText === 'string') {
return metadata.vscode_altText;
}
return undefined;
@@ -337,9 +337,9 @@ function findScrolledHeight(container: HTMLElement): number | undefined {
}
function scrollingEnabled(output: OutputItem, options: RenderOptions) {
const metadata = output.metadata;
const metadata = output.metadata as Record<string, unknown> | undefined;
return (typeof metadata === 'object' && metadata
&& 'scrollable' in metadata && typeof metadata.scrollable === 'boolean') ?
&& typeof metadata.scrollable === 'boolean') ?
metadata.scrollable : options.outputScrolling;
}