MCPcopy Index your code
hub / github.com/tdewolff/minify / Minify

Method Minify

minify.go:206–209  ·  view source on GitHub ↗

Minify minifies the content of a Reader and writes it to a Writer (safe for concurrent use). An error is returned when no such mimetype exists (ErrNotExist) or when an error occurred in the minifier function. Mediatype may take the form of 'text/plain', 'text/*', '*/*' or 'text/plain; charset=UTF-8;

(mediatype string, w io.Writer, r io.Reader)

Source from the content-addressed store, hash-verified

204// An error is returned when no such mimetype exists (ErrNotExist) or when an error occurred in the minifier function.
205// Mediatype may take the form of 'text/plain', 'text/*', '*/*' or 'text/plain; charset=UTF-8; version=2.0'.
206func (m *M) Minify(mediatype string, w io.Writer, r io.Reader) error {
207 mimetype, params := parse.Mediatype([]byte(mediatype))
208 return m.MinifyMimetype(mimetype, w, r, params)
209}
210
211// MinifyMimetype minifies the content of a Reader and writes it to a Writer (safe for concurrent use).
212// It is a lower level version of Minify and requires the mediatype to be split up into mimetype and parameters.

Callers 4

BytesMethod · 0.95
StringMethod · 0.95
ReaderMethod · 0.95
WriterMethod · 0.95

Calls 1

MinifyMimetypeMethod · 0.95

Tested by

no test coverage detected