Files
homarr/packages/custom-widgets/src/runtime/input-state-utils.ts
T
Thomas fcca57ddf7 feat(custom-widgets): improve authoring workbench (#6689)
* feat(custom-widgets): improve authoring workbench

* fix(custom-widgets): address review and CI

* refactor(custom-widgets): satisfy architecture checks

* fix(custom-widgets): isolate workbench typing updates

* fix(custom-widgets): harden workbench state
2026-08-24 08:55:00 +02:00

20 lines
910 B
TypeScript

import type { WidgetInputType, WidgetInputValue } from "../jsx/runtime-components";
export function sameStringArray(left: string[], right: string[]) {
return left.length === right.length && left.every((value, index) => value === right[index]);
}
export function sameTypeRecord(left: Record<string, WidgetInputType>, right: Record<string, WidgetInputType>) {
const leftEntries = Object.entries(left);
const rightEntries = Object.entries(right);
return leftEntries.length === rightEntries.length && leftEntries.every(([name, type]) => right[name] === type);
}
export function sameInputRecord(left: Record<string, WidgetInputValue>, right: Record<string, WidgetInputValue>) {
const leftEntries = Object.entries(left);
const rightEntries = Object.entries(right);
return (
leftEntries.length === rightEntries.length && leftEntries.every(([name, value]) => Object.is(right[name], value))
);
}