Browse Source

Fix expr helpers "StartsWith" and "EndsWith" (#48)

* fix

* fix typo

Co-authored-by: AlteredCoder <AlteredCoder>
AlteredCoder 5 years ago
parent
commit
82d6e6938a
1 changed files with 9 additions and 1 deletions
  1. 9 1
      pkg/exprhelpers/exprlib.go

+ 9 - 1
pkg/exprhelpers/exprlib.go

@@ -33,7 +33,15 @@ func EndsWith(s string, suff string) bool {
 }
 
 func GetExprEnv(ctx map[string]interface{}) map[string]interface{} {
-	var ExprLib = map[string]interface{}{"Atof": Atof, "JsonExtract": JsonExtract, "JsonExtractLib": JsonExtractLib, "File": File, "RegexpInFile": RegexpInFile}
+	var ExprLib = map[string]interface{}{
+		"Atof": Atof,
+		"StartsWith": StartsWith,
+		"EndsWith" : EndsWith,
+		"JsonExtract": JsonExtract,
+		"JsonExtractLib": JsonExtractLib,
+		"File": File,
+		"RegexpInFile": RegexpInFile,
+	}
 	for k, v := range ctx {
 		ExprLib[k] = v
 	}