Skip to content

Commit 6938488

Browse files
authored
Dev/ut (#205)
fix: 完善单测
1 parent 200cccd commit 6938488

File tree

3 files changed

+432
-170
lines changed

3 files changed

+432
-170
lines changed

index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2081,8 +2081,9 @@ declare class COS {
20812081

20822082
// 实例方法
20832083
/** 获取用户的 bucket 列表 @see https://cloud.tencent.com/document/product/436/8291 */
2084+
getService(callback: (err: COS.CosError, data: COS.GetServiceResult) => void): void;
20842085
getService(params: COS.GetServiceParams, callback: (err: COS.CosError, data: COS.GetServiceResult) => void): void;
2085-
getService(params: COS.GetServiceParams): Promise<COS.GetServiceResult>;
2086+
getService(params?: COS.GetServiceParams): Promise<COS.GetServiceResult>;
20862087

20872088
/** 创建 Bucket,并初始化访问权限 @see https://cloud.tencent.com/document/product/436/7738 */
20882089
putBucket(params: COS.PutBucketParams, callback: (err: COS.CosError, data: COS.PutBucketResult) => void): void;

sdk/base.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ var fs = require('fs');
1414
* @param {Function} callback 回调函数,必须
1515
*/
1616
function getService(params, callback) {
17-
if (typeof params === 'function') {
18-
callback = params;
19-
params = {};
20-
}
2117
var protocol = this.options.Protocol || (util.isBrowser && location.protocol === 'http:' ? 'http:' : 'https:');
2218
var domain = this.options.ServiceDomain;
2319
var appId = params.AppId || this.options.appId;

0 commit comments

Comments
 (0)