/* eslint-disable camelcase
430774
function getEditorIDByMetaBrainzID(trx, metabrainzUserID) {
	return trx('bookbrainz.editor')
		.select('id')
		.where({metabrainz_user_id: metabrainzUserID})
		.then((rows) => {
			if (rows.length > 0) {
				return rows[0].id;
			}
			return null;
		});
}
414467
function camelCase(str) {
  if (str.indexOf('-') > -1) {
    str = str.replace(/-\w/g, function (letter) {
      return letter.substr(1).toUpperCase();
    });
  }

  return str;
}
967548
function normalize(options, templates) {
  // Options override defaults and toc methods.
  var result = _.defaults({}, options, toc, toc.defaults);
  // Remove "core" methods from result object.
  ['defaults', 'process', 'anchorize', 'toc'].forEach(function(prop) {
    delete result[prop];
  });
  // Compile Lodash string templates into functions.
  (templates || []).forEach(function(tmpl) {
    if (typeof result[tmpl] === 'string') {
      result[tmpl] = _.template(result[tmpl]);
    }
  });
  return result;
}
278993
function configureESLint(options) {
	const ESLintConfig = {
		rules: options.rules
	}

	ESLintConfig.extends = 'xo'
	if (options.esnext) {
		ESLintConfig.extends = 'xo/esnext'
	}

	if (!options.semicolon) {
		ESLintConfig.rules.semi = [2, 'never']
	}

	if (options.space === false) {
		ESLintConfig.rules.indent = [
			2, 'tab', {
				SwitchCase: 1
			}
		]
	} else {
		ESLintConfig.rules.indent = [
			2, parseInt(options.space, 10), {
				SwitchCase: 0
			}
		]
	}

	ESLintConfig.rules['valid-jsdoc'] = [0]
	ESLintConfig.rules['require-jsdoc'] = [0]

	console.debug(stripIndent`
		${clr.title}ESlint Options${clr.title.out}:
	`)
	if (console.canWrite(5)) {
		console.pretty(ESLintConfig, 2)
	}

	return () => new ESLint({
		baseConfig: ESLintConfig,
		fix: true,
		rules: options.rules
	})
}
440600
function camelCase(name) {
  return name.charAt(0).toUpperCase() +
    name.slice(1).replace(/-(\w)/g, (m, n) => {
      return n.toUpperCase();
    });
}
72688
function lowercaseContains(arr, elem) {
    return arr.map(function (arrElem) {
        return arrElem.toLowerCase();
    }).indexOf(elem) !== -1;
}
21790
function camelCase(str) {
    return str
        .replace(/[-_\s]+(.)/gu, (_, c) => c.toUpperCase())
        .replace(/^./u, c => c.toLowerCase())
}
1352334
function(str) {
    var camelized = Ember.String.camelize(str);
    return camelized.charAt(0).toUpperCase() + camelized.substr(1);
  }
757309
function _camelcase(flag) {
  return flag.split('-').reduce(function (str, word) {
    return str + word[0].toUpperCase() + word.slice(1);
  });
}
158866
function camelize(str) {
  return str.replace(/(?:^\w|[A-Z]|\b\w)/g, (letter, index) => {
    return index === 0 ? letter.toLowerCase() : letter.toUpperCase()
  }).replace(/[\s\-_]+/g, '')
}
779609
function camelcase(str) {
  if (!/[\s\W]/.test(str)) return str;
  if (str.length === 1) {
    return str.toLowerCase();
  }
  str = str.replace(/^[\W_]+|[\W_]+$/g, '').toLowerCase();
  return str.replace(/[\W_]+(\w|$)/g, function(_, ch) {
    return ch.toUpperCase();
  });
}
776371
function toCamelCase (str, upper) {
  str = str.toLowerCase().replace(/(?:(^.)|(\s+.)|(-.))/g, function (match) {
    return match.charAt(match.length - 1).toUpperCase()
  })
  if (upper) {
    return str
  }
  return str.charAt(0).toLowerCase() + str.substr(1)
}
1319612
function camelCaseToUnderscoreMap(columns) {
    var map = {};
    for (var i = 0; i < columns.length; i++)
        map[columns[i]] = toUnderscore(columns[i]);
    return map;
}
604624
function ( obj, key, value ) {
		key = string.toCamelCase( key );

		if ( value !== undefined ) {
			obj.style[key] = value;
			return obj;
		}
		else {
			return obj.style[key];
		}
	}
382076
function(data, convertCaseOptions) {

    let converted;

    if (_.isArray(data) || _.isPlainObject(data)) {
      converted = _.transform(data, (result, value, key) => {
        if (_.isArray(value) || _.isPlainObject(value)) {
          result[this._convertCase(key, convertCaseOptions)] = this._convertCase(value, convertCaseOptions);
        } else {
          result[this._convertCase(key, convertCaseOptions)] = value;
        }
      });
    } else {
      switch (convertCaseOptions) {
      case 'snake_case':
        converted = _.snakeCase(data);
        break;
      case 'kebab-case':
        converted = _.kebabCase(data);
        break;
      case 'camelCase':
        converted = _.camelCase(data);
        break;
      default:
        converted = data;
        break;
      }
    }

    return converted;
  }
1131201
function classCase(input) {
    return input.toUpperCase().replace(/[\-\s](.)/g, function(match, group1) {
        return group1.toUpperCase();
    });
}
770104
function camelCase(name: string): string {
  return name.replace(/([:\-_]+(.))/g, function(_, separator, letter, offset) {
    return offset ? letter.toUpperCase() : letter;
  });
}