MCPcopy Create free account
hub / github.com/astercloud/aster / isValidJsonPointer

Function isValidJsonPointer

ui/src/protocol/path-resolver.ts:47–57  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

45 * @returns 是否为有效的 JSON Pointer
46 */
47export function isValidJsonPointer(path: string): boolean {
48 if (typeof path !== 'string') {
49 return false;
50 }
51 // 空字符串表示整个文档
52 if (path === '') {
53 return true;
54 }
55 // 必须以 "/" 开头
56 return path.startsWith('/');
57}
58
59/**
60 * 解码 JSON Pointer 转义字符

Callers 10

parseJsonPointerFunction · 0.85
getDataFunction · 0.85
setDataFunction · 0.85
hasPathFunction · 0.85
deleteDataFunction · 0.85
addDataFunction · 0.85
getParentPathFunction · 0.85
getLastTokenFunction · 0.85
joinPathsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected