onboarding completed
This commit is contained in:
committed by
Carl-Gerhard Lindesvärd
parent
97627583ec
commit
7d22d2ddad
@@ -1,4 +1,5 @@
|
||||
import { anyPass, assocPath, isEmpty, isNil, reject } from 'ramda';
|
||||
import superjson from 'superjson';
|
||||
|
||||
export function toDots(
|
||||
obj: Record<string, unknown>,
|
||||
@@ -38,3 +39,16 @@ export function getSafeJson<T>(str: string): T | null {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export function getSuperJson<T>(str: string): T | null {
|
||||
const json = getSafeJson<T>(str);
|
||||
if (
|
||||
typeof json === 'object' &&
|
||||
json !== null &&
|
||||
'json' in json &&
|
||||
'meta' in json
|
||||
) {
|
||||
return superjson.parse<T>(str);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user