<commit_before>var exec = require('cordova/exec')

var FileTransferManager = function (options) {
  this._handlers = {
    event: []
  }
  this.options = options
  var that = this
  this.options.callback = function (result) {
    that.emit('event', result)
  }
  if (!this.options.parallelUploadsLimit) {
    this.options.parallelUploadsLimit = 1
  }
  exec(this.options.callback, null, 'FileTransferBackground', 'initManager', [this.options])
}

FileTransferManager.prototype.startUpload = function (payload) {
  if (!payload) {
    return this.options.callback({ error: 'upload settings object is missing or invalid argument' })
  }

  if (!payload.id) {
    return this.options.callback({ error: 'upload id is required' })
  }

  if (!payload.serverUrl) {
    return this.options.callback({ id: payload.id, error: 'server url is required' })
  }

  if (payload.serverUrl.trim() === '') {
    return this.options.callback({ id: payload.id, error: 'invalid server url' })
  }

  if (!payload.filePath) {
    if (payload.file) {
      payload.filePath = payload.file
    } else {
      return this.options.callback({ id: payload.id, error: 'filePath is required' })
    }
  }

  if (!payload.fileKey) {
    payload.fileKey = 'file'
  }

  if (payload.showNotification == null) {
    payload.showNotification = true<commit_msg>check for show notification undefined<commit_after>var exec = require('cordova/exec')

var FileTransferManager = function (options) {
  this._handlers = {
    event: []
  }
  this.options = options
  var that = this
  this.options.callback = function (result) {
    that.emit('event', result)
  }
  if (!this.options.parallelUploadsLimit) {
    this.options.parallelUploadsLimit = 1
  }
  exec(this.options.callback, null, 'FileTransferBackground', 'initManager', [this.options])
}

FileTransferManager.prototype.startUpload = function (payload) {
  if (!payload) {
    return this.options.callback({ error: 'upload settings object is missing or invalid argument' })
  }

  if (!payload.id) {
    return this.options.callback({ error: 'upload id is required' })
  }

  if (!payload.serverUrl) {
    return this.options.callback({ id: payload.id, error: 'server url is required' })
  }

  if (payload.serverUrl.trim() === '') {
    return this.options.callback({ id: payload.id, error: 'invalid server url' })
  }

  if (!payload.filePath) {
    if (payload.file) {
      payload.filePath = payload.file
    } else {
      return this.options.callback({ id: payload.id, error: 'filePath is required' })
    }
  }

  if (!payload.fileKey) {
    payload.fileKey = 'file'
  }

  if (payload.showNotification === null || payload.showNotification === undefined) {
    payload.showNotification = true
{'fraction_non_alphanumeric': 0.13938948142699523, 'fraction_numerical': 0.000735564545788893, 'mean_word_length': 3.533333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1432683', 'n_tokens_mistral': 834, 'n_tokens_neox': 819, 'n_words': 201}