-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.js
More file actions
47 lines (41 loc) · 742 Bytes
/
index.js
File metadata and controls
47 lines (41 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**!
* co-github - index.js
*
* MIT Licensed
*
* Authors:
* dead_horse <dead_horse@qq.com> (http://deadhorse.me)
*/
'use strict';
/**
* Module dependencies.
*/
var thunkify = require('thunkify');
var props = exports.props = [
'gists',
'gitdata',
'issues',
'authorization',
'orgs',
'statuses',
'pullRequests',
'repos',
'user' ,
'events',
'search',
'markdown',
];
module.exports = function (github) {
var coApis = {};
props.forEach(function (prop) {
var apis = github[prop] || {};
coApis[prop] = {};
for (var key in apis) {
coApis[prop][key] = thunkify(apis[key]);
}
});
coApis.authenticate = function (options) {
github.authenticate(options);
};
return coApis;
};