Skip to content

Commit ed30fd3

Browse files
committed
fix: allow no instanceConfig and use {}
1 parent 7c6990b commit ed30fd3

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/core/src/core/Un.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { describe, expect, it } from "vitest";
2+
import { Un } from "./Un";
3+
4+
describe("Axios", () => {
5+
it("should not throw if the config argument is omitted", () => {
6+
const un = new Un();
7+
8+
expect(un.defaults).toStrictEqual({});
9+
});
10+
});

packages/core/src/core/Un.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class Un<T = UnData, D = UnData> {
1515
response: UnInterceptorManager<UnResponse<T, D>, T, D>;
1616
};
1717

18-
constructor(instanceConfig: UnConfig<T, D>) {
18+
constructor(instanceConfig?: UnConfig<T, D>) {
1919
this.defaults = instanceConfig || {};
2020
this.interceptors = {
2121
request: new UnInterceptorManager(),

0 commit comments

Comments
 (0)