adding array return type
package workflows
import (
- "strings"
"sync"
tengo "github.com/d5/tengo/v2"
@@ -137,8 +136,18 @@ func (n *NucleiVar) IndexGet(index tengo.Object) (res tengo.Object, err error) {
return tengo.UndefinedValue, nil
}
+ var resA []tengo.Object
+
+ rr, ok := r.([]string)
+ if !ok {
+ return
+ }
+ for _, rrr := range rr {
+ resA = append(resA, &tengo.String{Value: rrr})
+ }
+
// Probably can be improved but as of now just joining all extractors with new line
- res = &tengo.String{Value: strings.Join(r.([]string), "\n")}
+ res = &tengo.Array{Value: resA}
return
}
