Skip to content

Commit

Permalink
Dev/ut (#205)
Browse files Browse the repository at this point in the history
fix: 完善单测
  • Loading branch information
livehigh authored May 8, 2024
1 parent 200cccd commit 6938488
Show file tree
Hide file tree
Showing 3 changed files with 432 additions and 170 deletions.
3 changes: 2 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2081,8 +2081,9 @@ declare class COS {

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

/** 创建 Bucket,并初始化访问权限 @see https://cloud.tencent.com/document/product/436/7738 */
putBucket(params: COS.PutBucketParams, callback: (err: COS.CosError, data: COS.PutBucketResult) => void): void;
Expand Down
4 changes: 0 additions & 4 deletions sdk/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ var fs = require('fs');
* @param {Function} callback 回调函数,必须
*/
function getService(params, callback) {
if (typeof params === 'function') {
callback = params;
params = {};
}
var protocol = this.options.Protocol || (util.isBrowser && location.protocol === 'http:' ? 'http:' : 'https:');
var domain = this.options.ServiceDomain;
var appId = params.AppId || this.options.appId;
Expand Down
Loading

0 comments on commit 6938488

Please sign in to comment.