MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / optionalEnvValue

Function optionalEnvValue

apps/kimi-code/src/native/native-assets.ts:100–103  ·  view source on GitHub ↗
(env: NodeJS.ProcessEnv, key: string)

Source from the content-addressed store, hash-verified

98}
99
100function optionalEnvValue(env: NodeJS.ProcessEnv, key: string): string | null {
101 const value = env[key];
102 return typeof value === 'string' && value.length > 0 ? value : null;
103}
104
105function sanitizeSegment(value: string): string {
106 const sanitized = value.replaceAll(/[^a-zA-Z0-9._-]/g, '_');

Callers 1

getNativeCacheBaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected