From 16cb1ea0cfe396546861af6b2f08e0abf1ac809c Mon Sep 17 00:00:00 2001 From: Harry Whorlow Date: Thu, 22 Jan 2026 20:03:06 +0100 Subject: [PATCH] fix(deep-keys): fix recursive types --- packages/devtools-ui/tests/deep-keys.ts | 67 +++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 packages/devtools-ui/tests/deep-keys.ts diff --git a/packages/devtools-ui/tests/deep-keys.ts b/packages/devtools-ui/tests/deep-keys.ts new file mode 100644 index 00000000..986cf3e7 --- /dev/null +++ b/packages/devtools-ui/tests/deep-keys.ts @@ -0,0 +1,67 @@ +import type { CollapsiblePaths } from '../src/utils/deep-keys' + +type WithDeeplyNestedObject = { + a: { + b: { + c: { + d: { + e: { + f: { + g: { + h: { + i: { + j: number + } + } + } + } + } + } + } + } + } +} + +type _DeeplyNestedObject = CollapsiblePaths + +type WithAny = { + errors?: any +} + +type _Any = CollapsiblePaths + +type ArrayRecursion = { arr: Array>>> } + +type _ArrayRecursion = CollapsiblePaths + +type WithUndefined = { + status?: { + valid: boolean + error?: { + message: string + } + } +} + +type _WithUndefined = CollapsiblePaths + +type WithUnknown = { + payload: unknown +} + +type _WithUnknown = CollapsiblePaths + +type WithRealisticState = { + canSubmit?: boolean + isSubmitting?: boolean + errors?: Array + errorMap?: Record +} + +type _WithRealisticState = CollapsiblePaths + +type WithGeneric = { + generic: TData +} + +type _WithGeneric = CollapsiblePaths>