Skip to content

Commit

Permalink
Apply automatic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jellydn authored and github-actions[bot] committed Oct 23, 2024
1 parent 70bae26 commit e991c5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/hurl-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ export function parseHurlOutput(
currentEntry.captures = {};
}
} else if (isCaptures && line.trim() !== "") {
const [key, value] = line.slice(2).split(":").map((s) => s.trim());
const [key, value] = line
.slice(2)
.split(":")
.map((s) => s.trim());
if (currentEntry?.captures && key && value) {
currentEntry.captures[key] = value;
}
Expand Down
4 changes: 2 additions & 2 deletions test/hurl-parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ describe("parseHurlOutput", () => {

expect(result.entries).toHaveLength(1);
expect(result.entries[0].captures).toEqual({
id: '12345',
name: 'Example'
id: "12345",
name: "Example",
});
});
});

0 comments on commit e991c5a

Please sign in to comment.