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>