ensureNewLineAtEnd(source) {
    if (source[source.length - 1] !== '\n') {
      source += '\n';
    }
    return source;
  }
@param {string} source A string
@return {string} Same string without a newline character at end