refactored data-types to reduce plugin sizes
This commit is contained in:
+3
-2
@@ -9,6 +9,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"git.portale-stac.it/go-pkg/expr/kern"
|
||||
"git.portale-stac.it/go-pkg/expr/types/boolean"
|
||||
)
|
||||
|
||||
//var globalCtx *SimpleStore
|
||||
@@ -68,7 +69,7 @@ func GlobalCtrlGet(ctx kern.ExprContext, name string) (currentValue any) {
|
||||
|
||||
func CtrlEnable(ctx kern.ExprContext, name string) (currentStatus bool) {
|
||||
name = fixCtrlVar(name)
|
||||
if v, exists := ctx.GetVar(name); exists && kern.IsBool(v) {
|
||||
if v, exists := ctx.GetVar(name); exists && boolean.IsBool(v) {
|
||||
currentStatus, _ = v.(bool)
|
||||
}
|
||||
|
||||
@@ -78,7 +79,7 @@ func CtrlEnable(ctx kern.ExprContext, name string) (currentStatus bool) {
|
||||
|
||||
func CtrlDisable(ctx kern.ExprContext, name string) (currentStatus bool) {
|
||||
name = fixCtrlVar(name)
|
||||
if v, exists := ctx.GetVar(name); exists && kern.IsBool(v) {
|
||||
if v, exists := ctx.GetVar(name); exists && boolean.IsBool(v) {
|
||||
currentStatus, _ = v.(bool)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user