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>
31 lines
631 B
Text
31 lines
631 B
Text
/**
|
|
Represents an object with `unknown` value. You probably want this instead of `{}`.
|
|
|
|
Use case: You have an object whose keys and values are unknown to you.
|
|
|
|
@example
|
|
```
|
|
import type {UnknownRecord} from 'type-fest';
|
|
|
|
function toJson(object: UnknownRecord) {
|
|
return JSON.stringify(object);
|
|
}
|
|
|
|
toJson({hello: 'world'});
|
|
//=> '{"hello":"world"}'
|
|
|
|
function isObject(value: unknown): value is UnknownRecord {
|
|
return typeof value === 'object' && value !== null;
|
|
}
|
|
|
|
isObject({hello: 'world'});
|
|
//=> true
|
|
|
|
isObject('hello');
|
|
//=> false
|
|
```
|
|
|
|
@category Type
|
|
@category Object
|
|
*/
|
|
export type UnknownRecord = Record<PropertyKey, unknown>;
|