MCPcopy
hub / github.com/tdewolff/minify / IsZero

Method IsZero

css/css.go:110–113  ·  view source on GitHub ↗

IsZero return true if a dimension, percentage, or number token is zero.

()

Source from the content-addressed store, hash-verified

108
109// IsZero return true if a dimension, percentage, or number token is zero.
110func (t Token) IsZero() bool {
111 // as each number is already minified, starting with a zero means it is zero
112 return (t.TokenType == css.DimensionToken || t.TokenType == css.PercentageToken || t.TokenType == css.NumberToken) && t.Data[0] == '0'
113}
114
115// IsLength returns true if the token is a length.
116func (t Token) IsLength() bool {

Callers 2

minifyPropertyMethod · 0.80
minifyLengthPercentageFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected