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

Function parseShellFrontmatter

source code/utils/frontmatterParser.ts:353–372  ·  view source on GitHub ↗
(
  value: unknown,
  source: string,
)

Source from the content-addressed store, hash-verified

351 * and other fields degrade.
352 */
353export function parseShellFrontmatter(
354 value: unknown,
355 source: string,
356): FrontmatterShell | undefined {
357 if (value == null) {
358 return undefined
359 }
360 const normalized = String(value).trim().toLowerCase()
361 if (normalized === '') {
362 return undefined
363 }
364 if ((FRONTMATTER_SHELLS as readonly string[]).includes(normalized)) {
365 return normalized as FrontmatterShell
366 }
367 logForDebugging(
368 `Frontmatter 'shell: ${value}' in ${source} is not recognized. Valid values: ${FRONTMATTER_SHELLS.join(', ')}. Falling back to bash.`,
369 { level: 'warn' },
370 )
371 return undefined
372}

Callers 2

createPluginCommandFunction · 0.85

Calls 1

logForDebuggingFunction · 0.85

Tested by

no test coverage detected