code: function split(path) {
      var res = [];
      var level = 0;
      var key = '';
  
      for (var i = 0; i < path.length; i++) {
        var c = path.substr(i, 1);
  
        if (level === 0 && (c === '.' || c === '[')) {
          if (c === '[') {
            level++;
            i++;
            c = path.substr(i, 1);
          }
  
          if (key) { // the first value could be a string
            res.push(key);
          }
          key = '';
          continue;
        }
  
        if (c === ']') {
          level--;
          key = key.slice(0, -1);
          continue;
        }
  
        key += c;
      }
  
      res.push(key);
  
      return res;
    }
docs: I'm not super keen on this private function, but it's because it'll also be use in the browser and I wont *one* function exposed