UNPKG

@polyv/utils

Version:

Utility functions of Polyv frontend development.

1 lines 184 B
export function cloneJSON(t){return null==t?t:JSON.parse(JSON.stringify(t))}export function tryParseJSON(t,r){let n;try{n=JSON.parse(t)}catch(t){n="function"==typeof r?r(t):r}return n}