@log-drop/react-native 2.0.0 → 2.0.1
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.
|
@@ -4,12 +4,13 @@ import com.facebook.react.bridge.ReadableMap
|
|
|
4
4
|
|
|
5
5
|
import io.logdrop.sdk.LogFlow
|
|
6
6
|
|
|
7
|
-
fun readableMapToLogFlow(logFlowMap: ReadableMap?): LogFlow {
|
|
8
|
-
|
|
9
|
-
val
|
|
7
|
+
fun readableMapToLogFlow(logFlowMap: ReadableMap?): LogFlow? {
|
|
8
|
+
if (logFlowMap == null) return null
|
|
9
|
+
val name = logFlowMap.takeIf { it.hasKey("name") && !it.isNull("name") }?.getString("name") ?: return null
|
|
10
|
+
val id = logFlowMap.takeIf { it.hasKey("id") && !it.isNull("id") }?.getString("id") ?: return null
|
|
10
11
|
|
|
11
12
|
val customAttributes: Map<String, String>? = logFlowMap
|
|
12
|
-
|
|
13
|
+
.takeIf { it.hasKey("customAttributes") && !it.isNull("customAttributes") }
|
|
13
14
|
?.getMap("customAttributes")
|
|
14
15
|
?.toStringMap()
|
|
15
16
|
|