Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
cool
Browse files Browse the repository at this point in the history
  • Loading branch information
KATT committed Oct 7, 2023
1 parent 05bb0c7 commit c1c51a7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sync/deserialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,15 @@ export function createTsonParser(opts: TsonOptions): TsonParseFn {
}

return ((str: string) => {
let firstKey = true;
let nonce = "";
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return JSON.parse(str, (key, value) => {
if (!nonce && key === "_nonce") {
return JSON.parse(str, (_key, value) => {
if (firstKey) {
firstKey = false;
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
nonce = value;
return nonce;
}

if (!nonce) {
Expand Down

0 comments on commit c1c51a7

Please sign in to comment.