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

33 lines
848 B
Text

import type {IsEqual} from './is-equal';
/**
Extract all writable keys from the given type.
This is useful when you want to create a new type that contains writable keys only.
@example
```
import type {WritableKeysOf} from 'type-fest';
interface User {
name: string;
surname: string;
readonly id: number;
}
type UpdateRequest<Entity extends object> = Pick<Entity, WritableKeysOf<Entity>>;
const update1: UpdateRequest<User> = {
name: 'Alice',
surname: 'Acme',
};
```
@category Utilities
*/
export type WritableKeysOf<T> =
T extends unknown // For distributing `T`
? (keyof {
[P in keyof T as IsEqual<{[Q in P]: T[P]}, {readonly [Q in P]: T[P]}> extends false ? P : never]: never
}) & keyof T // Intersect with `keyof T` to ensure result of `WritableKeysOf<T>` is always assignable to `keyof T`
: never; // Should never happen