1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-30 23:44:55 +02:00
Files
joplin/packages/app-desktop/gui/ResizableLayout/utils/layoutItemProp.ts
2024-04-05 12:16:49 +01:00

10 lines
420 B
TypeScript

import findItemByKey from './findItemByKey';
import { LayoutItem } from './types';
export default function layoutItemProp(layout: LayoutItem, key: string, propName: string) {
const item = findItemByKey(layout, key);
if (!item) throw new Error(`Could not find layout item: ${key}`);
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
return (item as any)[propName];
}