Skip to content

Commit 758de4b

Browse files
committed
Makes geteventlisteners only save files when there's something to save
1 parent 66741af commit 758de4b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

geteventlisteners/main.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,13 @@ func main() {
113113
}
114114
}
115115

116-
if !first {
117-
buf.WriteString("})()")
116+
if first {
117+
// we didn't find any matching event listeners
118+
continue
118119
}
119120

121+
buf.WriteString("})()")
122+
120123
raw := buf.String()
121124
options := jsbeautifier.DefaultOptions()
122125
out, err := jsbeautifier.Beautify(&raw, options)

0 commit comments

Comments
 (0)