api/transaction/settings.js
function setTransactionIntFlags(transaction, input, flags) {
  for (var flagName in flags) {
    var flag = flags[flagName];

    if (!input.hasOwnProperty(flag.name)) {
      continue;
    }

    var value = input[flag.name];

    if (value) {
      transaction.tx_json.SetFlag = flag.value;
    } else {
      transaction.tx_json.ClearFlag = flag.value;
    }
  }
}
function setTransactionIntFlags(transaction, input, flags) {
  for (var flagName in flags) {
    var flag = flags[flagName];

    if (!input.hasOwnProperty(flag.name)) {
      continue;
    }

    var value = input[flag.name];

    if (value) {
      transaction.tx_json.SetFlag = flag.value;
    } else {
      transaction.tx_json.ClearFlag = flag.value;
    }
  }
}
function setTransactionIntFlags ( transaction , input , flags ) { for ( var flagName in flags ) { var flag = flags [ flagName ] ; if ( ! input . hasOwnProperty ( flag . name ) ) { continue ; } var value = input [ flag . name ] ; if ( value ) { transaction . tx_json . SetFlag = flag . value ; } else { transaction . tx_json . ClearFlag = flag . value ; } } }
Set integer flags on a transaction based on input and a flag map

@param {Transaction} transaction
@param {Object} input - Object whose properties determine whether
to update the transaction's SetFlag or ClearFlag property
@param {Object} flags - Object that maps property names to transaction
integer flag values

@returns undefined
Set integer flags on a transaction based on input and a flag map