How to use the @xmpp/xml.stringify function in @xmpp/xml

To help you get started, we’ve selected a few @xmpp/xml examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xmppjs / xmpp.js / packages / console / lib / Console.js View on Github external
beautify(frag) {
    let el
    if (typeof frag === 'string') {
      try {
        el = xml.parse(frag)
      } catch (err) {
        return frag
      }
    } else {
      el = frag
    }
    return xml.stringify(el, '  ')
  }