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
8 changes: 1 addition & 7 deletions packages/core/src/analysis/aggregate.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import type { CoreAnalysis, CoreAnalysisInput } from '../types/core.js';
import type { PluginResult } from '../types/plugin.js';
import { firstNonEmptyLine } from '../utils/text.js';

function unique(values: string[]): string[] {
return [...new Set(values.filter((value) => value.trim().length > 0))];
}

function firstNonEmptyLine(text: string | undefined): string | undefined {
return text
?.split(/\r?\n/)
.map((line) => line.trim())
.find(Boolean);
}

function pickLeadResult(
pluginResults: PluginResult<unknown, unknown>[],
): PluginResult<unknown, unknown> | undefined {
Expand Down
8 changes: 1 addition & 7 deletions packages/core/src/plugins/generic.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import type { CoreAnalysisInput } from '../types/core.js';
import type { Error2FixPlugin } from '../types/plugin.js';

function firstNonEmptyLine(text: string | undefined): string | undefined {
return text
?.split(/\r?\n/)
.map((line) => line.trim())
.find(Boolean);
}
import { firstNonEmptyLine } from '../utils/text.js';

export const genericPlugin: Error2FixPlugin<
{
Expand Down
Loading