import { HasParsablePath } from "../has-parsable-path"; import { MarkOptional } from "../mark-optional"; import { Paths } from "../paths"; import { Prettify } from "../prettify"; import { UnionToTuple } from "../union-to-tuple"; type RecursiveDeepMarkOptionalSinglePath = Type extends object ? KeyPath extends `${infer PropertyKey}.${infer RestKeyPath}` ? { [Key in keyof Type]: Key extends PropertyKey ? Prettify> : Type[Key]; } : Prettify> : Type; type RecursiveDeepMarkOptional = KeyPaths extends [ infer KeyPath, ...infer RestKeyPaths ] ? RestKeyPaths extends string[] ? RecursiveDeepMarkOptional, RestKeyPaths> : never : Accumulator; export type DeepMarkOptional> = HasParsablePath extends false ? Type : RecursiveDeepMarkOptional>; export {};