MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / removeProjectHistory

Function removeProjectHistory

source code/utils/config.ts:968–991  ·  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

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

Callers 1

saveGlobalConfigFunction · 0.85

Calls 1

entriesMethod · 0.80

Tested by

no test coverage detected