mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
feat: first step of adding core charge functionality
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
@@ -47,3 +47,11 @@ export function cn(...inputs: ClassValue[]) {
|
||||
export function normalizeUrl(domain: string, url: string) {
|
||||
return url.replace(domain, '').replace('/collections', '/search').replace('/pages', '');
|
||||
}
|
||||
|
||||
export const parseMetaFieldValue = <T>(field: { value: string } | null): T | null => {
|
||||
try {
|
||||
return JSON.parse(field?.value || '{}');
|
||||
} catch (error) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user