Skip to content

Commit

Permalink
Simplify map+flat call
Browse files Browse the repository at this point in the history
  • Loading branch information
Connormiha committed Sep 18, 2023
1 parent 706ee2f commit 7c827c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/reporters/compact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default ({ report, issues, isShowProgress }: ReporterOptions) => {
const issuesForType = isSet
? Array.from(issues[reportType] as IssueSet)
: reportType === 'duplicates'
? Object.values(issues[reportType]).map(Object.values).flat()
? Object.values(issues[reportType]).flatMap(Object.values)
: Object.values(issues[reportType] as IssueRecords).map(issues => {
const items = Object.values(issues);
return { ...items[0], symbols: items.map(issue => issue.symbol) };
Expand Down
2 changes: 1 addition & 1 deletion src/reporters/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default async ({ report, issues, options }: ReporterOptions) => {
const codeownersFilePath = resolve(opts.codeowners ?? '.github/CODEOWNERS');
const codeownersEngine = isFile(codeownersFilePath) && OwnershipEngine.FromCodeownersFile(codeownersFilePath);

const flatten = (issues: IssueRecords): Issue[] => Object.values(issues).map(Object.values).flat();
const flatten = (issues: IssueRecords): Issue[] => Object.values(issues).flatMap(Object.values);

const initRow = (filePath: string) => {
const file = relative(filePath);
Expand Down

0 comments on commit 7c827c0

Please sign in to comment.