react-native-mmkv 2.3.1 → 2.3.2

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/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ <a href="https://margelo.io">
2
+ <img src="./img/banner.svg" width="100%" />
3
+ </a>
4
+
1
5
  <div align="center">
2
6
  <h1 align="center">MMKV</h1>
3
7
  <h3 align="center">The fastest key/value storage for React Native.</h3>
@@ -222,10 +222,10 @@ jsi::Value MmkvHostObject::get(jsi::Runtime& runtime, const jsi::PropNameID& pro
222
222
  }
223
223
 
224
224
  if (propName == "recrypt") {
225
- // MMKV.recrypt(key)
225
+ // MMKV.recrypt(encryptionKey)
226
226
  return jsi::Function::createFromHostFunction(runtime,
227
227
  jsi::PropNameID::forAscii(runtime, funcName),
228
- 0,
228
+ 1, // encryptionKey
229
229
  [this](jsi::Runtime& runtime,
230
230
  const jsi::Value& thisValue,
231
231
  const jsi::Value* arguments,
@@ -104,10 +104,10 @@ jsi::Value MmkvHostObject::get(jsi::Runtime& runtime, const jsi::PropNameID& pro
104
104
  }
105
105
 
106
106
  auto keyName = convertJSIStringToNSString(runtime, arguments[0].getString(runtime));
107
- bool hasValue;
107
+ BOOL hasValue;
108
108
  auto value = [instance getBoolForKey:keyName defaultValue:false hasValue:&hasValue];
109
109
  if (hasValue) {
110
- return jsi::Value(value);
110
+ return jsi::Value(value == true);
111
111
  } else {
112
112
  return jsi::Value::undefined();
113
113
  }
@@ -151,7 +151,7 @@ jsi::Value MmkvHostObject::get(jsi::Runtime& runtime, const jsi::PropNameID& pro
151
151
  }
152
152
 
153
153
  auto keyName = convertJSIStringToNSString(runtime, arguments[0].getString(runtime));
154
- bool hasValue;
154
+ BOOL hasValue;
155
155
  auto value = [instance getDoubleForKey:keyName defaultValue:0.0 hasValue:&hasValue];
156
156
  if (hasValue) {
157
157
  return jsi::Value(value);
@@ -228,10 +228,10 @@ jsi::Value MmkvHostObject::get(jsi::Runtime& runtime, const jsi::PropNameID& pro
228
228
  }
229
229
 
230
230
  if (propName == "recrypt") {
231
- // MMKV.recrypt(key)
231
+ // MMKV.recrypt(encryptionKey)
232
232
  return jsi::Function::createFromHostFunction(runtime,
233
233
  jsi::PropNameID::forAscii(runtime, funcName),
234
- 0,
234
+ 1, // encryptionKey
235
235
  [this](jsi::Runtime& runtime,
236
236
  const jsi::Value& thisValue,
237
237
  const jsi::Value* arguments,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-mmkv",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "description": "The fastest key/value storage for React Native. ~30x faster than AsyncStorage! Works on Android, iOS and Web.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",