From b1076ce1e4bf55aff0e3ea8f26bd93b2c6e13f95 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Thu, 12 Mar 2026 21:38:08 -0500 Subject: [PATCH] do some manual casting for script.js payload --- internal/processor/script-js.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/internal/processor/script-js.go b/internal/processor/script-js.go index bd3af07..2c46bbc 100644 --- a/internal/processor/script-js.go +++ b/internal/processor/script-js.go @@ -20,6 +20,18 @@ type ScriptJS struct { func (sj *ScriptJS) Process(ctx context.Context, payload any) (any, error) { + //NOTE(jwetzell): some weird conversion going on with these types + _, isUint8Slice := common.GetAnyAs[[]uint8](payload) + _, isbyteSlice := common.GetAnyAs[[]byte](payload) + + if isUint8Slice || isbyteSlice { + intSlice, ok := common.GetAnyAsIntSlice(payload) + + if ok { + payload = intSlice + } + } + sj.vm.SetProperty(sj.vm.GlobalObject(), sj.payloadAtom, payload) sender := ctx.Value(common.SenderContextKey) @@ -49,6 +61,7 @@ func (sj *ScriptJS) Process(ctx context.Context, payload any) (any, error) { if ok { var outputMap map[string]interface{} + fmt.Println(outputObject.String()) err := json.Unmarshal([]byte(outputObject.String()), &outputMap) return outputMap, err }