wiseService/wiseSource.js
/**
   * Convert an encoded combined results binary buffer into JSON string
   *
   * @param {Buffer} results - The combined results from encode
   * @returns {string} - The JSON string
   */
Convert an encoded combined results binary buffer into JSON string
@param {Buffer} results - The combined results from encode
@returns {string} - The JSON string
Convert an encoded combined results binary buffer into JSON string @param { Buffer } results - The combined results from encode @returns { string } - The JSON string
static result2JSON (results) {
    const collection = [];
    let offset = 1;
    for (let i = 0; i < results[0]; i++) {
      const pos = results[offset];
      const len = results[offset + 1];
      const value = results.toString('utf8', offset + 2, offset + 2 + len - 1);
      offset += 2 + len;
      collection.push({ field: WISESource.pos2Field[pos], len: len - 1, value: value });
    }
    return JSON.stringify(collection).replace(/},{/g, '},\n{');
  }
static result2JSON ( results ) { const collection = [ ] ; let offset = 1 ; for ( let i = 0 ; i < results [ 0 ] ; i ++ ) { const pos = results [ offset ] ; const len = results [ offset + 1 ] ; const value = results . toString ( 'utf8' , offset + 2 , offset + 2 + len - 1 ) ; offset += 2 + len ; collection . push ( { field : WISESource . pos2Field [ pos ] , len : len - 1 , value : value } ) ; } return JSON . stringify ( collection ) . replace ( / },{ / g , '},\n{' ) ; }
Convert an encoded combined results binary buffer into JSON string
 @param {Buffer} results - The combined results from encode
 @returns {string} - The JSON string
Convert an encoded combined results binary buffer into JSON string @param { Buffer } results - The combined results from encode @returns { string } - The JSON string