MCPcopy Create free account
hub / github.com/buger/jsonparser / CompilePath

Function CompilePath

path_compiler.go:167–173  ·  view source on GitHub ↗

CompilePath parses jsonPath once for reuse. SYS-REQ-114

(jsonPath string)

Source from the content-addressed store, hash-verified

165// CompilePath parses jsonPath once for reuse.
166// SYS-REQ-114
167func CompilePath(jsonPath string) (CompiledPath, error) {
168 parts, err := ParsePath(jsonPath)
169 if err != nil {
170 return CompiledPath{}, err
171 }
172 return CompiledPath{parts: parts}, nil
173}
174
175// Get resolves the compiled path in data.
176// Verifies: SYS-REQ-001 (Get)

Calls 1

ParsePathFunction · 0.85

Tested by 6

TestCompilePathGetFunction · 0.68
TestCompilePathSetFunction · 0.68
TestCompilePathRoundTripFunction · 0.68
TestCompiledPathMethodsFunction · 0.68