<commit_before>var _ = require('lodash-node/modern');
var mongoose = require('mongoose');

var defaultOptions = {
  path: 'votes',
  model: undefined
};

module.exports = function votePlugin(schema, options) {
  options = _.merge({}, defaultOptions, options || {});

  if (!schema.path(options.path)) {
    schema.path(options.path,
      options.model ?
        [{
          type: mongoose.Schema.Types.ObjectId,
          ref: options.model
        }] :
        []
    );
  }<commit_msg>style: simplify options config<commit_after>var _ = require('lodash-node/modern');
var mongoose = require('mongoose');

module.exports = function votePlugin(schema, options) {
  options = _.merge({
    path: 'votes',
    model: undefined
  }, options || {});

  if (!schema.path(options.path)) {
    schema.path(options.path,
      options.model ?
        [{
          type: mongoose.Schema.Types.ObjectId,
          ref: options.model
        }] :
        []
    );
  }
{'fraction_non_alphanumeric': 0.1543274244004171, 'fraction_numerical': 0.0, 'mean_word_length': 2.66412213740458, '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': '7329937', 'n_tokens_mistral': 300, 'n_tokens_neox': 295, 'n_words': 54}