( events: CompositorEventController, windowId: string, event: RuntimeWindowResizeEvent, )
| 2811 | : 0; |
| 2812 | if (width === 0 || !Array.isArray(value.values) || value.values.length === 0) { |
| 2813 | return null; |
| 2814 | } |
| 2815 | const flattened: number[] = []; |
| 2816 | for (const element of value.values) { |
| 2817 | const entries = width === 1 ? [element] : element; |
| 2818 | if ( |
| 2819 | !Array.isArray(entries) || |
| 2820 | entries.length !== width || |
| 2821 | entries.some( |
| 2822 | (entry) => typeof entry !== "number" || !Number.isFinite(entry), |
| 2823 | ) |
| 2824 | ) { |
| 2825 | return null; |
| 2826 | } |
| 2827 | flattened.push(...(entries as number[])); |
| 2828 | } |
| 2829 | return { values: flattened, arrayElementWidth: width }; |
| 2830 | } |
| 2831 | const values = typeof value === "number" ? [value] : value; |
| 2832 | if ( |
| 2833 | !Array.isArray(values) || |
| 2834 | values.length < 1 || |
| 2835 | values.length > 4 || |
| 2836 | values.some((entry) => typeof entry !== "number" || !Number.isFinite(entry)) |
| 2837 | ) { |
| 2838 | return null; |
| 2839 | } |
| 2840 | return { values: values as number[] }; |
| 2841 | } |
| 2842 | |
| 2843 | function asRecord(value: unknown): Record<string, unknown> | null { |
| 2844 | return typeof value === "object" && value !== null && !Array.isArray(value) |
| 2845 | ? (value as Record<string, unknown>) |
| 2846 | : null; |
| 2847 | } |
| 2848 | |
| 2849 | function recordsEqualExcept( |
| 2850 | left: Record<string, unknown>, |
| 2851 | right: Record<string, unknown>, |
| 2852 | excludedKey: string, |
| 2853 | ): boolean { |
| 2854 | const keys = Array.from( |
no test coverage detected