'use strict'

var parseString = require('xml2js').parseString
var Promise = require('promise')
var extend = require('extend-shallow')

exports.name = 'xml2js'
exports.outputFormat = 'json'

exports.renderAsync = function (str, options, locals) {
  return new Promise(function (resolve, reject) {
    var opts = extend({}, options, locals, {async: true})
    parseString(str, opts, function (err, result) {
      if (err) {
        reject(err)
      } else {
        resolve(JSON.stringify(result))
      }
    })
  })
}

@@ -7,19 +7,21 @@
 trict'%0A%0A
-var
+const
  parseSt
@@ -61,44 +61,13 @@
 ing%0A
-var Promise = require('promise')%0Avar
+const
  ext
@@ -231,25 +231,16 @@
 Promise(
-function 
 (resolve
@@ -252,18 +252,23 @@
 ect)
+ =%3E
  %7B%0A    
-var
+const
  opt
@@ -340,25 +340,16 @@
 r, opts,
- function
  (err, r
@@ -354,16 +354,19 @@
  result)
+ =%3E
  %7B%0A     

Update to ES6