Stable suffix that captures expansion state for the geometry cache key.
( expandedKeys: ReadonlySet<string>, sourceStatus: FileSourceStatus | undefined, )
| 75 | |
| 76 | /** Stable suffix that captures expansion state for the geometry cache key. */ |
| 77 | function expansionCacheKey( |
| 78 | expandedKeys: ReadonlySet<string>, |
| 79 | sourceStatus: FileSourceStatus | undefined, |
| 80 | ) { |
| 81 | if (expandedKeys.size === 0) { |
| 82 | return ""; |
| 83 | } |
| 84 | |
| 85 | const sortedKeys = [...expandedKeys].sort().join(","); |
| 86 | const statusKey = |
| 87 | sourceStatus === undefined |
| 88 | ? "pending" |
| 89 | : sourceStatus.kind === "loaded" |
| 90 | ? `loaded:${sourceTextFingerprint(sourceStatus.text)}` |
| 91 | : sourceStatus.kind; |
| 92 | return `:${sortedKeys}:${statusKey}`; |
| 93 | } |
| 94 | |
| 95 | interface SectionGeometryCacheEntry { |
| 96 | key: string; |
no test coverage detected