title: defining a new function in nodejs throws reference error
body: <p>i have a .js file as follows:</p>
  
  <pre><code>module.exports = {
      metadata: () =&gt; ({
          "name": "HrScheduleApi",
          "properties": {
               "scheduleDate": {"type": "string", "required": false}
          }
      }),
      invoke: (conversation, done) =&gt; {
          var actionType = conversation.properties().actionType;
          logger.info("start of HrScheduleApi with action type:" + actionType);
  
         if(isBeyondThreeDays(scheduleDate)  == false){
                  dayFromNow = '2 days from now';
                  var tomorrow = new Date(new Date().getTime() + 48 * 60 * 60 * 1000);
                  schDate = tomorrow.toDateString();
               }else{
                   console.log('asked schedule is beyond 48 hours');
               }
      }, 
      isBeyondThreeDays: (scheduleDate) =&gt; {
          // ...
      }
  };
  </code></pre>
  
  <p>so when i needed a new function (isBeyondThreeDays) in my invoke function i just defined as below. but seems nodejs does not like it. I get the error
  at run time as:</p>
  
  <pre><code>Error in component, details={}
  ReferenceError: isBeyondThreeDays is not defined
  </code></pre>