dmcquay/node-apac

Callback in readme uses undefined 'results' variable?

cheesepencil opened this issue · 1 comments

Shouldn't the console.log statement in the readme example code be console.log(parsed) instead of console.log(results) ? Wouldn't results be undefined in this context?

opHelper.execute('ItemSearch', {
  'SearchIndex': 'Books',
  'Keywords': 'harry potter',
  'ResponseGroup': 'ItemAttributes,Offers'
}, function(parsed) {
    console.log(results);
});

node-apac/examples/example-item-search.js uses the same variable for the console statement and the parameter in that callback:

opHelper.execute('ItemSearch', {
  'SearchIndex': 'Books',
  'Keywords': 'harry potter',
  'ResponseGroup': 'ItemAttributes,Offers'
}, function(results) {
        console.log(results);
});

Is it safe to assume node-apac/examples/example-item-search.js is correct and the readme is in error?

Yes, the readme is indeed a typo. I've now fixed it. Sorry about that!