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

Function entityFeatures

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

Source from the content-addressed store, hash-verified

42const entityFeatureCache = new WeakMap<ApiEntity, ReadonlySet<string>>()
43
44const entityFeatures = (entity: ApiEntity): ReadonlySet<string> => {
45 const cached = entityFeatureCache.get(entity)
46 if (cached !== undefined) {
47 return cached
48 }
49 const features = new Set<string>()
50 for (const declaration of entity.declarations) {
51 features.add(`declaration:${declaration.kind}`)
52 for (const member of declaration.members ?? []) {
53 features.add(`member:${member.kind}:${member.name}`)
54 }
55 }
56 entityFeatureCache.set(entity, features)
57 return features
58}
59
60const setSimilarity = (left: ReadonlySet<string>, right: ReadonlySet<string>): number => {
61 if (left.size === 0 && right.size === 0) {

Callers 1

groupSimilarityFunction · 0.85

Calls 3

getMethod · 0.65
addMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected