@bbn/bbn 1.0.484 → 1.0.486

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/com.js CHANGED
@@ -50,7 +50,7 @@ const fetchRequest = (method, url, config = {}, aborter) => {
50
50
  headers: new Headers(config.headers || {}),
51
51
  signal: aborter === null || aborter === void 0 ? void 0 : aborter.signal,
52
52
  };
53
- const hasBody = methodsWithBody.includes(method);
53
+ const hasBody = methodsWithBody.includes(method.toUpperCase());
54
54
  if (config.data != null && hasBody) {
55
55
  // You can get fancier here (JSON, FormData, etc.)
56
56
  bbn.fn.log('DATA', config.data);
@@ -106,7 +106,7 @@ const fetchRequest = (method, url, config = {}, aborter) => {
106
106
  };
107
107
  const xhrRequest = (method, url, config = {}, aborter) => {
108
108
  const xhr = new XMLHttpRequest();
109
- const hasBody = methodsWithBody.includes(method);
109
+ const hasBody = methodsWithBody.includes(method.toUpperCase());
110
110
  const promise = new Promise((resolve, reject) => {
111
111
  xhr.open(method, url, true);
112
112
  // Set headers
@@ -333,7 +333,7 @@ const run = (method, url, config = {}, aborter) => {
333
333
  }
334
334
  url = buildURL(url, config.params);
335
335
  const wantsUploadProgress = typeof config.onUploadProgress === 'function' &&
336
- methodsWithBody.includes(method);
336
+ methodsWithBody.includes(method.toUpperCase());
337
337
  if (wantsUploadProgress) {
338
338
  // Use XHR when upload progress is requested
339
339
  return xhrRequest(method, url, config, aborter);
@@ -128,7 +128,7 @@ export default function ajax(url, datatype = null, data = null, success = null,
128
128
  let method = "get";
129
129
  if (isObject(data)) {
130
130
  if (numProperties(data) > 0) {
131
- options.data = JSON.stringify(data);
131
+ options.data = data;
132
132
  method = "post";
133
133
  bbn.fn.log("POSTING", options);
134
134
  }
@@ -4,7 +4,7 @@
4
4
  * The loader is an object representing an Ajax request, with the following properties:
5
5
  * * _key_ is the unique ID (_requestId_) of the loader
6
6
  * * _url_ is the URL called by the request
7
- * * _loader_ is the Promise from the Axios XHR
7
+ * * _loader_ is the Promise from the XHR
8
8
  * * _source_ is the source object for aborting the request
9
9
  * * _start_ is the timestamp of the moment the request was sent
10
10
  *
@@ -5,7 +5,7 @@ import search from '../object/search.js';
5
5
  * The loader is an object representing an Ajax request, with the following properties:
6
6
  * * _key_ is the unique ID (_requestId_) of the loader
7
7
  * * _url_ is the URL called by the request
8
- * * _loader_ is the Promise from the Axios XHR
8
+ * * _loader_ is the Promise from the XHR
9
9
  * * _source_ is the source object for aborting the request
10
10
  * * _start_ is the timestamp of the moment the request was sent
11
11
  *
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import axios from 'axios';
2
1
  import dayjs from 'dayjs';
3
2
  declare const bbn: Bbn;
4
- export { bbn as default, bbn, dayjs, axios };
3
+ export { bbn as default, bbn, dayjs };
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- import axios from 'axios';
2
1
  import dayjs from 'dayjs';
3
2
  import calendar from 'dayjs/plugin/calendar.js';
4
3
  import customParseFormat from 'dayjs/plugin/customParseFormat.js';
@@ -128,8 +127,7 @@ const bbn = {
128
127
  ]
129
128
  };
130
129
  if ('undefined' !== typeof window) {
131
- window.axios = axios;
132
130
  window.dayjs = dayjs;
133
131
  window.bbn = bbn;
134
132
  }
135
- export { bbn as default, bbn, dayjs, axios };
133
+ export { bbn as default, bbn, dayjs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.484",
3
+ "version": "1.0.486",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -44,7 +44,6 @@
44
44
  "@rollup/plugin-replace": "^6.0.2",
45
45
  "@rollup/plugin-terser": "^0.4.4",
46
46
  "@rollup/plugin-typescript": "^12.1.4",
47
- "axios": "^1.11.0",
48
47
  "dayjs": "^1.11.13",
49
48
  "rollup": "^4.46.1",
50
49
  "tslib": "^2.8.1"