Rocky_Mountain_Vending/.pnpm-store/v10/files/e9/5d99a2388ed91d9f96d17261962b7ba009c460214c224675f1b3d0538879e836da6607bb0b6d88e115f6bdb2894e8ad4812990f8039ecb68aa7ccca7dd830d
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

39 lines
1.1 KiB
Text

import type {Except} from './except';
import type {HomomorphicPick} from './internal';
import type {Simplify} from './simplify';
/**
Create a type that makes the given keys readonly. The remaining keys are kept as is.
Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are readonly.
@example
```
import type {SetReadonly} from 'type-fest';
type Foo = {
a: number;
readonly b: string;
c: boolean;
}
type SomeReadonly = SetReadonly<Foo, 'b' | 'c'>;
// type SomeReadonly = {
// a: number;
// readonly b: string; // Was already readonly and still is.
// readonly c: boolean; // Is now readonly.
// }
```
@category Object
*/
export type SetReadonly<BaseType, Keys extends keyof BaseType> =
// `extends unknown` is always going to be the case and is used to convert any
// union into a [distributive conditional
// type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
BaseType extends unknown
? Simplify<
Except<BaseType, Keys> &
Readonly<HomomorphicPick<BaseType, Keys>>
>
: never;