MCPcopy Create free account
hub / github.com/buke/quickjs-go / JSONStringify

Method JSONStringify

value.go:151–156  ·  view source on GitHub ↗

JSONStringify returns the JSON string representation of the value.

()

Source from the content-addressed store, hash-verified

149
150// JSONStringify returns the JSON string representation of the value.
151func (v *Value) JSONStringify() string {
152 ref := C.JS_JSONStringify(v.ctx.ref, v.ref, C.JS_NewNull(), C.JS_NewNull())
153 ptr := C.JS_ToCString(v.ctx.ref, ref)
154 defer C.JS_FreeCString(v.ctx.ref, ptr)
155 return C.GoString(ptr)
156}
157
158func (v *Value) ToByteArray(size uint) ([]byte, error) {
159 if v.ByteLen() < int64(size) {

Callers 3

ToErrorMethod · 0.95
TestValueJSONFunction · 0.80
TestValueSpecialTypesFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestValueJSONFunction · 0.64
TestValueSpecialTypesFunction · 0.64