jsonString is the shorthand used by atomic-tool plugins (@read, @search, @tree, @todo, …) that own the parsed JSON object directly. Tries each alias in order and returns the first non-empty string value. Numbers/booleans/null are ignored — atomic-tool string fields (file, term, dir, …) must be strin
(raw map[string]json.RawMessage, keys ...string)
| 91 | // value. Numbers/booleans/null are ignored — atomic-tool string fields |
| 92 | // (file, term, dir, …) must be strings, never coerced. |
| 93 | func jsonString(raw map[string]json.RawMessage, keys ...string) string { |
| 94 | return stringFromMap(raw, keys) |
| 95 | } |
| 96 | |
| 97 | // jsonInt mirrors jsonString for integer fields. Tries each alias, |
| 98 | // returns the first parseable int. Strings that contain a valid int |