react-native-blob-util 0.24.9 → 0.24.11

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/package.json CHANGED
@@ -1,85 +1,83 @@
1
- {
2
- "name": "react-native-blob-util",
3
- "version": "0.24.9",
4
- "description": "A module provides upload, download, and files access API. Supports file stream read/write for process large files.",
5
- "main": "index",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1",
8
- "e2e:server": "node tests/e2e/server.js",
9
- "e2e:android": "node tests/e2e/run-all.js --platforms android",
10
- "e2e:ios": "node tests/e2e/run-all.js --platforms ios",
11
- "e2e:windows": "node tests/e2e/run-all.js --platforms windows",
12
- "e2e:runner": "node tests/e2e/appium/run.js",
13
- "e2e:all": "node tests/e2e/run-all.js"
14
- },
15
- "dependencies": {
16
- "base-64": "0.1.0",
17
- "glob": "13.0.1"
18
- },
19
- "keywords": [
20
- "react-native",
21
- "fetch",
22
- "blob",
23
- "fs",
24
- "upload",
25
- "file",
26
- "download",
27
- "filestream",
28
- "image header",
29
- "android",
30
- "ios",
31
- "file system"
32
- ],
33
- "repository": {
34
- "url": "https://github.com/RonRadtke/react-native-blob-util"
35
- },
36
- "author": {
37
- "name": "RonRadtke",
38
- "username": "RonRadtke"
39
- },
40
- "funding": {
41
- "type": "github",
42
- "url": "https://github.com/sponsors/ronradtke"
43
- },
44
- "license": "MIT",
45
- "contributors": [
46
- "Traviskn <>",
47
- "Ben <benhsieh@catchplay.com>",
48
- "wkh237 <xeiyan@gmail.com>"
49
- ],
50
- "devDependencies": {
51
- "@typescript-eslint/eslint-plugin": "^8.46.4",
52
- "@typescript-eslint/parser": "^8.46.4",
53
- "appium-uiautomator2-driver": "^7.0.0",
54
- "eslint": "^8.57.1",
55
- "eslint-plugin-ft-flow": "^3.0.11",
56
- "eslint-plugin-import": "^2.32.0",
57
- "eslint-plugin-react": "^7.37.5",
58
- "eslint-plugin-react-native": "^5.0.0",
59
- "react": "19.0.0",
60
- "react-native": "0.78.2",
61
- "react-native-windows": "0.78.2",
62
- "webdriverio": "^8.41.0"
63
- },
64
- "peerDependencies": {
65
- "react": "*",
66
- "react-native": "*"
67
- },
68
- "codegenConfig": {
69
- "name": "ReactNativeBlobUtilSpec",
70
- "type": "modules",
71
- "jsSrcsDir": "codegenSpecs",
72
- "windows": {
73
- "namespace": "ReactNativeBlobUtilCodegen",
74
- "outputDirectory": "windows/ReactNativeBlobUtil/codegen",
75
- "separateDataTypes": true
76
- }
77
- },
78
- "react-native-windows": {
79
- "init-windows": {
80
- "name": "ReactNativeBlobUtil",
81
- "namespace": "ReactNativeBlobUtil",
82
- "template": "cpp-lib"
83
- }
84
- }
85
- }
1
+ {
2
+ "name": "react-native-blob-util",
3
+ "version": "0.24.11",
4
+ "description": "A module provides upload, download, and files access API. Supports file stream read/write for process large files.",
5
+ "main": "index",
6
+ "scripts": {
7
+ "test": "node --disable-warning=MODULE_TYPELESS_PACKAGE_JSON --test \"tests/unit/*.test.js\"",
8
+ "e2e:server": "node tests/e2e/server.js",
9
+ "e2e:android": "node tests/e2e/run-all.js --platforms android",
10
+ "e2e:ios": "node tests/e2e/run-all.js --platforms ios",
11
+ "e2e:windows": "node tests/e2e/run-all.js --platforms windows",
12
+ "e2e:runner": "node tests/e2e/appium/run.js",
13
+ "e2e:all": "node tests/e2e/run-all.js"
14
+ },
15
+ "dependencies": {
16
+ "base-64": "1.0.0"
17
+ },
18
+ "keywords": [
19
+ "react-native",
20
+ "fetch",
21
+ "blob",
22
+ "fs",
23
+ "upload",
24
+ "file",
25
+ "download",
26
+ "filestream",
27
+ "image header",
28
+ "android",
29
+ "ios",
30
+ "file system"
31
+ ],
32
+ "repository": {
33
+ "url": "https://github.com/RonRadtke/react-native-blob-util"
34
+ },
35
+ "author": {
36
+ "name": "RonRadtke",
37
+ "username": "RonRadtke"
38
+ },
39
+ "funding": {
40
+ "type": "github",
41
+ "url": "https://github.com/sponsors/ronradtke"
42
+ },
43
+ "license": "MIT",
44
+ "contributors": [
45
+ "Traviskn <>",
46
+ "Ben <benhsieh@catchplay.com>",
47
+ "wkh237 <xeiyan@gmail.com>"
48
+ ],
49
+ "devDependencies": {
50
+ "@typescript-eslint/eslint-plugin": "^8.61.1",
51
+ "@typescript-eslint/parser": "^8.61.1",
52
+ "eslint": "^8.57.1",
53
+ "eslint-plugin-ft-flow": "^3.0.11",
54
+ "eslint-plugin-import": "^2.32.0",
55
+ "eslint-plugin-react": "^7.37.5",
56
+ "eslint-plugin-react-native": "^5.0.0",
57
+ "react": "19.2.3",
58
+ "react-native": "0.84.1",
59
+ "react-native-windows": "0.84.0",
60
+ "webdriverio": "^9.29.0"
61
+ },
62
+ "peerDependencies": {
63
+ "react": "*",
64
+ "react-native": "*"
65
+ },
66
+ "codegenConfig": {
67
+ "name": "ReactNativeBlobUtilSpec",
68
+ "type": "modules",
69
+ "jsSrcsDir": "codegenSpecs",
70
+ "windows": {
71
+ "namespace": "ReactNativeBlobUtilCodegen",
72
+ "outputDirectory": "windows/ReactNativeBlobUtil/codegen",
73
+ "separateDataTypes": true
74
+ }
75
+ },
76
+ "react-native-windows": {
77
+ "init-windows": {
78
+ "name": "ReactNativeBlobUtil",
79
+ "namespace": "ReactNativeBlobUtil",
80
+ "template": "cpp-lib"
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Native reports progress byte counts inconsistently across platforms:
3
+ *
4
+ * Android `String.valueOf(long)` -> "900", "-1" when length is unknown
5
+ * iOS `stringWithFormat:@"%lld"` -> "900", "-1" when length is unknown
6
+ * Windows `int64_t` / `JSValue` -> 900, null when length is unknown
7
+ *
8
+ * The public progress/uploadProgress callbacks are documented as receiving
9
+ * numbers, so normalise here rather than pushing the inconsistency onto every
10
+ * consumer. `-1` is the "unknown length" sentinel Android and iOS already use
11
+ * for chunked responses; Windows' null folds into it.
12
+ */
13
+ function toByteCount(value) {
14
+ if (value === null || value === undefined || value === '') return -1;
15
+ const count = Number(value);
16
+ return Number.isNaN(count) ? -1 : count;
17
+ }
18
+
19
+ export {toByteCount};
20
+ export default toByteCount;
package/utils/uuid.js CHANGED
@@ -1,11 +1,11 @@
1
- function getUUID() {
2
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
3
- const r = Math.floor(Math.random() * 16);
4
- const v = c === 'x' ? r : (r & 0x3) | 0x8;
5
-
6
- return v.toString(16);
7
- });
8
- }
9
-
10
- export {getUUID};
11
- export default getUUID;
1
+ function getUUID() {
2
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
3
+ const r = Math.floor(Math.random() * 16);
4
+ const v = c === 'x' ? r : (r & 0x3) | 0x8;
5
+
6
+ return v.toString(16);
7
+ });
8
+ }
9
+
10
+ export {getUUID};
11
+ export default getUUID;