🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@react-native-async-storage/async-storage

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native-async-storage/async-storage - npm Package Compare versions

Comparing version

to
1.15.10

22

lib/commonjs/AsyncStorage.native.js

@@ -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);

6

package.json
{
"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