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

Method Equal

css/css.go:97–107  ·  view source on GitHub ↗

Equal returns true if both tokens are equal.

(t2 Token)

Source from the content-addressed store, hash-verified

95
96// Equal returns true if both tokens are equal.
97func (t Token) Equal(t2 Token) bool {
98 if t.TokenType == t2.TokenType && bytes.Equal(t.Data, t2.Data) && len(t.Args) == len(t2.Args) {
99 for i := 0; i < len(t.Args); i++ {
100 if !t.Args[i].Equal(t2.Args[i]) {
101 return false
102 }
103 }
104 return true
105 }
106 return false
107}
108
109// IsZero return true if a dimension, percentage, or number token is zero.
110func (t Token) IsZero() bool {

Callers 11

minifyAliasMethod · 0.80
minifyExprMethod · 0.80
isReservedMethod · 0.80
isEqualExprFunction · 0.80
isUndefinedFunction · 0.80
isFalsyFunction · 0.80
replaceEscapesFunction · 0.80
MinifyMethod · 0.80
minifyDeclarationMethod · 0.80
minifyPropertyMethod · 0.80
MinifyMethod · 0.80

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected