Skip to content

Commit 7f82a51

Browse files
author
Ron Radtke
committed
Update:
* Fixing errors on the imports Merge remote-tracking branch 'origin/develop' into master
2 parents 7d0d9d1 + dc40abf commit 7f82a51

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-blob-util",
3-
"version": "0.13.13",
3+
"version": "0.13.14",
44
"description": "A module provides upload, download, and files access API. Supports file stream read/write for process large files.",
55
"main": "index.js",
66
"scripts": {

polyfill/Fetch.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import Log from '../utils/log.js';
22
import Blob from './Blob';
3-
import {config as RNconfig, wrap} from "../fetch";
3+
import {config as RNconfig} from "../fetch";
44
import type {ReactNativeBlobUtilConfig} from "../types";
5+
import URIUtil from "../utils/uri";
56
import {FetchBlobResponse} from "../class/ReactNativeBlobUtilBlobResponse";
67

78
const log = new Log('FetchPolyfill');
@@ -40,12 +41,12 @@ class ReactNativeBlobUtilFetchPolyfill {
4041
promise = Blob.build(body).then((b) => {
4142
blobCache = b;
4243
options.headers['Content-Type'] = 'multipart/form-data;boundary=' + b.multipartBoundary;
43-
return Promise.resolve(wrap(b._ref));
44+
return Promise.resolve(URIUtil.wrap(b._ref));
4445
});
4546
}
4647
// When request body is a Blob, use file URI of the Blob as request body.
4748
else if (body.isReactNativeBlobUtilPolyfill)
48-
promise = Promise.resolve(wrap(body.blobPath));
49+
promise = Promise.resolve(URIUtil.wrap(body.blobPath));
4950
else if (typeof body !== 'object' && options.headers['Content-Type'] !== 'application/json')
5051
promise = Promise.resolve(JSON.stringify(body));
5152
else if (typeof body !== 'string')

polyfill/XMLHttpRequest.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ import XMLHttpRequestEventTarget from './XMLHttpRequestEventTarget.js';
66
import Log from '../utils/log.js';
77
import Blob from './Blob.js';
88
import ProgressEvent from './ProgressEvent.js';
9-
import URIUtil from '../utils/uri';
10-
import {NativeModules} from "react-native";
9+
import URIUtil from "../utils/uri";
10+
import {config} from "../fetch";
1111

12-
const ReactNativeBlobUtil = NativeModules.ReactNativeBlobUtil;
1312
const log = new Log('XMLHttpRequest');
1413

1514

@@ -183,7 +182,7 @@ export default class XMLHttpRequest extends XMLHttpRequestEventTarget {
183182
};
184183
}
185184
log.debug('body created send request');
186-
body = ReactNativeBlobUtil.wrap(blob.getReactNativeBlobUtilRef());
185+
body = URIUtil.wrap(blob.getReactNativeBlobUtilRef());
187186
resolve();
188187
});
189188
});
@@ -203,13 +202,12 @@ export default class XMLHttpRequest extends XMLHttpRequestEventTarget {
203202
_headers[h] = _headers[h].toString();
204203
}
205204

206-
this._task = ReactNativeBlobUtil
207-
.config({
208-
auto: true,
209-
timeout: this._timeout,
210-
increment: this._increment,
211-
binaryContentTypes: XMLHttpRequest.binaryContentTypes
212-
})
205+
this._task = config({
206+
auto: true,
207+
timeout: this._timeout,
208+
increment: this._increment,
209+
binaryContentTypes: XMLHttpRequest.binaryContentTypes
210+
})
213211
.fetch(_method, _url, _headers, body);
214212
this._task
215213
.stateChange(this._headerReceived)

0 commit comments

Comments
 (0)