lib/index.js
function _parseWithXml2js(xmlContent) {
  return new Promise(function(resolve, reject) {
    // parse the pom, erasing all
    xml2js.parseString(xmlContent, XML2JS_OPTS, function(err, pomObject) {
      if (err) {
        // Reject with the error
        reject(err);
      }

      // Replace the arrays with single elements with strings
      removeSingleArrays(pomObject);

      // Response to the call
      resolve({
        pomXml: xmlContent, // Only add the pomXml when loaded from the file-system.
        pomObject: pomObject // Always add the object
      });
    });
  });
}
function _parseWithXml2js(xmlContent) {
  return new Promise(function(resolve, reject) {
    // parse the pom, erasing all
    xml2js.parseString(xmlContent, XML2JS_OPTS, function(err, pomObject) {
      if (err) {
        // Reject with the error
        reject(err);
      }

      // Replace the arrays with single elements with strings
      removeSingleArrays(pomObject);

      // Response to the call
      resolve({
        pomXml: xmlContent, // Only add the pomXml when loaded from the file-system.
        pomObject: pomObject // Always add the object
      });
    });
  });
}
function _parseWithXml2js ( xmlContent ) { return new Promise ( function ( resolve , reject ) { // parse the pom, erasing all xml2js . parseString ( xmlContent , XML2JS_OPTS , function ( err , pomObject ) { if ( err ) { // Reject with the error reject ( err ) ; } // Replace the arrays with single elements with strings removeSingleArrays ( pomObject ) ; // Response to the call resolve ( { pomXml : xmlContent , // Only add the pomXml when loaded from the file-system. pomObject : pomObject // Always add the object } ) ; } ) ; } ) ; }
Parses the given xml content.
@param xmlContent {string} Is the xml content in string using utf-8 format.
@param loadedXml {boolean} Whether the xml was loaded from the file-system.
@param callback {function} The callback function using Javascript PCS.
Parses the given xml content .