Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
✨ Remove MutableMap from addOperations + fix regex for android (#42)
Browse files Browse the repository at this point in the history
* ✨ Remove MutableMap from addOperations

* ✨ Fixes regex error for android
  • Loading branch information
hernandazevedozup authored Jun 22, 2022
1 parent 5ddaaf2 commit 198b565
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/com/zup/nimbus/core/Nimbus.kt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Nimbus(config: ServerDrivenConfig) {
actionObservers.addAll(observers)
}

fun addOperations(newOperations: MutableMap<String, OperationHandler>) {
fun addOperations(newOperations: Map<String, OperationHandler>) {
addAll(operations, newOperations, "Operation")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ package com.zup.nimbus.core.render
import com.zup.nimbus.core.OperationHandler
import com.zup.nimbus.core.log.Logger
import com.zup.nimbus.core.tree.ServerDrivenState
import com.zup.nimbus.core.utils.then
import com.zup.nimbus.core.utils.untypedValueOf

private val expressionRegex = """(\\*)@\{(([^'}]|('([^'\\]|\\.)*'))*)}""".toRegex()
private val fullMatchExpressionRegex = """^@\{(([^'}]|('([^'\\]|\\.)*'))*)}$""".toRegex()
//Do not remove the Redundant character escape '\}' in RegExp, this causes error when using android regex implementation
private val expressionRegex = """(\\*)@\{(([^'}]|('([^'\\]|\\.)*'))*)\}""".toRegex()
private val fullMatchExpressionRegex = """^@\{(([^'}]|('([^'\\]|\\.)*'))*)\}$""".toRegex()
private val dpaTransitions: Map<String, List<Transition>> = mapOf(
"initial" to listOf(
Transition(""",|$""".toRegex(), null, null, "final"), // end of parameter
Expand Down

0 comments on commit 198b565

Please sign in to comment.