Skip to content

Commit

Permalink
fix issue with result parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-statsig committed May 8, 2024
1 parent 94bc357 commit 84a0130
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30762,7 +30762,9 @@ class SizeLimit {
];
}
parseResults(output) {
const results = JSON.parse(output);
const begin = output.indexOf('{');
const end = output.lastIndexOf('}');
const results = JSON.parse(output.slice(begin, end + 1));
return results.reduce((current, result) => {
let time = {};
if (result.loading !== undefined && result.running !== undefined) {
Expand Down
4 changes: 3 additions & 1 deletion src/SizeLimit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ class SizeLimit {
}

parseResults(output: string): { [name: string]: IResult } {
const results = JSON.parse(output);
const begin = output.indexOf('{');
const end = output.lastIndexOf('}');
const results = JSON.parse(output.slice(begin, end + 1));

return results.reduce(
(current: { [name: string]: IResult }, result: any) => {
Expand Down

0 comments on commit 84a0130

Please sign in to comment.