File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,23 @@ class User extends Requestable {
132132 return this . _requestAllPages ( this . __getScopedUrl ( 'starred' ) , requestOptions , cb ) ;
133133 }
134134
135+ /**
136+ * Gets the list of starred gists for the user
137+ * @see https://developer.github.com/v3/gists/#list-starred-gists
138+ * @param {Object } [options={}] - any options to refine the search
139+ * @param {Requestable.callback } [cb] - will receive the list of gists
140+ * @return {Promise } - the promise for the http request
141+ */
142+ listStarredGists ( options , cb ) {
143+ options = options || { } ;
144+ if ( typeof options === 'function' ) {
145+ cb = options ;
146+ options = { } ;
147+ }
148+ options . since = this . _dateToISO ( options . since ) ;
149+ return this . _request ( 'GET' , '/gists/starred' , options , cb ) ;
150+ }
151+
135152 /**
136153 * List email addresses for a user
137154 * @see https://developer.github.com/v3/users/emails/#list-email-addresses-for-a-user
Original file line number Diff line number Diff line change @@ -61,6 +61,13 @@ describe('User', function() {
6161 user . listStarredRepos ( assertArray ( done ) ) ;
6262 } ) ;
6363
64+ it ( 'should show user\'s starred gists' , function ( done ) {
65+ const option = {
66+ since : '2015-01-01T00:00:00Z' ,
67+ } ;
68+ user . listStarredGists ( option , assertArray ( done ) ) ;
69+ } ) ;
70+
6471 it ( 'should follow user' , function ( done ) {
6572 user . follow ( 'ingalls' , assertSuccessful ( done ) ) ;
6673 } ) ;
You can’t perform that action at this time.
0 commit comments