更新版本至 0.0.35,优化 fetchFile 方法以支持额外选项

This commit is contained in:
2026-01-30 17:14:31 +08:00
parent e2b7d62693
commit 6ee39d2028
2 changed files with 2 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@kevisual/api",
"version": "0.0.34",
"version": "0.0.35",
"description": "",
"main": "mod.ts",
"scripts": {

View File

@@ -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}`;