Rocky_Mountain_Vending/.pnpm-store/v10/files/a1/475be8d3c14b75df5895522aa7a069d2080fe46ffe2f2efa0908390cd89647342c78a5e5ced21574dea3a5bad9b0dc3598ad31abf3f5752cc258d2d8ab5976
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

51 lines
1.5 KiB
Text

import type {IfAny} from './if-any';
import type {IfNever} from './if-never';
import type {IfNotAnyOrNever, RequireNone} from './internal';
/**
Requires all of the keys in the given object.
*/
type RequireAll<ObjectType, KeysType extends keyof ObjectType> = Required<Pick<ObjectType, KeysType>>;
/**
Create a type that requires all of the given keys or none of the given keys. The remaining keys are kept as is.
Use-cases:
- Creating interfaces for components with mutually-inclusive keys.
The caveat with `RequireAllOrNone` is that TypeScript doesn't always know at compile time every key that will exist at runtime. Therefore `RequireAllOrNone` can't do anything to prevent extra keys it doesn't know about.
@example
```
import type {RequireAllOrNone} from 'type-fest';
type Responder = {
text?: () => string;
json?: () => string;
secure: boolean;
};
const responder1: RequireAllOrNone<Responder, 'text' | 'json'> = {
secure: true
};
const responder2: RequireAllOrNone<Responder, 'text' | 'json'> = {
text: () => '{"message": "hi"}',
json: () => '{"message": "ok"}',
secure: true
};
```
@category Object
*/
export type RequireAllOrNone<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> =
IfNotAnyOrNever<ObjectType,
IfNever<KeysType,
ObjectType,
_RequireAllOrNone<ObjectType, IfAny<KeysType, keyof ObjectType, KeysType>>
>>;
type _RequireAllOrNone<ObjectType, KeysType extends keyof ObjectType> = (
| RequireAll<ObjectType, KeysType>
| RequireNone<KeysType>
) & Omit<ObjectType, KeysType>; // The rest of the keys.