@react-native-async-storage/async-storage
Advanced tools
Comparing version 1.15.9 to 1.15.10
@@ -253,7 +253,25 @@ /** | ||
const reqLength = getRequests.length; | ||
/** | ||
* As mentioned few lines above, this method could be called with the array of potential error, | ||
* in case of anything goes wrong. The problem is, if any of the batched calls fails | ||
* the rest of them would fail too, but the error would be consumed by just one. The rest | ||
* would simply return `undefined` as their result, rendering false negatives. | ||
* | ||
* In order to avoid this situation, in case of any call failing, | ||
* the rest of them will be rejected as well (with the same error). | ||
*/ | ||
const errorList = convertErrors(errors); | ||
const error = errorList && errorList.length ? errorList[0] : null; | ||
for (let i = 0; i < reqLength; i++) { | ||
const request = getRequests[i]; | ||
const requestKeys = request.keys; | ||
const requestResult = requestKeys.map(key => [key, map[key]]); | ||
if (error) { | ||
request.callback && request.callback(error); | ||
request.reject && request.reject(error); | ||
continue; | ||
} | ||
const requestResult = request.keys.map(key => [key, map[key]]); | ||
request.callback && request.callback(null, requestResult); | ||
@@ -260,0 +278,0 @@ request.resolve && request.resolve(requestResult); |
@@ -241,7 +241,25 @@ /** | ||
const reqLength = getRequests.length; | ||
/** | ||
* As mentioned few lines above, this method could be called with the array of potential error, | ||
* in case of anything goes wrong. The problem is, if any of the batched calls fails | ||
* the rest of them would fail too, but the error would be consumed by just one. The rest | ||
* would simply return `undefined` as their result, rendering false negatives. | ||
* | ||
* In order to avoid this situation, in case of any call failing, | ||
* the rest of them will be rejected as well (with the same error). | ||
*/ | ||
const errorList = convertErrors(errors); | ||
const error = errorList && errorList.length ? errorList[0] : null; | ||
for (let i = 0; i < reqLength; i++) { | ||
const request = getRequests[i]; | ||
const requestKeys = request.keys; | ||
const requestResult = requestKeys.map(key => [key, map[key]]); | ||
if (error) { | ||
request.callback && request.callback(error); | ||
request.reject && request.reject(error); | ||
continue; | ||
} | ||
const requestResult = request.keys.map(key => [key, map[key]]); | ||
request.callback && request.callback(null, requestResult); | ||
@@ -248,0 +266,0 @@ request.resolve && request.resolve(requestResult); |
{ | ||
"name": "@react-native-async-storage/async-storage", | ||
"version": "1.15.9", | ||
"version": "1.15.10", | ||
"description": "Asynchronous, persistent, key-value storage system for React Native.", | ||
@@ -91,5 +91,5 @@ "main": "lib/commonjs/index.js", | ||
"react-native-macos": "^0.63.4", | ||
"react-native-test-app": "^0.7.1", | ||
"react-native-test-app": "^0.9.5", | ||
"react-native-web": "~0.12.0", | ||
"react-native-windows": "^0.63.18", | ||
"react-native-windows": "^0.63.41", | ||
"react-test-renderer": "16.13.1", | ||
@@ -96,0 +96,0 @@ "semantic-release": "^17.2.1" |
@@ -285,6 +285,23 @@ /** | ||
const reqLength = getRequests.length; | ||
/** | ||
* As mentioned few lines above, this method could be called with the array of potential error, | ||
* in case of anything goes wrong. The problem is, if any of the batched calls fails | ||
* the rest of them would fail too, but the error would be consumed by just one. The rest | ||
* would simply return `undefined` as their result, rendering false negatives. | ||
* | ||
* In order to avoid this situation, in case of any call failing, | ||
* the rest of them will be rejected as well (with the same error). | ||
*/ | ||
const errorList = convertErrors(errors); | ||
const error = errorList && errorList.length ? errorList[0] : null; | ||
for (let i = 0; i < reqLength; i++) { | ||
const request = getRequests[i]; | ||
const requestKeys = request.keys; | ||
const requestResult = requestKeys.map((key) => [key, map[key]]); | ||
if (error) { | ||
request.callback && request.callback(error); | ||
request.reject && request.reject(error); | ||
continue; | ||
} | ||
const requestResult = request.keys.map((key) => [key, map[key]]); | ||
request.callback && request.callback(null, requestResult); | ||
@@ -291,0 +308,0 @@ request.resolve && request.resolve(requestResult); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
401402
1957
1