MCPcopy Create free account
hub / github.com/bea4dev/ShojiWM / invokeWindowMove

Function invokeWindowMove

tools/decoration-runtime.ts:2853–2891  ·  view source on GitHub ↗
(
  events: CompositorEventController,
  windowId: string,
  event: RuntimeWindowMoveEvent,
)

Source from the content-addressed store, hash-verified

2851 }
2852 return { values: flattened, arrayElementWidth: width };
2853 }
2854 const values = typeof value === "number" ? [value] : value;
2855 if (
2856 !Array.isArray(values) ||
2857 values.length < 1 ||
2858 values.length > 4 ||
2859 values.some((entry) => typeof entry !== "number" || !Number.isFinite(entry))
2860 ) {
2861 return null;
2862 }
2863 return { values: values as number[] };
2864}
2865
2866function asRecord(value: unknown): Record<string, unknown> | null {
2867 return typeof value === "object" && value !== null && !Array.isArray(value)
2868 ? (value as Record<string, unknown>)
2869 : null;
2870}
2871
2872function recordsEqualExcept(
2873 left: Record<string, unknown>,
2874 right: Record<string, unknown>,
2875 excludedKey: string,
2876): boolean {
2877 const keys = Array.from(
2878 new Set([...Object.keys(left), ...Object.keys(right)]),
2879 ).filter((key) => key !== excludedKey);
2880 return keys.every((key) => deepEqual(left[key], right[key]));
2881}
2882
2883function deepEqual(left: unknown, right: unknown): boolean {
2884 if (Object.is(left, right)) {
2885 return true;
2886 }
2887 if (Array.isArray(left) && Array.isArray(right)) {
2888 return (
2889 left.length === right.length &&
2890 left.every((value, index) => deepEqual(value, right[index]))
2891 );
2892 }
2893 const leftRecord = asRecord(left);
2894 const rightRecord = asRecord(right);

Callers 1

mainFunction · 0.85

Calls 5

hasActiveAnimationsFunction · 0.90
peekNextPollDelayFunction · 0.85
emitWindowMoveMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected