Socket
Socket
Sign inDemoInstall

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

Package Overview
Dependencies
Maintainers
1
Versions
64
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 1.14.1 to 1.15.0

android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageExpoMigration.java

15

lib/commonjs/AsyncStorage.native.js

@@ -41,2 +41,16 @@ /**

}
function checkValidArgs(keyValuePairs, callback) {
if (!Array.isArray(keyValuePairs) || keyValuePairs.length === 0 || !Array.isArray(keyValuePairs[0])) {
throw new Error('[AsyncStorage] Expected array of key-value pairs as first argument to multiSet');
}
if (callback && typeof callback !== 'function') {
if (Array.isArray(callback)) {
throw new Error('[AsyncStorage] Expected function as second argument to multiSet. Did you forget to wrap key-value pairs in an array for the first argument?');
}
throw new Error('[AsyncStorage] Expected function as second argument to multiSet');
}
}
/**

@@ -282,2 +296,3 @@ * `AsyncStorage` is a simple, unencrypted, asynchronous, persistent, key-value

multiSet: function (keyValuePairs, callback) {
checkValidArgs(keyValuePairs, callback);
return new Promise((resolve, reject) => {

@@ -284,0 +299,0 @@ keyValuePairs.forEach(([key, value]) => {

@@ -34,2 +34,16 @@ /**

}
function checkValidArgs(keyValuePairs, callback) {
if (!Array.isArray(keyValuePairs) || keyValuePairs.length === 0 || !Array.isArray(keyValuePairs[0])) {
throw new Error('[AsyncStorage] Expected array of key-value pairs as first argument to multiSet');
}
if (callback && typeof callback !== 'function') {
if (Array.isArray(callback)) {
throw new Error('[AsyncStorage] Expected function as second argument to multiSet. Did you forget to wrap key-value pairs in an array for the first argument?');
}
throw new Error('[AsyncStorage] Expected function as second argument to multiSet');
}
}
/**

@@ -270,2 +284,3 @@ * `AsyncStorage` is a simple, unencrypted, asynchronous, persistent, key-value

multiSet: function (keyValuePairs, callback) {
checkValidArgs(keyValuePairs, callback);
return new Promise((resolve, reject) => {

@@ -272,0 +287,0 @@ keyValuePairs.forEach(([key, value]) => {

10

package.json
{
"name": "@react-native-async-storage/async-storage",
"version": "1.14.1",
"version": "1.15.0",
"description": "Asynchronous, persistent, key-value storage system for React Native.",

@@ -131,2 +131,10 @@ "main": "lib/commonjs/index.js",

}
},
"android.emu.release.next": {
"binaryPath": "example/android/app/build/outputs/apk/next/app-next.apk",
"testBinaryPath": "example/android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk",
"type": "android.emulator",
"device": {
"avdName": "Emu_E2E"
}
}

@@ -133,0 +141,0 @@ }

@@ -72,2 +72,26 @@ /**

function checkValidArgs(keyValuePairs, callback) {
if (
!Array.isArray(keyValuePairs) ||
keyValuePairs.length === 0 ||
!Array.isArray(keyValuePairs[0])
) {
throw new Error(
'[AsyncStorage] Expected array of key-value pairs as first argument to multiSet',
);
}
if (callback && typeof callback !== 'function') {
if (Array.isArray(callback)) {
throw new Error(
'[AsyncStorage] Expected function as second argument to multiSet. Did you forget to wrap key-value pairs in an array for the first argument?',
);
}
throw new Error(
'[AsyncStorage] Expected function as second argument to multiSet',
);
}
}
/**

@@ -325,2 +349,3 @@ * `AsyncStorage` is a simple, unencrypted, asynchronous, persistent, key-value

): Promise<null> {
checkValidArgs(keyValuePairs, callback);
return new Promise((resolve, reject) => {

@@ -327,0 +352,0 @@ keyValuePairs.forEach(([key, value]) => {

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc