(entity: ApiEntity)
| 73 | const documentationTokenCache = new WeakMap<ApiEntity, ReadonlySet<string>>() |
| 74 | |
| 75 | const 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 | |
| 90 | const groupEntities = (entities: Iterable<ApiEntity>): ReadonlyArray<ApiGroup> => { |
| 91 | const groups = new Map<string, Array<ApiEntity>>() |
no test coverage detected