diff --git a/lib/index.js b/lib/index.js index 17fcab8..3f20b96 100644 --- a/lib/index.js +++ b/lib/index.js @@ -188,7 +188,7 @@ var generateAdvancedMappings = function(mappingFunctions) { return cb(new Error('Argument error in getDocumentById: the first argument must be a numeric id')); } - if(typeof(config) === 'function') { + if(isFunction(config)) { config = config(); } if (!config.file) { diff --git a/sample.js b/sample.js index fc662fa..c068c89 100644 --- a/sample.js +++ b/sample.js @@ -11,7 +11,7 @@ Anyfetch.getAccessToken(APP_ID, APP_SECRET, code, function(err, accessToken) { client.getSubcompanyById(123, cb); - client.postUsers({ endpoint: 'rere' }, cb ); + client.postUser({ name: 'Rick' }, cb ); client.updateCompany(cbErr); client.resetCompany(cbErr);