API generation
This commit is contained in:
@ -49,7 +49,7 @@ function buildIndex (opts) {
|
|||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
}
|
}
|
||||||
|
|
||||||
return function index (params, options, callback) {
|
return function _index (params, options, callback) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
if (typeof options === 'function') {
|
if (typeof options === 'function') {
|
||||||
callback = options
|
callback = options
|
||||||
@ -63,7 +63,7 @@ function buildIndex (opts) {
|
|||||||
// promises support
|
// promises support
|
||||||
if (callback == null) {
|
if (callback == null) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
index(params, options, (err, body) => {
|
_index(params, options, (err, body) => {
|
||||||
err ? reject(err) : resolve(body)
|
err ? reject(err) : resolve(body)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user