MCPcopy Index your code
hub / github.com/ent/ent / isJSONIdx

Function isJSONIdx

dialect/sql/sqljson/sqljson.go:694–699  ·  view source on GitHub ↗

isJSONIdx reports whether the string represents a JSON index.

(s string)

Source from the content-addressed store, hash-verified

692
693// isJSONIdx reports whether the string represents a JSON index.
694func isJSONIdx(s string) (string, bool) {
695 if len(s) > 2 && s[0] == '[' && s[len(s)-1] == ']' && (isNumber(s[1:len(s)-1]) || s[1] == '#' && isNumber(s[2:len(s)-1])) {
696 return s[1 : len(s)-1], true
697 }
698 return "", false
699}
700
701// isNumber reports whether the string is a number (category N).
702func isNumber(s string) bool {

Callers 3

mysqlPathMethod · 0.85
pgTextPathMethod · 0.85
pgArrayPathMethod · 0.85

Calls 1

isNumberFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…