code: function isAtStart(string, index) {
    const before = string.substring(0, index).trim();
  
    return before.length === 0 || before.search(/[({,]$/) !== -1;
  }
docs: -------------------------------------------------------------------------- Lots of elementary helpers --------------------------------------------------------------------------