Skip to content

Commit

Permalink
config merge
Browse files Browse the repository at this point in the history
  • Loading branch information
superAlibi committed Sep 17, 2024
1 parent ba41caf commit 99c14ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@advanced/fetcher",
"version": "1.0.6",
"version": "1.0.7",
"exports": "./mod.ts",
"license": "MIT",
"publish": {
Expand Down
5 changes: 3 additions & 2 deletions libs/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ export class Fetcher extends SyncEventDispatcher<{
}> {
constructor(
public baseURL: string,
public config: FetherConfig = defaultConfig,
public config: FetherConfig,

) {
super();
this.config = deepMerge(defaultConfig, config)
}
/**
* 拼接基本路径和业务逻辑
Expand Down Expand Up @@ -194,7 +196,6 @@ export class Fetcher extends SyncEventDispatcher<{
url: string,
options: FetherConfig = {},
): Promise<T> {
console.log(url);

return this.request<T>(url, {
...this.config,
Expand Down

0 comments on commit 99c14ad

Please sign in to comment.