function findLayerInLayers(
  name,
  exactMatch,
  type,
  rootLayers,
  subLayersOnly,
  layersToExclude
) {
  let result = findLayersInLayers(
    name,
    exactMatch,
    type,
    rootLayers,
    subLayersOnly,
    layersToExclude
  )

  // return first layer in result
  if (result.length) return result[0]
}
Finds a single layer in a set of root layers.

@param {String} name
@param {Boolean} exactMatch
@param {String} type
@param {MSLayer} rootLayers
@param {Boolean} subLayersOnly
@param {Array} layersToExclude
@returns {array}