MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / MarshalJSON

Method MarshalJSON

imagetype/type.go:51–58  ·  view source on GitHub ↗

MarshalJSON implements the json.Marshaler interface for Type.

()

Source from the content-addressed store, hash-verified

49
50// MarshalJSON implements the json.Marshaler interface for Type.
51func (t Type) MarshalJSON() ([]byte, error) {
52 s := t.String()
53 if s == "" {
54 return []byte("null"), nil
55 }
56
57 return fmt.Appendf(nil, "%q", s), nil
58}
59
60// IsVector checks if the image type is a vector format.
61func (t Type) IsVector() bool {

Callers

nothing calls this directly

Calls 1

StringMethod · 0.95

Tested by

no test coverage detected