Skip to content

Commit 61cdf83

Browse files
committed
workaround: don't fail when issue parser returns array of arrays
Revert this patch once fix is merged upstream: stefanbuck/github-issue-parser#91
1 parent 1c2e3d4 commit 61cdf83

File tree

6 files changed

+41
-6
lines changed

6 files changed

+41
-6
lines changed

dist/index.js

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/schema/input.d.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/schema/input.js

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/schema/input.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/schema/input.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,21 @@ import { z } from 'zod';
22

33
export const issueFormSchema = z.record(
44
z.string(),
5-
z.string().or(z.array(z.string()))
5+
z
6+
.string()
7+
.or(z.array(z.string()))
8+
.or(z.array(z.array(z.unknown())))
9+
.transform(value => {
10+
// !FIXME: This is just a workaround for issue in github issue parser: https://github.com/stefanbuck/github-issue-parser/issues/90
11+
// TODO: revert once fix is merged upstream: https://github.com/stefanbuck/github-issue-parser/pull/91
12+
if (Array.isArray(value)) {
13+
return value.map(item =>
14+
Array.isArray(item) ? item.join(', ') : item
15+
);
16+
}
17+
18+
return value;
19+
})
620
);
721

822
export type IssueFormType = z.infer<typeof issueFormSchema>;

0 commit comments

Comments
 (0)