mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 21:35:23 +00:00
33 lines
555 B
Go
33 lines
555 B
Go
|
|
package bytes
|
||
|
|
|
||
|
|
import (
|
||
|
|
lib_bytes "github.com/projectdiscovery/nuclei/v2/pkg/js/libs/bytes"
|
||
|
|
|
||
|
|
"github.com/dop251/goja"
|
||
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/js/gojs"
|
||
|
|
)
|
||
|
|
|
||
|
|
var (
|
||
|
|
module = gojs.NewGojaModule("nuclei/bytes")
|
||
|
|
)
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
module.Set(
|
||
|
|
gojs.Objects{
|
||
|
|
// Functions
|
||
|
|
"NewBuffer": lib_bytes.NewBuffer,
|
||
|
|
|
||
|
|
// Var and consts
|
||
|
|
|
||
|
|
// Types (value type)
|
||
|
|
"Buffer": func() lib_bytes.Buffer { return lib_bytes.Buffer{} },
|
||
|
|
|
||
|
|
// Types (pointer type)
|
||
|
|
},
|
||
|
|
).Register()
|
||
|
|
}
|
||
|
|
|
||
|
|
func Enable(runtime *goja.Runtime) {
|
||
|
|
module.Enable(runtime)
|
||
|
|
}
|