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

Function documentationTokens

packages/tools/api-diff/src/Diff.ts:75–88  ·  view source on GitHub ↗
(entity: ApiEntity)

Source from the content-addressed store, hash-verified

73const documentationTokenCache = new WeakMap<ApiEntity, ReadonlySet<string>>()
74
75const documentationTokens = (entity: ApiEntity): ReadonlySet<string> => {
76 const cached = documentationTokenCache.get(entity)
77 if (cached !== undefined) {
78 return cached
79 }
80 const tokens = new Set(
81 (entity.documentation.summary ?? "")
82 .toLowerCase()
83 .match(/[a-z][a-z0-9]+/g)
84 ?.filter((token) => token.length >= 4) ?? []
85 )
86 documentationTokenCache.set(entity, tokens)
87 return tokens
88}
89
90const groupEntities = (entities: Iterable<ApiEntity>): ReadonlyArray<ApiGroup> => {
91 const groups = new Map<string, Array<ApiEntity>>()

Callers 1

groupSimilarityFunction · 0.85

Calls 3

filterMethod · 0.80
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected