lib/rssiSignature.js
function merge(source, destination) {
  source.forEach(function(current) {
    let matchFound = false;
    destination.forEach(function(target) {
      let isSameReceiver = identifiers.areMatch(current.receiverId,
                                                current.receiverIdType,
                                                target.receiverId,
                                                target.receiverIdType);
      if(isSameReceiver) {
        target.rssiSum = target.rssiSum ||
                         (target.rssi * target.numberOfDecodings);
        target.numberOfDecodings += current.numberOfDecodings || 1;
        target.rssiSum += current.rssiSum ||
                          (current.rssi * current.numberOfDecodings);
        target.rssi = Math.round(target.rssiSum / target.numberOfDecodings);
        matchFound = true;
      }
    });
    if(!matchFound) {
      destination.push(current);
    }
  });
  destination.sort(compareRssi);
}
function merge(source, destination) {
  source.forEach(function(current) {
    let matchFound = false;
    destination.forEach(function(target) {
      let isSameReceiver = identifiers.areMatch(current.receiverId,
                                                current.receiverIdType,
                                                target.receiverId,
                                                target.receiverIdType);
      if(isSameReceiver) {
        target.rssiSum = target.rssiSum ||
                         (target.rssi * target.numberOfDecodings);
        target.numberOfDecodings += current.numberOfDecodings || 1;
        target.rssiSum += current.rssiSum ||
                          (current.rssi * current.numberOfDecodings);
        target.rssi = Math.round(target.rssiSum / target.numberOfDecodings);
        matchFound = true;
      }
    });
    if(!matchFound) {
      destination.push(current);
    }
  });
  destination.sort(compareRssi);
}
function merge ( source , destination ) { source . forEach ( function ( current ) { let matchFound = false ; destination . forEach ( function ( target ) { let isSameReceiver = identifiers . areMatch ( current . receiverId , current . receiverIdType , target . receiverId , target . receiverIdType ) ; if ( isSameReceiver ) { target . rssiSum = target . rssiSum || ( target . rssi * target . numberOfDecodings ) ; target . numberOfDecodings += current . numberOfDecodings || 1 ; target . rssiSum += current . rssiSum || ( current . rssi * current . numberOfDecodings ) ; target . rssi = Math . round ( target . rssiSum / target . numberOfDecodings ) ; matchFound = true ; } } ) ; if ( ! matchFound ) { destination . push ( current ) ; } } ) ; destination . sort ( compareRssi ) ; }
Merge the source rssiSignature into the destination rssiSignature.
@param {Array} source The source rssiSignature.
@param {Array} destination The destination rssiSignature.
Merge the source rssiSignature into the destination rssiSignature .