Skip to content

Commit 77887a5

Browse files
authoredSep 18, 2023
Simplify map+flat call (#245)
1 parent 706ee2f commit 77887a5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎src/reporters/compact.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default ({ report, issues, isShowProgress }: ReporterOptions) => {
1818
const issuesForType = isSet
1919
? Array.from(issues[reportType] as IssueSet)
2020
: reportType === 'duplicates'
21-
? Object.values(issues[reportType]).map(Object.values).flat()
21+
? Object.values(issues[reportType]).flatMap(Object.values)
2222
: Object.values(issues[reportType] as IssueRecords).map(issues => {
2323
const items = Object.values(issues);
2424
return { ...items[0], symbols: items.map(issue => issue.symbol) };

‎src/reporters/json.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default async ({ report, issues, options }: ReporterOptions) => {
4040
const codeownersFilePath = resolve(opts.codeowners ?? '.github/CODEOWNERS');
4141
const codeownersEngine = isFile(codeownersFilePath) && OwnershipEngine.FromCodeownersFile(codeownersFilePath);
4242

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

4545
const initRow = (filePath: string) => {
4646
const file = relative(filePath);

0 commit comments

Comments
 (0)
Please sign in to comment.