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

Function getVersionedCachePathIn

src/utils/plugins/pluginLoader.ts:140–163  ·  view source on GitHub ↗
(
  baseDir: string,
  pluginId: string,
  version: string,
)

Source from the content-addressed store, hash-verified

138 * @returns Absolute path to versioned plugin directory under baseDir
139 */
140export function getVersionedCachePathIn(
141 baseDir: string,
142 pluginId: string,
143 version: string,
144): string {
145 const { name: pluginName, marketplace } = parsePluginIdentifier(pluginId)
146 const sanitizedMarketplace = (marketplace || 'unknown').replace(
147 /[^a-zA-Z0-9\-_]/g,
148 '-',
149 )
150 const sanitizedPlugin = (pluginName || pluginId).replace(
151 /[^a-zA-Z0-9\-_]/g,
152 '-',
153 )
154 // Sanitize version to prevent path traversal attacks
155 const sanitizedVersion = version.replace(/[^a-zA-Z0-9\-_.]/g, '-')
156 return join(
157 baseDir,
158 'cache',
159 sanitizedMarketplace,
160 sanitizedPlugin,
161 sanitizedVersion,
162 )
163}
164
165/**
166 * Get versioned cache path for a plugin under the primary plugins directory.

Callers 3

getVersionedCachePathFunction · 0.85
probeSeedCacheFunction · 0.85
probeSeedCacheAnyVersionFunction · 0.85

Calls 1

parsePluginIdentifierFunction · 0.85

Tested by

no test coverage detected