MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / normalizePromptKey

Function normalizePromptKey

scripts/print.ts:7–10  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

5import { PromptStore, PROMPT_KEYS, type PromptKey, type RuntimePrompts } from "../lib/prompts/store"
6
7function normalizePromptKey(value: string): PromptKey | null {
8 const normalized = value.trim().toLowerCase()
9 return PROMPT_KEYS.includes(normalized as PromptKey) ? (normalized as PromptKey) : null
10}
11
12function getPromptByKey(prompts: RuntimePrompts, key: PromptKey): string {
13 switch (key) {

Callers 1

print.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected