mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 23:46:58 +00:00
13 lines
425 B
TypeScript
13 lines
425 B
TypeScript
export function isString(value: unknown): value is string {
|
|
return typeof value === "string";
|
|
}
|
|
|
|
export function isNumber(value: unknown): value is number {
|
|
return typeof value === "number";
|
|
}
|
|
|
|
export function hasLocalizedStringValue(obj: unknown, locale: string): boolean {
|
|
if (!obj || typeof obj !== "object" || !(locale in obj)) return false;
|
|
return typeof (obj as Record<string, unknown>)[locale] === "string";
|
|
}
|