更新版本至 0.0.35,优化 fetchFile 方法以支持额外选项
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@kevisual/api",
|
||||
"version": "0.0.34",
|
||||
"version": "0.0.35",
|
||||
"description": "",
|
||||
"main": "mod.ts",
|
||||
"scripts": {
|
||||
|
||||
@@ -60,7 +60,7 @@ export class QueryResources {
|
||||
}
|
||||
async fetchFile(filepath: string, opts?: DataOpts): Promise<Result<any>> {
|
||||
const url = `${this.prefix}${filepath}`;
|
||||
return this.get({}, { url, method: 'GET', headers: this.header(opts?.headers, false), isText: true });
|
||||
return this.get({}, { url, method: 'GET', ...opts, headers: this.header(opts?.headers, false), isText: true });
|
||||
}
|
||||
async uploadFile(filepath: string, content: string | Blob, opts?: DataOpts): Promise<Result<any>> {
|
||||
const pathname = `${this.prefix}${filepath}`;
|
||||
|
||||
Reference in New Issue
Block a user