Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
projectdiscovery
GitHub Repository: projectdiscovery/nuclei
Path: blob/dev/pkg/utils/json/json.go
2843 views
1
//go:build (linux || darwin || windows) && (amd64 || arm64)
2
3
package json
4
5
import "github.com/bytedance/sonic"
6
7
var api = sonic.ConfigStd
8
9
// Exported functions from the [sonic.API].
10
var (
11
Marshal = api.Marshal
12
Unmarshal = api.Unmarshal
13
MarshalIndent = api.MarshalIndent
14
NewDecoder = api.NewDecoder
15
NewEncoder = api.NewEncoder
16
)
17
18
// Encoder is a JSON encoder.
19
type Encoder = sonic.Encoder
20
21
// Decoder is a JSON decoder.
22
type Decoder = sonic.Decoder
23
24
// SetConfig sets the configuration for the JSON package.
25
func SetConfig(config *sonic.Config) {
26
api = config.Froze()
27
}
28
29