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

Function assertSafeRelativePath

apps/kimi-code/src/native/web-assets.ts:105–115  ·  view source on GitHub ↗
(relativePath: string)

Source from the content-addressed store, hash-verified

103}
104
105function assertSafeRelativePath(relativePath: string): void {
106 if (
107 relativePath.length === 0 ||
108 relativePath.startsWith('/') ||
109 relativePath.includes('\\') ||
110 relativePath.split('/').includes('..') ||
111 /^[A-Za-z]:/.test(relativePath)
112 ) {
113 throw new Error(`Invalid web asset relative path: ${relativePath}`);
114 }
115}
116
117export function webAssetManifestKey(target: string = currentTarget()): string {
118 return buildWebManifestKey(target);

Callers 1

getNativeWebAssetsDirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected