Function: majutsu-gerrit--account-transform

majutsu-gerrit--account-transform is a natively compiled function defined in majutsu-gerrit.el.

Signature

(majutsu-gerrit--account-transform OUTPUTS)

Documentation

Parse Gerrit JSON OUTPUTS into account candidate strings.

OUTPUTS is a list of raw strings emitted by the curl process.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-gerrit.el
(defun majutsu-gerrit--account-transform (outputs)
  "Parse Gerrit JSON OUTPUTS into account candidate strings.
OUTPUTS is a list of raw strings emitted by the curl process."
  (mapcan
   (lambda (output)
     (when (and (stringp output) (not (string-empty-p output))
                (or (string-prefix-p "[" output)
                    (string-prefix-p ")]}'" output)))
       (let* ((body (string-trim (majutsu-gerrit-rest--strip-xssi output)))
              (accounts (condition-case nil
                            (json-parse-string body
                                               :object-type 'alist
                                               :array-type 'list
                                               :null-object nil
                                               :false-object nil)
                          (error nil))))
         (delq nil
               (mapcar (lambda (account)
                         (when-let* ((candidate (majutsu-gerrit--account-candidate account)))
                           (put-text-property 0 (length candidate)
                                              'majutsu-gerrit-account account candidate)
                           candidate))
                       accounts)))))
   outputs))