diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..319e41e --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +strict-peer-dependencies=false diff --git a/package.json b/package.json index 05aac11..4fde13b 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "build": "cross-env NODE_ENV=production rollup -c", "postbuild": "npm run build:type", "build:type": "api-extractor run", - "postbuild:type": "rimraf \"dist/**/!(*.js?(.map)|index.d.ts)\"", + "postbuild:type": "rimraf \"dist/**/!(*.?(c|m)js?(.map)|index.d.ts)\" --glob", "analyzer": "cross-env NODE_ENV=production ANALYZER=true rollup -c", "dev": "cross-env NODE_ENV=development ts-node-dev src/index.ts", "dev:rollup": "cross-env NODE_ENV=development rollup -c", @@ -82,8 +82,8 @@ "lodash": "^4.17.21", "mocha": "^10.0.0", "module-alias": "^2.2.2", - "rimraf": "^4.0.4", - "rollup": "^2.67.2", + "rimraf": "^4.4.0", + "rollup": "^2.79.1", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-terser": "^7.0.2", "semantic-release": "^20.0.2", @@ -124,4 +124,4 @@ "git add" ] } -} +} \ No newline at end of file diff --git a/src/utils/ajax.ts b/src/utils/ajax.ts index 52ec149..10e5e69 100644 --- a/src/utils/ajax.ts +++ b/src/utils/ajax.ts @@ -9,7 +9,7 @@ interface AjaxConfig { query?: Record data?: Record | string | Buffer | ArrayBuffer method?: Method - headers?: AxiosRequestHeaders + headers?: Record baseURL?: string } @@ -25,7 +25,8 @@ interface AjaxConfig { export async function ajax(config: AjaxConfig): Promise> { try { Debugger('ajax config: %O', config) - const { url, query = {}, method = 'GET', headers = {}, baseURL = '' } = config + const { url, query = {}, method = 'GET', baseURL = '' } = config + const headers = (config.headers || {}) as AxiosRequestHeaders let { data = {} } = config if (headers['Content-Type'] === 'application/x-www-form-urlencoded' && typeof data === 'object') {