function stringifyPath (path) {
  return path
    .map(p => {
      if (typeof p === 'number') {
        return ('[' + p + ']')
      } else if (typeof p === 'string' && p.match(/^[A-Za-z0-9_$]+$/)) {
        return '.' + p
      } else {
        return '["' + p + '"]'
      }
    })
    .join('')
}
Stringify an array with a path in a JSON path like '.items[3].name'
@param {Array.<string | number>} path
@returns {string}