MCPcopy
hub / github.com/apache/casbin / JsonToMap

Function JsonToMap

util/util.go:29–36  ·  view source on GitHub ↗
(jsonStr string)

Source from the content-addressed store, hash-verified

27var escapeAssertionRegex = regexp.MustCompile(`([()\s|&,=!><+\-*/]|^)((r|p)[0-9]*)\.`)
28
29func JsonToMap(jsonStr string) (map[string]interface{}, error) {
30 result := make(map[string]interface{})
31 err := json.Unmarshal([]byte(jsonStr), &result)
32 if err != nil {
33 return result, err
34 }
35 return result, nil
36}
37
38// EscapeAssertion escapes the dots in the assertion, because the expression evaluation doesn't support such variable names.
39func EscapeAssertion(s string) string {

Callers 1

enforceMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…