diff --git a/package.json b/package.json index 688730c..efe66c5 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "name": "@ztimson/js-utilities", - "version": "0.0.0", + "version": "0.1.0", "description": "JavaScript Utility library", "author": "Zak Timson", "license": "MIT", + "private": false, "repository": { "type": "git", "url": "https://git.zakscode.com/ztimson/js-utilities" diff --git a/src/xhr.ts b/src/xhr.ts index a8a2ae7..733e0cf 100644 --- a/src/xhr.ts +++ b/src/xhr.ts @@ -45,7 +45,7 @@ export class XHR { return fetch(`${this.baseUrl}${href || ''}`.replace(/([^:]\/)\/+/g, '$1'), { headers, method: opts.method || (body ? 'POST' : 'GET'), - body: (headers['Content-Type'].startsWith('application/json') && body) ? JSON.stringify(body) : body + body: (headers['Content-Type']?.startsWith('application/json') && body) ? JSON.stringify(body) : body }).then(async resp => { for(let fn of this.getInterceptors()) { const wait = new Promise(res =>