<commit_before>import {_BaseCollection as BaseCollection} from './collection';

export default function aqlQuery(strings, ...args) {
  const bindVars = {};
  let query = strings[0];
  for (let i = 0; i < args.length; i++) {
    let value = args[i];
    let name = `value${i}`;
    if (
      value instanceof BaseCollection
      || (value.constructor && value.constructor.name === 'ArangoCollection')
    ) {
      name = `@${name}`;
      value = typeof value.name === 'function' ? value.name() : value.name;
    }
    bindVars[name] = value;
    query += `@${name}${strings[i + 1]}`;
  }
  return {query, bindVars};
}<commit_msg>aqlQuery should handle null/undefined<commit_after>import {_BaseCollection as BaseCollection} from './collection';

export default function aqlQuery(strings, ...args) {
  const bindVars = {};
  let query = strings[0];
  for (let i = 0; i < args.length; i++) {
    let value = args[i];
    let name = `value${i}`;
    if (
      value instanceof BaseCollection
      || (value && value.constructor && value.constructor.name === 'ArangoCollection')
    ) {
      name = `@${name}`;
      value = typeof value.name === 'function' ? value.name() : value.name;
    }
    bindVars[name] = value;
    query += `@${name}${strings[i + 1]}`;
  }
  return {query, bindVars};
}
{'fraction_non_alphanumeric': 0.17347725520431764, 'fraction_numerical': 0.004626060138781804, 'mean_word_length': 3.1736334405144695, 'pattern_counts': {'":': 0, '<': 5, '<?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': '607500', 'n_tokens_mistral': 414, 'n_tokens_neox': 418, 'n_words': 108}