{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "deep-partial",
  "type": "registry:lib",
  "title": "DeepPartial",
  "description": "A utility type that recursively makes all properties of a type optional, including nested objects, arrays, Maps, and Sets.",
  "dependencies": [],
  "files": [
    {
      "path": "registry/default/lib/deep-partial.ts",
      "content": "/**\n * Credit: https://github.com/typeorm/typeorm/blob/master/src/common/DeepPartial.ts\n */\n\n/**\n * A utility type that recursively makes all properties of a type optional, including nested objects.\n *\n * Unlike TypeScript's built-in `Partial<T>` which only makes top-level properties optional,\n * `DeepPartial<T>` recursively applies the `Partial` transformation to all nested objects,\n * arrays, Maps, and Sets within the type structure.\n *\n * @template T - The type to make deeply partial\n *\n * @example\n * ```typescript\n * interface User {\n *   id: number;\n *   name: string;\n *   address: {\n *     street: string;\n *     city: string;\n *   };\n * }\n *\n * type PartialUser = DeepPartial<User>;\n * // Result:\n * // {\n * //   id?: number;\n * //   name?: string;\n * //   address?: {\n * //     street?: string;\n * //     city?: string;\n * //   };\n * // }\n * ```\n *\n * @example\n * ```typescript\n * interface Config {\n *   api: {\n *     baseUrl: string;\n *     timeout: number;\n *   };\n *   features: string[];\n * }\n *\n * const partialConfig: DeepPartial<Config> = {\n *   api: {\n *     baseUrl: \"https://api.example.com\"\n *     // timeout is optional\n *   }\n *   // features is optional\n * };\n * ```\n *\n * @remarks\n * This type handles:\n * - Objects: Recursively makes all properties optional\n * - Arrays: Makes array elements deeply partial\n * - Maps: Makes both keys and values deeply partial\n * - Sets: Makes set elements deeply partial\n * - Primitives: Returns as-is\n */\nexport type DeepPartial<T> =\n  | T\n  | (T extends Array<infer U>\n      ? DeepPartial<U>[]\n      : T extends Map<infer K, infer V>\n        ? Map<DeepPartial<K>, DeepPartial<V>>\n        : T extends Set<infer M>\n          ? Set<DeepPartial<M>>\n          : T extends object\n            ? { [K in keyof T]?: DeepPartial<T[K]> }\n            : T);\n",
      "type": "registry:lib"
    }
  ]
}