spotny-sdk 1.0.33 → 1.0.34

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.
@@ -169,12 +169,13 @@ class SpotnySdkModule(private val reactContext: ReactApplicationContext) :
169
169
  override fun isScanning(promise: Promise) = promise.resolve(scanning)
170
170
 
171
171
  override fun initialize(config: ReadableMap?, promise: Promise) {
172
- config?.getDouble("maxDetectionDistance").takeIf { config?.hasKey("maxDetectionDistance") == true }
173
- ?.let { maxDetectionDistance = it; Log.d(TAG, "maxDetectionDistance = $it m") }
172
+ if (config?.hasKey("maxDetectionDistance") == true)
173
+ config.getDouble("maxDetectionDistance").let { maxDetectionDistance = it; Log.d(TAG, "maxDetectionDistance = $it m") }
174
174
  config?.getString("apiKey")?.let { apiKey = it; Log.d(TAG, "apiKey = $it") }
175
- config?.getDouble("distanceCorrectionFactor")
176
- .takeIf { config?.hasKey("distanceCorrectionFactor") == true && (it ?: 0.0) > 0 }
177
- ?.let { distanceCorrectionFactor = it; Log.d(TAG, "distanceCorrectionFactor = $it") }
175
+ if (config?.hasKey("distanceCorrectionFactor") == true) {
176
+ val factor = config.getDouble("distanceCorrectionFactor")
177
+ if (factor > 0) { distanceCorrectionFactor = factor; Log.d(TAG, "distanceCorrectionFactor = $factor") }
178
+ }
178
179
  if (config?.hasKey("debug") == true) {
179
180
  debugMode = config.getBoolean("debug")
180
181
  Log.d(TAG, "debugMode = $debugMode")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spotny-sdk",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "description": "Beacon Scanner",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",