Skip to content

Commit

Permalink
fix: update readme; fix regex pattern optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
bgiori committed Jul 23, 2024
1 parent 88c81a1 commit 24d13e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
23 changes: 4 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# experiment-evaluation

Multiplatform (JVM, Node.js, Native) implementation of the experiment evaluation engine. The purpose of this library is
to share the same evaluation code across all local-evaluation experiment SDKs.
to share the same evaluation code across local-evaluation experiment SDKs which don't have a language-native
implementation (Ruby, Python).

* The current implementation supports:
* JVM
* Node.js
* Native
* macos
* macosX64
Expand All @@ -16,9 +16,8 @@ to share the same evaluation code across all local-evaluation experiment SDKs.

### Used in:

* [experiment-node-server](https://github.com/amplitude/experiment-node-server)
* [experiment-jvm-server](https://github.com/amplitude/experiment-jvm-server)
* [experiment-go-server](https://github.com/amplitude/experiment-go-server)
* [experiment-ruby-server](https://github.com/amplitude/experiment-ruby-server)
* [experiment-python-server](https://github.com/amplitude/experiment-python-server)

## Build

Expand Down Expand Up @@ -119,17 +118,3 @@ build/bin/<target>/<flavor>Shared/libevaluation_interop_api.h
build/bin/<target>/<flavor>Static/libevaluation_interop.a
build/bin/<target>/<flavor>Static/libevaluation_interop_api.h
```

### `evaluation-serialization`

Module containing kotlinx serialization annotated objects and mapping functions for equivalent objects in `evaluation-core`. Core objects are not annotated in order to optimize JavaScript generated code size.

This module is used by `evaluation-interop` and `experiment-jvm-server` to add serialization to flag configs and user objects. This package is not supposed to be used externally.

### `evaluation-js`

Module which only targets nodejs, optimizing bundle size and evaluation speed and consistency. The generated javascript is completely stateless, and takes and returns `dynamic` javascript objects/arrays in the `evaluate` function.

```kotlin
fun evaluate(rules: dynamic, user: dynamic): dynamic
```
2 changes: 1 addition & 1 deletion evaluation-core/src/commonMain/kotlin/SemanticVersion.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ internal data class SemanticVersion(
if (version == null) {
return null
}
val matchGroup = Regex(VERSION_PATTERN).matchEntire(version)?.groupValues ?: return null
val matchGroup = regex.matchEntire(version)?.groupValues ?: return null
val major = matchGroup[1].toIntOrNull() ?: return null
val minor = matchGroup[2].toIntOrNull() ?: return null
val patch = matchGroup[4].toIntOrNull() ?: 0
Expand Down

0 comments on commit 24d13e0

Please sign in to comment.