lib/sources.js
function updateInfo(info, override, source, sourceId) {
  if (source) {
    if (source.minzoom !== undefined) {
      // eslint-disable-next-line no-param-reassign
      info.minzoom = source.minzoom;
    }
    if (source.maxzoom !== undefined) {
      // eslint-disable-next-line no-param-reassign
      info.maxzoom = source.maxzoom;
    }
  }
  if (sourceId !== undefined) {
    // eslint-disable-next-line no-param-reassign
    info.name = sourceId;
  }
  if (override) {
    _.each(override, (v, k) => {
      if (v === null) {
        // When override.key == null, delete that key
        // eslint-disable-next-line no-param-reassign
        delete info[k];
      } else {
        // override info of the parent
        // eslint-disable-next-line no-param-reassign
        info[k] = v;
      }
    });
  }
}
function updateInfo(info, override, source, sourceId) {
  if (source) {
    if (source.minzoom !== undefined) {
      // eslint-disable-next-line no-param-reassign
      info.minzoom = source.minzoom;
    }
    if (source.maxzoom !== undefined) {
      // eslint-disable-next-line no-param-reassign
      info.maxzoom = source.maxzoom;
    }
  }
  if (sourceId !== undefined) {
    // eslint-disable-next-line no-param-reassign
    info.name = sourceId;
  }
  if (override) {
    _.each(override, (v, k) => {
      if (v === null) {
        // When override.key == null, delete that key
        // eslint-disable-next-line no-param-reassign
        delete info[k];
      } else {
        // override info of the parent
        // eslint-disable-next-line no-param-reassign
        info[k] = v;
      }
    });
  }
}
function updateInfo ( info , override , source , sourceId ) { if ( source ) { if ( source . minzoom !== undefined ) { // eslint-disable-next-line no-param-reassign info . minzoom = source . minzoom ; } if ( source . maxzoom !== undefined ) { // eslint-disable-next-line no-param-reassign info . maxzoom = source . maxzoom ; } } if ( sourceId !== undefined ) { // eslint-disable-next-line no-param-reassign info . name = sourceId ; } if ( override ) { _ . each ( override , ( v , k ) => { if ( v === null ) { // When override.key == null, delete that key // eslint-disable-next-line no-param-reassign delete info [ k ] ; } else { // override info of the parent // eslint-disable-next-line no-param-reassign info [ k ] = v ; } } ) ; } }
Override top-level values in the info object with the ones
from override object, or delete on null
@param {object} info
@param {object} override
@param {object} [source] if given, sets min/max zoom
@param {string} [sourceId]
Override top - level values in the info object with the ones from override object or delete on null