Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/schema/input.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion dist/schema/input.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/schema/input.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion src/schema/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,21 @@ import { z } from 'zod';

export const issueFormSchema = z.record(
z.string(),
z.string().or(z.array(z.string()))
z
.string()
.or(z.array(z.string()))
.or(z.array(z.array(z.unknown())))
.transform(value => {
// ?NOTE: This is just a workaround for issue in github issue parser: https://github.com/stefanbuck/github-issue-parser/issues/90
// Transform array of arrays into simple array
if (Array.isArray(value)) {
return value.map(item =>
Array.isArray(item) ? item.join(', ') : item
);
}

return value;
})
);

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