Files
backend/.pnpm-store/v10/files/01/d12d7c1da184d4d5d1954257dfbc63aa02a81e231c54afa6229aeb240ad91a791ae75b3f99112fd25112c51314916f213ddca1edadfb7bc8a77b4f6a454fa2
T
2026-03-22 13:31:39 +00:00

34 lines
787 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
Revert the `Partial` modifier on an object type.
Use-case: Infer the underlying type `T` when only `Partial<T>` is available or the original type may not be directly accessible.
@example
```
import type {UnwrapPartial} from 'type-fest';
type Config = Partial<{
port: number;
host: string;
secure?: boolean;
}>;
type InitializedConfig = UnwrapPartial<Config>;
//=> {port: number; host: string; secure?: boolean}
```
Note: If the provided type isnt of `Partial<T>`, `UnwrapPartial` has no effect on the original type.
@category Object
*/
export type UnwrapPartial<PartialObjectType> =
PartialObjectType extends Partial<infer ObjectType>
? (
Partial<ObjectType> extends PartialObjectType
? ObjectType
: PartialObjectType
)
: PartialObjectType;
export {};