docs: function getMemberByPath(rec, paths) {
      var root = rec;
      var res = paths.reduce((prev, segment, index) => {
          debuglog(() => `at index ${index} segment ${segment} on ${JSON.stringify(prev)}`);
          if (prev === undefined || prev === null) {
              return undefined;
          }
          if (segment !== "[]") {
              return prev[segment];
          }
          else {
              if (index === (paths.length - 1)) {
                  return prev;
              }
              if (_.isArray(prev)) {
                  if (prev.length > 1) {
                      throw Error('cannot flatten more than one record ');
                  }
                  return prev[0];
              }
              else {
                  return prev;
              }
          }
      }, rec);
      debuglog(() => ` herer result ` + res);
      return res;
  }