<commit_before>'use strict'

const binding = process.atomBinding('in_app_purchase')
const v8Util = process.atomBinding('v8_util')

module.exports = {

  canMakePayments: function() {
    return binding.canMakePayments()
  },

  getReceiptURL: function() {
    return binding.getReceiptURL()
  },

  purchaseProduct: function(productID, quantity = 1, callback) {
    if (typeof productID !== 'string') {
      throw new TypeError('productID must be a string')
    }
    if (typeof quantity === 'function') {
      quantity = 1
      callback = quantity
    }
    return binding.purchaseProduct(productID, quantity, callback)
  },

  addTransactionListener: function(callback) {
    if (typeof callback !== 'function') {
      throw new TypeError('callback must be a function')
    }
    return binding.addTransactionListener(callback)
  }
}

                 // Mark standard asynchronous functions.
                 v8Util.setHiddenValue(
                     module.exports.purchaseProduct, 'asynchronous', true)
v8Util.setHiddenValue(
    module.exports.addTransactionListener, 'asynchronous', true)<commit_msg>Update code style<commit_after>'use strict'

const binding = process.atomBinding('in_app_purchase')
const v8Util = process.atomBinding('v8_util')

module.exports = {

  canMakePayments: function () {
    return binding.canMakePayments()
  },

  getReceiptURL: function () {
    return binding.getReceiptURL()
  },

  purchaseProduct: function (productID, quantity = 1, callback) {
    if (typeof productID !== 'string') {
      throw new TypeError('productID must be a string')
    }
    if (typeof quantity === 'function') {
      quantity = 1
      callback = quantity
    }
    return binding.purchaseProduct(productID, quantity, callback)
  },

  addTransactionListener: function (callback) {
    if (typeof callback !== 'function') {
      throw new TypeError('callback must be a function')
    }
    return binding.addTransactionListener(callback)
  }
}

// Mark standard asynchronous functions.
v8Util.setHiddenValue(
  module.exports.purchaseProduct, 'asynchronous', true)
v8Util.setHiddenValue(
  module.exports.addTransactionListener, 'asynchronous', true)
{'fraction_non_alphanumeric': 0.10922441486920606, 'fraction_numerical': 0.005507113354749885, 'mean_word_length': 3.6382978723404253, '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': '4894668', 'n_tokens_mistral': 626, 'n_tokens_neox': 604, 'n_words': 147}