Registry / type-stubs / deep-utility-types

deep-utility-types

JSON →
library1.3.1jsnpmunverified

Deep Utility Types is a TypeScript-focused library providing advanced utility types for performing operations like `Omit`, `Pick`, `Require`, and `Optional` on nested object structures. Unlike standard TypeScript utility types, this library supports dot-notation for accessing and modifying properties at any depth within an object, including handling arrays. It is fully type-safe, offers excellent autocompletion support in IDEs, and includes a mechanism for ignoring specific types (like large classes or built-ins) to improve type-checker performance and reduce noise in autocompletion suggestions. The current stable version is 1.3.1, with releases typically focusing on bug fixes and incremental features, such as exposing internal types for broader use. Its primary differentiator is its robust deep-nesting support and type-safety for complex object manipulations, which is not natively provided by TypeScript.

npm install deep-utility-types
INSTALL
IMPORT
SIG · DEEP-UTILITY-TYPES
D
deep-utility-types
type-stubsjavascriptv1.3.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DeepOmit
import { DeepOmit } from 'deep-utility-types';
const { DeepOmit } = require('deep-utility-types');
This library ships only TypeScript types and is intended for ES module imports in modern TypeScript projects. CommonJS 'require' will not work as it's a type-only package.
DeepPick
import { DeepPick } from 'deep-utility-types';
Used for picking nested properties via dot notation. Works identically to DeepOmit in terms of import pattern.
KeysAsDotNotation
import { KeysAsDotNotation } from 'deep-utility-types';
This utility type was exposed publicly in v1.3.0. Users on older versions will not be able to import it directly.

Demonstrates how to use `DeepOmit` to create a new type by removing specified nested properties using dot notation.

import { DeepOmit } from 'deep-utility-types'; type UserProfile = { id: string; name: string; contact: { email: string; phone: string; address: { street: string; city: string; zip: string; }; }; settings: { notifications: boolean; theme: 'light' | 'dark'; }; }; // Create a type that omits the user's phone number and notification setting type PublicUserProfile = DeepOmit<UserProfile, 'contact.phone' | 'settings.notifications'>; const user: PublicUserProfile = { id: 'user-123', name: 'John Doe', contact: { email: 'john.doe@example.com', address: { street: '123 Main St', city: 'Anytown', zip: '12345', }, }, settings: { theme: 'dark', }, }; console.log(user);
Debug
Known issues
gotchaThis library provides only TypeScript type definitions; it has no runtime JavaScript code. Attempting to use `require()` or expecting runtime behavior will result in errors.
fix
Ensure you are using `import` statements and only leveraging these constructs at the TypeScript compilation level, not at runtime.
affects: >=1.0.0
breakingWhen working with `KeysAsDotNotation` and union types, versions prior to v1.3.1 might incorrectly handle the union, leading to unexpected or incomplete key paths.
fix
Update to `deep-utility-types@1.3.1` or newer to ensure correct handling of unions within `KeysAsDotNotation`.
affects: <1.3.1
gotchaThe `KeysAsDotNotation` and `DefaultIgnoredTypes` were explicitly exposed as exportable types starting from version 1.3.0. If you are on an older version, these types will not be directly importable.
fix
Upgrade to `deep-utility-types@1.3.0` or later to access `KeysAsDotNotation` and `DefaultIgnoredTypes`.
affects: <1.3.0
gotchaFor types with very large or complex properties (like many built-in JavaScript classes such as `Function`, `Map`, `Promise`), not utilizing the `IgnoredTypes` generic parameter can lead to degraded type-checker performance and cluttered autocompletion suggestions.
fix
Pass the specific types to ignore as the third generic argument (e.g., `DeepOmit<MyType, 'key', SomeLargeClass>`) or leverage the exported `DefaultIgnoredTypes`.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'deep-utility-types' or its corresponding type declarations.
The package is not installed, or TypeScript cannot locate its declarations, possibly due to incorrect `tsconfig.json` setup or trying to import in a non-TypeScript file.
fix
Install the package: `npm install --save-dev deep-utility-types` or `yarn add --dev deep-utility-types`. Ensure your files are being processed by TypeScript and `tsconfig.json` includes the relevant directories.
Type 'Partial<OmittedType>' is not assignable to type 'OmittedType'. Property 'foo2' is missing in type 'Partial<OmittedType>' but required in type 'OmittedType'.
Incorrectly applying the deep utility type, or trying to assign an incomplete object where properties were expected to be optional but remain required by the new type definition.
fix
Carefully review the keys provided to `DeepOmit` or `DeepPick` to ensure they accurately reflect the desired output type. If properties should be optional, consider using `DeepOptional` or explicitly marking the resultant type as `Partial<T>` if the intention is to allow partial assignment.
Upgrade
Version history
1.3.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
43 hits · last 30 days
node
38
OpenAI (training)
1
Resources
deep-utility-types — npm install deep-utility-types · libregistry