react-native-iap 16.3.1 → 16.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
@@ -5,9 +5,9 @@
5
5
 
6
6
  [![Version](http://img.shields.io/npm/v/react-native-iap.svg?style=flat-square)](https://npmjs.org/package/react-native-iap) [![Download](http://img.shields.io/npm/dm/react-native-iap.svg?style=flat-square)](https://npmjs.org/package/react-native-iap) [![OpenIAP](https://img.shields.io/badge/OpenIAP-Compliant-green?style=flat-square)](https://openiap.dev) [![Backers and Sponsors](https://img.shields.io/opencollective/all/openiap.svg)](https://opencollective.com/openiap) [![CI - Test](https://github.com/hyodotdev/openiap/actions/workflows/ci-react-native-iap.yml/badge.svg?branch=main)](https://github.com/hyodotdev/openiap/actions/workflows/ci-react-native-iap.yml?query=branch%3Amain) [![codecov](https://codecov.io/gh/hyodotdev/openiap/branch/main/graph/badge.svg?component=react-native-iap)](https://app.codecov.io/gh/hyodotdev/openiap/tree/main/libraries/react-native-iap) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fhyochan%2Freact-native-iap.svg?type=shield&issueType=license)](https://app.fossa.com/projects/git%2Bgithub.com%2Fhyochan%2Freact-native-iap?ref=badge_shield&issueType=license)
7
7
 
8
- **React Native IAP** is a high-performance in-app purchase library using Nitro Modules that **conforms to the [Open IAP specification](https://openiap.dev)**. It provides a unified API for handling in-app purchases across iOS and Android platforms with comprehensive error handling and modern TypeScript support.
8
+ **React Native IAP** is a high-performance in-app purchase library using Nitro Modules that **conforms to the [OpenIAP specification](https://openiap.dev)**. It provides a unified API for handling in-app purchases across iOS and Android platforms with comprehensive error handling and modern TypeScript support.
9
9
 
10
- <a href="https://openiap.dev"><img src="https://raw.githubusercontent.com/hyodotdev/openiap/main/logo.webp" alt="Open IAP" height="40" /></a>
10
+ <a href="https://openiap.dev"><img src="https://raw.githubusercontent.com/hyodotdev/openiap/main/logo.webp" alt="OpenIAP" height="40" /></a>
11
11
  </div>
12
12
 
13
13
  ## 📚 Documentation
@@ -67,7 +67,7 @@ internal object RnIapLog {
67
67
  }
68
68
  }
69
69
 
70
- private fun sanitizeMap(source: Map<*, *>): Map<String, Any?> {
70
+ internal fun sanitizeMap(source: Map<*, *>): Map<String, Any?> {
71
71
  fun isSensitiveKey(key: String): Boolean {
72
72
  val normalized = key.lowercase(Locale.ROOT).filter { it.isLetterOrDigit() }
73
73
  return SENSITIVE_KEY_FRAGMENTS.any { normalized.contains(it) } ||
@@ -77,6 +77,10 @@ internal object RnIapLog {
77
77
  val sanitized = linkedMapOf<String, Any?>()
78
78
  for ((rawKey, rawValue) in source) {
79
79
  val key = rawKey as? String ?: continue
80
+ if (rawValue == null || rawValue === JSONObject.NULL) {
81
+ sanitized[key] = JSONObject.NULL
82
+ continue
83
+ }
80
84
  if (isSensitiveKey(key)) {
81
85
  sanitized[key] = "hidden"
82
86
  continue
@@ -105,22 +105,22 @@ enum RnIapLog {
105
105
  }
106
106
 
107
107
  private static func sanitize(_ value: Any?) -> Any? {
108
- guard let value else { return nil }
109
-
110
- if let dictionary = value as? [String: Any] {
111
- return sanitizeDictionary(dictionary)
112
- }
108
+ guard let value, !(value is NSNull) else { return nil }
113
109
 
114
110
  if let optionalDictionary = value as? [String: Any?] {
115
111
  var compact: [String: Any] = [:]
116
112
  for (key, optionalValue) in optionalDictionary {
117
- if let optionalValue {
113
+ if let optionalValue, !(optionalValue is NSNull) {
118
114
  compact[key] = optionalValue
119
115
  }
120
116
  }
121
117
  return sanitizeDictionary(compact)
122
118
  }
123
119
 
120
+ if let dictionary = value as? [String: Any] {
121
+ return sanitizeDictionary(dictionary)
122
+ }
123
+
124
124
  if let array = value as? [Any] {
125
125
  return array.compactMap { sanitize($0) }
126
126
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "spec": "3.2.1",
3
- "google": "3.3.1",
3
+ "google": "3.3.2",
4
4
  "apple": "3.2.1"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-iap",
3
- "version": "16.3.1",
3
+ "version": "16.3.2",
4
4
  "description": "React Native In-App Purchases module for iOS and Android using Nitro",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -173,6 +173,7 @@
173
173
  },
174
174
  "packageManager": "yarn@3.6.1",
175
175
  "resolutions": {
176
- "nitrogen@^0.36.5": "patch:nitrogen@npm%3A0.36.5#./.yarn/patches/nitrogen-npm-0.36.5-array-equatable.patch"
176
+ "nitrogen@^0.36.5": "patch:nitrogen@npm%3A0.36.5#./.yarn/patches/nitrogen-npm-0.36.5-array-equatable.patch",
177
+ "uuid@^7.0.3": "11.1.1"
177
178
  }
178
179
  }