{"id":24890,"library":"advanced-utility-types","title":"advanced-utility-types","description":"A TypeScript library providing advanced utility generic types such as DeepOptional, DeepOmit, and DeepPaths. Version 1.1.0 allows recursive manipulation of deeply nested object properties using dot-separated paths or template literal strings, with support for arrays. It is released under the MIT license and is intended for type-level programming in TypeScript projects. Unlike simpler utility types libraries (e.g., type-fest), this package focuses specifically on deep path-based transformations.","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript","utility","types"],"install":[{"cmd":"npm install advanced-utility-types","lang":"bash","label":"npm"},{"cmd":"yarn add advanced-utility-types","lang":"bash","label":"yarn"},{"cmd":"pnpm add advanced-utility-types","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"The library provides TypeScript type definitions; it requires TypeScript 4.1+ for template literal support.","package":"typescript","optional":false}],"imports":[{"note":"This is a type-only import; the library is intended for TypeScript and does not emit runtime code. Use import type if you prefer.","wrong":"const { DeepOptional } = require('advanced-utility-types')","symbol":"DeepOptional","correct":"import { DeepOptional } from 'advanced-utility-types'"},{"note":"DeepOmit is a named export, not a default export.","wrong":"import DeepOmit from 'advanced-utility-types'","symbol":"DeepOmit","correct":"import { DeepOmit } from 'advanced-utility-types'"},{"note":"All types are exported from the main entry point; no subpath imports are needed.","wrong":"import { DeepPaths } from 'advanced-utility-types/types'","symbol":"DeepPaths","correct":"import { DeepPaths } from 'advanced-utility-types'"}],"quickstart":{"code":"import { DeepOptional, DeepOmit, DeepPaths } from 'advanced-utility-types';\n\ntype Obj = {\n  a: string;\n  b: {\n    c: number;\n    d: {\n      e: boolean;\n    }\n  };\n  f: Array<{ g: string; h: number }>;\n};\n\n// DeepOptional: make a deeply nested property optional\ntype OptionalResult = DeepOptional<Obj, 'b.d.e'>;\n// Expected: { a: string; b: { c: number; d: { e?: boolean } }; f: Array<{ g: string; h: number }> }\n\n// DeepOmit: remove a deeply nested property\ntype OmitResult = DeepOmit<Obj, 'b.d.e'>;\n// Expected: { a: string; b: { c: number; d: {} }; f: Array<{ g: string; h: number }> }\n\n// DeepPaths: get all dot-separated paths\ntype Paths = DeepPaths<Obj>;\n// Expected: 'a' | 'b' | 'b.c' | 'b.d' | 'b.d.e' | 'f' | `f.${number}` | `f.${number}.g` | `f.${number}.h`\n\n// Array support with template literals\ntype ArrObj = { a: { b: Array<{ c: string }> } };\ntype Result = DeepOptional<ArrObj, `a.b.${number}.c`>;\n// Expected: { a: { b: Array<{ c?: string }> } }","lang":"typescript","description":"Demonstrates usage of DeepOptional, DeepOmit, and DeepPaths to manipulate deeply nested object types."},"warnings":[{"fix":"Upgrade TypeScript to at least version 4.1.","message":"TypeScript version requirement: The library uses template literal types, requiring TypeScript 4.1 or later.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Limit the depth of nested types or use alternative types with manual path specification.","message":"DeepPaths may generate very large union types for deeply nested objects, leading to performance issues or TypeScript compilation errors.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"When using array paths like `a.b.${number}.c`, only the leaf property (c) becomes optional, not the array indices.","message":"DeepOptional does not deeply preserve required properties for array items; only the specified path is made optional.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure that after omission, the resulting type still matches your expected shape; consider using DeepOptional instead.","message":"DeepOmit will remove the property entirely; if the object becomes empty (e.g., all properties omitted), the type reduces to {}.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Reduce nesting depth or use explicit path strings instead of DeepPaths.","cause":"DeepPaths or related recursive types applied to a deeply nested object type.","error":"Type instantiation is excessively deep and possibly infinite."},{"fix":"Install the package: npm install advanced-utility-types, then import as named export.","cause":"Incorrect import path or library not installed.","error":"Cannot find name 'DeepOptional'. Did you mean 'Optional'?"},{"fix":"Use a template literal: `a.b.${number}.c` instead of `a.b.number.c`.","cause":"Using a plain string literal instead of a template literal type for array indices.","error":"Type 'string' is not assignable to type '${number}'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}