<commit_before>'use strict';

var assign = require('lodash.assign');
var ResultList = require('./result-list');

var _internal = {
  page: 1,
  per_page: 20,
  safesearch: true,
  url: 'https://pixabay.com/api'
};

var pixabayjs = {
  _auth: {},

  defaults: {},

  authenticate: function(username, key) {
    this._auth.username = username;
    this._auth.key = key;
  },

  resultList: function(search, options, onSuccess, onFailure) {
    var config = assign({}, _internal, this.defaults, this._auth, options);
    return new ResultList(search, config, onSuccess, onFailure);
  }
};

module.exports = pixabayjs;<commit_msg>rename _internal to requiredDefaults for clarity of purpose<commit_after>'use strict';

var assign = require('lodash.assign');
var ResultList = require('./result-list');

var requiredDefaults = {
  page: 1,
  per_page: 20,
  safesearch: true,
  url: 'https://pixabay.com/api'
};

var pixabayjs = {
  _auth: {},

  defaults: {},

  authenticate: function(username, key) {
    this._auth.username = username;
    this._auth.key = key;
  },

  resultList: function(search, opts, onSuccess, onFailure) {
    var config = assign({}, requiredDefaults, this.defaults, this._auth, opts);
    return new ResultList(search, config, onSuccess, onFailure);
  }
};

module.exports = pixabayjs;
{'fraction_non_alphanumeric': 0.14701378254211334, 'fraction_numerical': 0.004594180704441042, 'mean_word_length': 4.10546875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2072570', 'n_tokens_mistral': 447, 'n_tokens_neox': 425, 'n_words': 104}