MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / removeProjectHistory

Function removeProjectHistory

src/utils/config.ts:974–997  ·  view source on GitHub ↗

* Removes history field from projects (migrated to history.jsonl) * @internal

(
  projects: Record<string, ProjectConfig> | undefined,
)

Source from the content-addressed store, hash-verified

972 * @internal
973 */
974function removeProjectHistory(
975 projects: Record<string, ProjectConfig> | undefined,
976): Record<string, ProjectConfig> | undefined {
977 if (!projects) {
978 return projects
979 }
980
981 const cleanedProjects: Record<string, ProjectConfig> = {}
982 let needsCleaning = false
983
984 for (const [path, projectConfig] of Object.entries(projects)) {
985 // history is removed from the type but may exist in old configs
986 const legacy = projectConfig as ProjectConfig & { history?: unknown }
987 if (legacy.history !== undefined) {
988 needsCleaning = true
989 const { history, ...cleanedConfig } = legacy
990 cleanedProjects[path] = cleanedConfig
991 } else {
992 cleanedProjects[path] = projectConfig
993 }
994 }
995
996 return needsCleaning ? cleanedProjects : projects
997}
998
999// fs.watchFile poll interval for detecting writes from other instances (ms)
1000const CONFIG_FRESHNESS_POLL_MS = 1000

Callers 1

saveGlobalConfigFunction · 0.85

Calls 1

entriesMethod · 0.80

Tested by

no test coverage detected