refactored data-types to reduce plugin sizes
This commit is contained in:
+5
-3
@@ -9,6 +9,8 @@ import (
|
||||
"io"
|
||||
|
||||
"git.portale-stac.it/go-pkg/expr/kern"
|
||||
"git.portale-stac.it/go-pkg/expr/types/boolean"
|
||||
"git.portale-stac.it/go-pkg/expr/types/dict"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -32,8 +34,8 @@ func parseRunArgs(localCtx kern.ExprContext, args map[string]any) (it kern.Itera
|
||||
}
|
||||
}
|
||||
|
||||
var vars *kern.DictType
|
||||
if vars, ok = args[iterParamVars].(*kern.DictType); !ok && args[iterParamVars] != nil {
|
||||
var vars *dict.DictType
|
||||
if vars, ok = args[iterParamVars].(*dict.DictType); !ok && args[iterParamVars] != nil {
|
||||
err = fmt.Errorf("paramter %q must be a dictionary, passed %v [%s]", iterParamVars, args[iterParamVars], kern.TypeName(args[iterParamVars]))
|
||||
return
|
||||
}
|
||||
@@ -73,7 +75,7 @@ func runFunc(ctx kern.ExprContext, name string, args map[string]any) (result any
|
||||
break
|
||||
} else {
|
||||
var success bool
|
||||
if success, ok = kern.ToBool(v); !success || !ok {
|
||||
if success, ok = boolean.ToBool(v); !success || !ok {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user