Rocky_Mountain_Vending/.pnpm-store/v10/files/ca/dfefd6a87c32d85038e913d460aad5357effe2f4c62c6a4d35b6923cd499583524f5d53e6fd8394a9c12710439025da8e1ac20fb574152548a0bdc3bd41ab6
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

30 lines
994 B
Text

import type {OptionalKeysOf} from './optional-keys-of';
/**
Extract all required keys from the given type.
This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc...
@example
```
import type {RequiredKeysOf} from 'type-fest';
declare function createValidation<Entity extends object, Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>>(field: Key, validator: (value: Entity[Key]) => boolean): ValidatorFn;
interface User {
name: string;
surname: string;
luckyNumber?: number;
}
const validator1 = createValidation<User>('name', value => value.length < 25);
const validator2 = createValidation<User>('surname', value => value.length < 25);
```
@category Utilities
*/
export type RequiredKeysOf<BaseType extends object> =
BaseType extends unknown // For distributing `BaseType`
? Exclude<keyof BaseType, OptionalKeysOf<BaseType>>
: never; // Should never happen