Rocky_Mountain_Vending/.pnpm-store/v10/files/79/85704f0b4413351184276cb270a70ad9223a87cf817caf2e3bce662ea38f764a441b94e150be4cadd0048c3400bef36258a65219f165d3bb7758bcbf8a0a45
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

36 lines
1.2 KiB
Text

import type {Merge} from './merge';
/**
Override existing properties of the given type. Similar to `Merge`, but enforces that the original type has the properties you want to override.
This is useful when you want to override existing properties with a different type and make sure that these properties really exist in the original.
@example
```
type Foo = {
a: string
b: string
}
type Bar = OverrideProperties<Foo, {b: number}>
//=> {a: string, b: number}
type Baz = OverrideProperties<Foo, {c: number}>
// Error, type '{ c: number; }' does not satisfy the constraint '{ c: never; }'
type Fizz = OverrideProperties<Foo, {b: number; c: number}>
// Error, type '{ b: number; c: number; }' does not satisfy the constraint '{ b: number; c: never; }'
```
@category Object
*/
export type OverrideProperties<
TOriginal,
// This first bit where we use `Partial` is to enable autocomplete
// and the second bit with the mapped type is what enforces that we don't try
// to override properties that doesn't exist in the original type.
TOverride extends Partial<Record<keyof TOriginal, unknown>> & {
[Key in keyof TOverride]: Key extends keyof TOriginal
? TOverride[Key]
: never;
},
> = Merge<TOriginal, TOverride>;