function stringify (value) {
  const text = String(value)
  let escaped = ''
  let i = 0
  while (i < text.length) {
    const c = text.charAt(i)
    escaped += (c in controlCharacters) ? controlCharacters[c] : c
    i++
  }

  return '"' + escaped + '"'
}
Stringify a value into a string enclosed in double quotes.
Unescaped double quotes and backslashes inside the value are escaped.
@param {*} value
@return {string}