@bbn/bbn 1.0.332 → 1.0.334

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.
@@ -131,10 +131,12 @@ export default function ajax(url, datatype, data, success, failure, abort) {
131
131
  switch (res.status) {
132
132
  case 200:
133
133
  if (isFunction(success)) {
134
+ bbn.fn.log("THERE US A SUCCESS FUNCTION", res);
134
135
  success(res.data, res.headers);
135
136
  }
136
137
  break;
137
138
  default:
139
+ bbn.fn.log("THIS IS THE DEFAULT FUNCTION", res, loader_1);
138
140
  bbn.fn.defaultAjaxErrorFunction(loader_1, res);
139
141
  }
140
142
  return res;
@@ -158,6 +160,7 @@ export default function ajax(url, datatype, data, success, failure, abort) {
158
160
  ok = failure(err.request, err);
159
161
  }
160
162
  if (ok) {
163
+ bbn.fn.log("THIS IS THE ERROR FUNCTION", err);
161
164
  bbn.fn.defaultAjaxErrorFunction(err.request, err.response ? err.response.data : "", err.response ? err.response.status : err);
162
165
  }
163
166
  }
@@ -90,10 +90,14 @@ export default function stream(url, success, data, failure, abort, finished) {
90
90
  return;
91
91
  }
92
92
  if (isFn_1) {
93
- json = arrayBuffer2String(value).trim();
93
+ json += arrayBuffer2String(value).trim();
94
94
  bbn.fn.log(["STREAM RESULT", json.length, json]);
95
95
  if (json) {
96
- treatJSON(json);
96
+ try {
97
+ treatJSON(json);
98
+ json = '';
99
+ }
100
+ catch (e) { }
97
101
  }
98
102
  else {
99
103
  success();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.332",
3
+ "version": "1.0.334",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",