code: function getEventSourceMapping(functionName, streamName, context) {
    const params = {FunctionName: functionName};
    const desc = `event source mapping between function (${functionName}) & stream (${streamName})`;
  
    return lambdaUtils.listEventSourceMappings(context.lambda, params, context).then(
      result => {
        const mappings = result.EventSourceMappings;
        const mapping = mappings.find(m => m.EventSourceArn.indexOf(streamName) !== -1);
        if (mapping) {
          if (context.traceEnabled) context.trace(`Found ${desc} - mapping: ${JSON.stringify(mapping)}`);
        } else {
          context.error(`Failed to find ${desc} - existing mappings: ${JSON.stringify(mappings)}`);
        }
        return mapping;
      },
      err => {
        context.error(`Failed to find ${desc}`, err);
        throw err;
      }
    );
  }
docs: Attempts to find the event source mapping between the named Lambda function and the named Kinesis/DynamoDB stream.
  @param {string} functionName - the invoked name of the Lambda function (including alias if applicable)
  @param {string} streamName - the name of the Kinesis or DynamoDB stream
  @param {LambdaAware|StreamConsumerContext} context
  @returns {Promise.<EventSourceMapping|undefined>}