Skip to content

Commit

Permalink
fix: option null issue
Browse files Browse the repository at this point in the history
  • Loading branch information
zslucky committed May 14, 2024
1 parent 7cd4164 commit 05200b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fantastic-utils/fetch",
"version": "0.2.0",
"version": "0.2.1",
"description": "fantastic modern fetch library which have rich features",
"main": "dist/umd/index.js",
"module": "dist/esm/index.mjs",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class Fetch {
};
}

get(url: string, opts: FetchOpts, respType: RESP_TYPE) {
get(url: string, opts: FetchOpts = {}, respType: RESP_TYPE) {
let nUrl = url;
if (opts.body) {
const params = opts.body;
Expand Down Expand Up @@ -194,7 +194,7 @@ class Fetch {
*
* @returns {Promise} The request promise
*/
fetch(url: string, options: FetchOpts, respType: RESP_TYPE) {
fetch(url: string, options: FetchOpts = {}, respType: RESP_TYPE) {
// const respContentType = respType || this.defaultRespType;
const opts = {
url,
Expand Down

0 comments on commit 05200b9

Please sign in to comment.