Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-storage

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-storage - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

2

package.json
{
"name": "react-native-storage",
"version": "0.0.11",
"version": "0.0.12",
"description": "This is a local storage wrapper for both react-native(AsyncStorage) and browser(localStorage). ES6/babel is needed.",

@@ -5,0 +5,0 @@ "main": "storage.js",

/*
* local storage(web/react native) wrapper
* sunnylqm 2016-01-03
* version 0.0.10
* sunnylqm 2016-01-26
* version 0.0.12
*/

@@ -30,2 +30,3 @@

console.warn(e);
delete me._s;
throw e;

@@ -39,3 +40,3 @@ }

me._mapPromise = me.getItem('map').then( map => {
me._m = me._checkMap(JSON.parse(map));
me._m = me._checkMap(map && JSON.parse(map) || {});
delete me._mapPromise;

@@ -45,9 +46,20 @@ });

getItem(key) {
return this.isBrowser ? new Promise((resolve, reject) => resolve(this._s.getItem(key))) : this._s.getItem(key);
return this._s
?
this.isBrowser ? new Promise((resolve, reject) => resolve(this._s.getItem(key))) : this._s.getItem(key)
:
Promise.resolve();
}
setItem(key, value) {
return this.isBrowser ? new Promise((resolve, reject) => resolve(this._s.setItem(key, value))) : this._s.setItem(key, value);
return this._s
?
this.isBrowser ? new Promise((resolve, reject) => resolve(this._s.setItem(key, value))) : this._s.setItem(key, value)
:
Promise.resolve();
}
removeItem(key) {
return this.isBrowser ? new Promise((resolve, reject) => resolve(this._s.removeItem(key))) : this._s.removeItem(key);
return this._s
? this.isBrowser ? new Promise((resolve, reject) => resolve(this._s.removeItem(key))) : this._s.removeItem(key)
:
Promise.resolve();
}

@@ -54,0 +66,0 @@ _checkMap(map) {

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