Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit375863e

Browse files
committed
Add the options to the listTags function
1 parent52008ca commit375863e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

‎lib/Repository.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,12 @@ class Repository extends Requestable {
7878
/**
7979
* List the tags on a repository
8080
*@see https://developer.github.com/v3/repos/#list-tags
81+
*@param {Object} options - pagination for the list
8182
*@param {Requestable.callback} [cb] - will receive the tag data
8283
*@return {Promise} - the promise for the http request
8384
*/
84-
listTags(cb){
85-
returnthis._request('GET',`/repos/${this.__fullname}/tags`,null,cb);
85+
listTags(options,cb=options){
86+
returnthis._request('GET',`/repos/${this.__fullname}/tags`,options!=='function'&&options,cb);
8687
}
8788

8889
/**

‎test/repository.spec.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,11 @@ describe('Repository', function() {
459459
});
460460

461461
it('should list tags on repo',function(done){
462+
constoptions={
463+
per_page:30
464+
};
465+
466+
remoteRepo.listTags(options,assertSuccessful(done));
462467
remoteRepo.listTags(assertSuccessful(done));
463468
});
464469

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp