@bbn/bbn 1.0.306 → 1.0.307
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/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/fn/ajax/stream.js +13 -1
- package/package.json +1 -1
package/dist/fn/ajax/stream.js
CHANGED
|
@@ -3,6 +3,7 @@ import getLoader from './getLoader.js';
|
|
|
3
3
|
import _deleteLoader from './_deleteLoader.js';
|
|
4
4
|
import isFunction from '../type/isFunction.js';
|
|
5
5
|
import _addLoader from './_addLoader.js';
|
|
6
|
+
import log from '../browser/log.js';
|
|
6
7
|
import defaultStartLoadingFunction from '../default/defaultStartLoadingFunction.js';
|
|
7
8
|
import defaultEndLoadingFunction from '../default/defaultEndLoadingFunction.js';
|
|
8
9
|
import defaultAjaxAbortFunction from '../default/defaultAjaxAbortFunction.js';
|
|
@@ -63,7 +64,18 @@ export default function stream(url, success, data, failure, abort) {
|
|
|
63
64
|
}
|
|
64
65
|
if (isFn_1) {
|
|
65
66
|
var res = arrayBuffer2String(value).trim();
|
|
66
|
-
|
|
67
|
+
if (res) {
|
|
68
|
+
try {
|
|
69
|
+
success(JSON.parse(res));
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
log(res);
|
|
73
|
+
success(res);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
success();
|
|
78
|
+
}
|
|
67
79
|
}
|
|
68
80
|
// Read some more, and call this function again
|
|
69
81
|
return reader_1.read().then(pump);
|