code: function asJson(entity, shallow) {
    let json;
  
    try {
      json = JSON.stringify(asObject(entity, shallow));
    } catch (error) {
      json = '';
    }
  
    return json;
  }
docs: Entity representation as json
  
  @param {Entity} entity
  @param {boolean} [shallow]
  
  @return {string}