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

Method write

js/js.go:91–101  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

89}
90
91func (m *jsMinifier) write(b []byte) {
92 // 0 < len(b)
93 if m.needsSpace && js.IsIdentifierContinue(b) || m.spaceBefore == b[0] {
94 m.w.Write(spaceBytes)
95 }
96 m.w.Write(b)
97 m.prev = b
98 m.needsSpace = false
99 m.expectExpr = expectAny
100 m.spaceBefore = 0
101}
102
103func (m *jsMinifier) writeSpaceAfterIdent() {
104 // space after identifier and after regular expression (to prevent confusion with its tag)

Callers 15

minifyStmtMethod · 0.95
minifyBlockStmtMethod · 0.95
minifyBlockAsStmtMethod · 0.95
minifyStmtOrBlockMethod · 0.95
minifyAliasMethod · 0.95
minifyParamsMethod · 0.95
minifyArgumentsMethod · 0.95
minifyVarDeclMethod · 0.95
minifyFuncDeclMethod · 0.95
minifyMethodDeclMethod · 0.95
minifyArrowFuncMethod · 0.95

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected