api-lambdas.js
function configureHandlerContext(createContext, createSettings, createOptions, event, awsContext) {
  // Configure the context as a standard context
  let context = typeof createContext === 'function' ? createContext() :
    createContext && typeof createContext === 'object' ? copy(createContext, deep) : {};
  if (!context) context = {};

  const settings = typeof createSettings === 'function' ? copy(createSettings(), deep) :
    createSettings && typeof createSettings === 'object' ? copy(createSettings, deep) : undefined;

  const options = typeof createOptions === 'function' ? copy(createOptions(), deep) :
    createOptions && typeof createOptions === 'object' ? copy(createOptions, deep) : undefined;

  // Configure the context as a standard context
  contexts.configureStandardContext(context, settings, options, event, awsContext, false);

  // Merge the handler options into the handler settings and finally merge their result into context.handler
  const handlerOptions = (options && options.handler) || {};
  const handlerSettings = settings && settings.handler ?
    mergeHandlerOpts(handlerOptions, settings.handler) : handlerOptions;
  context.handler = context.handler ? mergeHandlerOpts(handlerSettings, context.handler) : handlerSettings;

  return context;
}
function configureHandlerContext(createContext, createSettings, createOptions, event, awsContext) {
  // Configure the context as a standard context
  let context = typeof createContext === 'function' ? createContext() :
    createContext && typeof createContext === 'object' ? copy(createContext, deep) : {};
  if (!context) context = {};

  const settings = typeof createSettings === 'function' ? copy(createSettings(), deep) :
    createSettings && typeof createSettings === 'object' ? copy(createSettings, deep) : undefined;

  const options = typeof createOptions === 'function' ? copy(createOptions(), deep) :
    createOptions && typeof createOptions === 'object' ? copy(createOptions, deep) : undefined;

  // Configure the context as a standard context
  contexts.configureStandardContext(context, settings, options, event, awsContext, false);

  // Merge the handler options into the handler settings and finally merge their result into context.handler
  const handlerOptions = (options && options.handler) || {};
  const handlerSettings = settings && settings.handler ?
    mergeHandlerOpts(handlerOptions, settings.handler) : handlerOptions;
  context.handler = context.handler ? mergeHandlerOpts(handlerSettings, context.handler) : handlerSettings;

  return context;
}
function configureHandlerContext ( createContext , createSettings , createOptions , event , awsContext ) { // Configure the context as a standard context let context = typeof createContext === 'function' ? createContext ( ) : createContext && typeof createContext === 'object' ? copy ( createContext , deep ) : { } ; if ( ! context ) context = { } ; const settings = typeof createSettings === 'function' ? copy ( createSettings ( ) , deep ) : createSettings && typeof createSettings === 'object' ? copy ( createSettings , deep ) : undefined ; const options = typeof createOptions === 'function' ? copy ( createOptions ( ) , deep ) : createOptions && typeof createOptions === 'object' ? copy ( createOptions , deep ) : undefined ; // Configure the context as a standard context contexts . configureStandardContext ( context , settings , options , event , awsContext , false ) ; // Merge the handler options into the handler settings and finally merge their result into context.handler const handlerOptions = ( options && options . handler ) || { } ; const handlerSettings = settings && settings . handler ? mergeHandlerOpts ( handlerOptions , settings . handler ) : handlerOptions ; context . handler = context . handler ? mergeHandlerOpts ( handlerSettings , context . handler ) : handlerSettings ; return context ; }
Configures a standard handler context to use.
@param {(function(): (Object|HandlerContext))|undefined|Object|HandlerContext} [createContext] - an optional function
that will be used to create the initial context to be configured & used (OR or an optional LEGACY module-scope
context from which to copy an initial standard context)
@param {(function(): (Object|HandlerSettings))|undefined|Object|HandlerSettings} [createSettings] - an optional
function that will be used to create the initial standard settings to use (OR optional LEGACY module-scoped
settings from which to copy initial settings to use)
@param {(function(): (Object|HandlerOptions))|undefined|Object|HandlerOptions} [createOptions] -  an optional
function that will be used to create the initial standard options to use (OR optional LEGACY module-scoped
options from which to copy initial options to use)
@param {Object} event - the AWS event passed to your handler
@param {Object} awsContext - the AWS context passed to your handler
@return {StandardHandlerContext} the handler context to use
Configures a standard handler context to use .