Skip to content

Commit 5dcad06

Browse files
committed
revert arg object structure conversion for the parseSnippet function
1 parent f8d41da commit 5dcad06

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

Diff for: utils/snippetParser.ts

+9-13
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@ const codeRegex = /^(.+)```/s;
1313

1414
let errored = false;
1515

16-
function parseSnippet({
17-
snippetPath,
18-
name,
19-
text,
20-
}: {
21-
snippetPath: string;
22-
name: string;
23-
text: string;
24-
}): SnippetType | null {
16+
function parseSnippet(
17+
snippetPath: string,
18+
name: string,
19+
text: string
20+
): SnippetType | null {
2521
if (crlfRegex.exec(text) !== null) {
2622
return raise(
2723
"Found CRLF line endings instead of LF line endings",
@@ -117,11 +113,11 @@ export function parseAllSnippets() {
117113
const snippetPath = join(categoryPath, snippet);
118114
const snippetContent = readFileSync(snippetPath).toString();
119115
const snippetFileName = snippet.slice(0, -3);
120-
const snippetData = parseSnippet({
116+
const snippetData = parseSnippet(
121117
snippetPath,
122-
name: snippetFileName,
123-
text: snippetContent,
124-
});
118+
snippetFileName,
119+
snippetContent
120+
);
125121
if (snippetData === null) {
126122
errored = true;
127123
continue;

0 commit comments

Comments
 (0)