Use MailAPI.parseMailbox.  https://github.com/mozilla-b2g/gaia-email-libs-and-more/blob/master/data/lib/mailapi/mailapi.js#L3104

It's not immediately clear to me if it's possible for that logic to decide that something is a 'name' without an 'address'.  Might need to make sure there's an address.  Or not.  Worth investigating a teeny bit.  But you shouldn't be writing the logic in here.  It should be in MailAPI or addressparser.  (Note!  Our addressparser is likely somewhat out of date.  It might be appropriate to update to the whiteout-io version too if relevant: https://github.com/whiteout-io/addressparser/blob/master/src/addressparser.js)