message: Extract constants
diff: +
  export function toTitleCase (input: string) {
  let str = input.replace(/([^\W_]+[^\s-]*) */g, (txt) => {
  return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
  @@ -5,11 +6,7 @@ export function toTitleCase (input: string) {
  // Certain minor words should be left lowercase unless
  // they are the first or last words in the string
  - const lowers = [
  - 'A', 'An', 'The', 'And', 'But', 'Or', 'For', 'Nor', 'As', 'At',
  - 'By', 'For', 'From', 'In', 'Into', 'Near', 'Of', 'On', 'Onto', 'To', 'With'
  - ]
  - for (const lower of lowers) {
  + for (const lower of LOWER_CASE_WORDS) {
  str = str.replace(
  new RegExp(`\\s${lower}\\s`, 'g'),
  (txt) => txt.toLowerCase()
  @@ -17,8 +14,7 @@ export function toTitleCase (input: string) {
  }
  // Certain words such as initialisms or acronyms should be left uppercase
  - const uppers = ['Id', 'Tv']
  - for (const upper of uppers) {
  + for (const upper of UPPER_CASE_WORDS) {
  str = str.replace(
  new RegExp(`\\b${upper}\\b`, 'g'),
  upper.toUpperCase()
  @@ -27,3 +23,10 @@ export function toTitleCase (input: string) {
  return str
  }
  +
  +const LOWER_CASE_WORDS = [
  + 'A', 'An', 'The', 'And', 'But', 'Or', 'For', 'Nor', 'As', 'At',
  + 'By', 'For', 'From', 'In', 'Into', 'Near', 'Of', 'On', 'Onto', 'To', 'With'
  +]
  +
  +const UPPER_CASE_WORDS = ['Id', 'Tv']
  