MCPcopy Create free account
hub / github.com/Effect-TS/effect / uniqueModelDiagnostics

Function uniqueModelDiagnostics

packages/tools/jsdocs/src/Jsdocs.ts:2627–2637  ·  view source on GitHub ↗
(
  diagnostics: ReadonlyArray<JSDocModelDiagnostic>
)

Source from the content-addressed store, hash-verified

2625}
2626
2627function uniqueModelDiagnostics(
2628 diagnostics: ReadonlyArray<JSDocModelDiagnostic>
2629): ReadonlyArray<JSDocModelDiagnostic> {
2630 const seen = new Set<string>()
2631 return diagnostics.filter((item) => {
2632 const key = `${item.code}:${item.message}:${item.range[0]}:${item.range[1]}`
2633 if (seen.has(key)) return false
2634 seen.add(key)
2635 return true
2636 })
2637}
2638
2639function nodeRange(node: ts.Node): [number, number] {
2640 return [node.getStart(), node.getEnd()]

Callers 1

Calls 3

filterMethod · 0.80
addMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected