parseAndValidateContent = async function (objectArray, verbose, importResolver) {
  let fileIdToResourceMap = new Map()
  let allEmpty = true
  for (const object of objectArray) {    
    let fileContent = object.content
    if (object.content && object.content !== '') {
      if (object.id.toLowerCase().endsWith(fileExtEnum.LUFile)) {
        let result = await LuisBuilderVerbose.build([object], verbose, undefined, importResolver)
        let luisObj = new Luis(result)
        fileContent = luisObj.parseToLuContent()
      } else {
        let result = await qnaBuilderVerbose.build([object], verbose, importResolver)
        fileContent = result.parseToQnAContent()
      }
    }

    let resource = luParser.parse(fileContent)

    if (resource.Sections.filter(s => s.SectionType !== LUSectionTypes.MODELINFOSECTION).length > 0) allEmpty = false

    if (resource.Errors && resource.Errors.length > 0) {
      if (verbose) {
        var warns = resource.Errors.filter(error => (error && error.Severity && error.Severity === DiagnosticSeverity.WARN))
        if (warns.length > 0) {
          process.stdout.write(warns.map(warn => warn.toString()).join(NEWLINE).concat(NEWLINE))
        }
      }

      var errors = resource.Errors.filter(error => (error && error.Severity && error.Severity === DiagnosticSeverity.ERROR))
      if (errors.length > 0) {
        throw (new exception(retCode.errorCode.INVALID_INPUT_FILE, `Invlid file ${object.Id}: ${errors.map(error => error.toString()).join(NEWLINE)}`))
      }
    }

    fileIdToResourceMap.set(object.id, resource)
  }

  return {fileIdToResourceMap, allEmpty}
}
Parse and validate lu or qna object array to convert to LUResource object dict
@param {luObject[]} objectArray the lu or qna object list to be parsed
@param {boolean} verbose indicate to enable log messages or not
@param {any} importResolver import Resolver when resolving import files
@returns {Map<string, LUResource>} map of file id and luResource
@throws {exception} throws errors