function parseRequestInput(source, target) {
    let keys = Object.keys(source);
    if (keys.length === 1) {
      // Check if we have our main key as the full JSON
      let tmp = keys[0], shouldParse = false;
      tmp = tmp.trim();
      if (tmp.charAt(0) === '{') {
        for (let i = 0; i < Math.min(tmp.length, 100); i++) {
          if (tmp[i] === '"') {
            shouldParse = true;
            break;
          }
        }
        if (shouldParse) {
          try {
            source = JSON.parse(tmp);
            keys = Object.keys(source);
          } catch (e) {
            return;
          }
        }
      }
    }
    keys.forEach((name) => {
      if (name == null || typeof name === 'undefined') return;
      target[name] = source[name];
    });
  }
function parseRequestInput(source, target) {
    let keys = Object.keys(source);
    if (keys.length === 1) {
      
      let tmp = keys[0], shouldParse = false;
      tmp = tmp.trim();
      if (tmp.charAt(0) === '{') {
        for (let i = 0; i < Math.min(tmp.length, 100); i++) {
          if (tmp[i] === '"') {
            shouldParse = true;
            break;
          }
        }
        if (shouldParse) {
          try {
            source = JSON.parse(tmp);
            keys = Object.keys(source);
          } catch (e) {
            return;
          }
        }
      }
    }
    keys.forEach((name) => {
      if (name == null || typeof name === 'undefined') return;
      target[name] = source[name];
    });
  }
function parseRequestInput ( source , target ) { let keys = Object . keys ( source ) ; if ( keys . length === 1 ) { // Check if we have our main key as the full JSON let tmp = keys [ 0 ] , shouldParse = false ; tmp = tmp . trim ( ) ; if ( tmp . charAt ( 0 ) === '{' ) { for ( let i = 0 ; i < Math . min ( tmp . length , 100 ) ; i ++ ) { if ( tmp [ i ] === '"' ) { shouldParse = true ; break ; } } if ( shouldParse ) { try { source = JSON . parse ( tmp ) ; keys = Object . keys ( source ) ; } catch ( e ) { return ; } } } } keys . forEach ( ( name ) => { if ( name == null || typeof name === 'undefined' ) return ; target [ name ] = source [ name ] ; } ) ; }
/*
This will parse the incoming data to the intent input.
/ * This will parse the incoming data to the intent input .