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

Function uniqueModelDiagnostics

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

Source from the content-addressed store, hash-verified

2679}
2680
2681function uniqueModelDiagnostics(
2682 diagnostics: ReadonlyArray<JSDocModelDiagnostic>
2683): ReadonlyArray<JSDocModelDiagnostic> {
2684 const seen = new Set<string>()
2685 return diagnostics.filter((item) => {
2686 const key = `${item.code}:${item.message}:${item.range[0]}:${item.range[1]}`
2687 if (seen.has(key)) return false
2688 seen.add(key)
2689 return true
2690 })
2691}
2692
2693function nodeRange(node: ts.Node): [number, number] {
2694 return [node.getStart(), node.getEnd()]

Callers 1

Calls 3

hasMethod · 0.65
addMethod · 0.65
filterMethod · 0.45

Tested by

no test coverage detected