Skip to content
← Public packages

@kentcdodds/friction-log

Qualify and file friction papercuts to GitHub (any owner/repo) or wake Patch for Kody packages; daily sweep of kody-hq/kody friction issues.

FollowFork

src/eligibility.ts

14 lines · 506 B · TypeScript
Raw
import { skippedLabel, type Eligibility, type FrictionIssue } from './shared.ts'

export function hasSkippedLabel(issue: FrictionIssue) {
	return issue.labels.includes(skippedLabel)
}

export function isEligibleIssue(issue: FrictionIssue): Eligibility {
	if (hasSkippedLabel(issue)) return { eligible: false, reason: 'skipped' }
	return { eligible: true, reason: 'open' }
}

export function eligibleIssues(issues: Array<FrictionIssue>) {
	return issues.filter((issue) => isEligibleIssue(issue).eligible)
}