react-native-nitro-storage 0.5.2 → 0.5.3

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
@@ -394,6 +394,9 @@ bun run test:cpp:coverage -- --filter=react-native-nitro-storage
394
394
  bun run publish-package:dry -- --yes --with-coverage
395
395
  ```
396
396
 
397
+ Publishing a GitHub Release tagged `v<package.version>` triggers the npm workflow.
398
+ The npm package must trust `.github/workflows/npm-publish.yml` in npm package settings.
399
+
397
400
  ## Development
398
401
 
399
402
  ```sh
@@ -498,11 +498,13 @@ void HybridStorage::setSecureAccessControl(double level) {
498
498
  if (std::isnan(level) || std::isinf(level)) {
499
499
  throw std::runtime_error("NitroStorage: Invalid access control level");
500
500
  }
501
- int intLevel = static_cast<int>(level);
502
- if (intLevel < 0 || intLevel > 4) {
501
+ if (level < 0.0 || level > 4.0) {
503
502
  throw std::runtime_error(
504
- "NitroStorage: Invalid access control level " + std::to_string(intLevel) +
505
- ". Expected 0-4.");
503
+ "NitroStorage: Invalid access control level. Expected 0-4.");
504
+ }
505
+ int intLevel = static_cast<int>(level);
506
+ if (level != static_cast<double>(intLevel)) {
507
+ throw std::runtime_error("NitroStorage: Invalid access control level");
506
508
  }
507
509
  ensureAdapter();
508
510
  nativeAdapter_->setSecureAccessControl(intLevel);
@@ -529,11 +531,14 @@ void HybridStorage::setSecureBiometricWithLevel(const std::string& key, const st
529
531
  throw std::runtime_error(
530
532
  "NitroStorage: Invalid biometric level");
531
533
  }
534
+ if (level < 0.0 || level > 2.0) {
535
+ throw std::runtime_error(
536
+ "NitroStorage: Invalid biometric level. Expected 0 (none), 1 (user presence), or 2 (biometric only).");
537
+ }
532
538
  int intLevel = static_cast<int>(level);
533
- if (intLevel < 0 || intLevel > 2) {
539
+ if (level != static_cast<double>(intLevel)) {
534
540
  throw std::runtime_error(
535
- "NitroStorage: Invalid biometric level " + std::to_string(intLevel) +
536
- ". Expected 0 (none), 1 (user presence), or 2 (biometric only).");
541
+ "NitroStorage: Invalid biometric level");
537
542
  }
538
543
  ensureAdapter();
539
544
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nitro-storage",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Synchronous React Native storage powered by Nitro Modules and JSI: typed Memory, Disk, Keychain/Android Keystore secure storage, biometric auth, MMKV migration, Expo, Zustand/Jotai persistence, and web IndexedDB support.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -113,8 +113,7 @@
113
113
  "@react-native/babel-preset": "^0.83.6",
114
114
  "@testing-library/react-hooks": "^8.0.1",
115
115
  "@testing-library/react-native": "^13.3.3",
116
- "@types/react": "~19.2.0",
117
- "typescript": "^5.9.3"
116
+ "@types/react": "~19.2.0"
118
117
  },
119
118
  "peerDependencies": {
120
119
  "react": ">=18.2.0",
@@ -127,7 +126,12 @@
127
126
  "targets": [
128
127
  "commonjs",
129
128
  "module",
130
- "typescript"
129
+ [
130
+ "typescript",
131
+ {
132
+ "tsc": "../../node_modules/.bin/tsc"
133
+ }
134
+ ]
131
135
  ]
132
136
  }
133
137
  }