onboarding completed

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-04-16 11:41:15 +02:00
committed by Carl-Gerhard Lindesvärd
parent 97627583ec
commit 7d22d2ddad
79 changed files with 2542 additions and 805 deletions

View File

@@ -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;
}