//go:build go1.27

package util

import (
	
	
	
	
	

	
)

type JSON struct{ Value any }

func ( JSON) ( any) error {
	var  []byte

	switch v := .(type) {
	case []byte:
		 = 
	case string:
		 = unsafe.Slice(unsafe.StringData(), len())
	case int64:
		 = strconv.AppendInt(nil, , 10)
	case float64:
		 = AppendFloat(nil, , 64)
	case time.Time:
		 = append(, '"')
		 = .AppendFormat(, time.RFC3339Nano)
		 = append(, '"')
	case nil:
		 = []byte("null")
	default:
		panic(errutil.AssertErr())
	}

	return json.Unmarshal(, .Value)
}

func ( []byte,  string) ([]byte, error) {
	return jsontext.AppendQuote(, )
}