|
|
@ -1,5 +1,5 @@ |
|
|
|
export function parseProp(v: any): any { |
|
|
|
export function parseProp(v: any): any { |
|
|
|
if (!v) return |
|
|
|
if (!v) return {} |
|
|
|
try { |
|
|
|
try { |
|
|
|
return typeof v === 'string' ? JSON.parse(v) : v |
|
|
|
return typeof v === 'string' ? JSON.parse(v) : v |
|
|
|
} catch { |
|
|
|
} catch { |
|
|
@ -7,8 +7,8 @@ export function parseProp(v: any): any { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export function stringifyProp(v: any): string | void { |
|
|
|
export function stringifyProp(v: any): string | undefined { |
|
|
|
if (!v) return |
|
|
|
if (!v) return undefined |
|
|
|
try { |
|
|
|
try { |
|
|
|
return typeof v === 'string' ? v : JSON.stringify(v) |
|
|
|
return typeof v === 'string' ? v : JSON.stringify(v) |
|
|
|
} catch { |
|
|
|
} catch { |
|
|
|