Skip to content

Commit

Permalink
Fix TypeScript example
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security committed Jul 29, 2021
1 parent 124f4b3 commit 32606a5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/03-Implementation-Guide/01-Payload-Processing.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ function getJsonDepth(data: string): number {
let depth = 1;

// Step 6
while (stripped.length > 0 && stripped !== previous) {
stripped.split(/(\{\}|\[\])/g).join('');
while (stripped.length > 0 && stripped !== previous) {
previous = stripped;
stripped = stripped.replace(/({}|\[\])/g, '');
depth++;
}

Expand Down

0 comments on commit 32606a5

Please sign in to comment.