macro | since v1.7.107 | Edit |
(js-comment comment)
Emit a top-level JavaScript multi-line comment. New lines will create a new comment line. Comment block will be preceded and followed by a newline
(core/defmacro js-comment
[comment]
(core/let [[x & ys] (string/split comment #"\n")]
(core/list 'js*
(core/str
"\n/**\n"
(core/str " * " x "\n")
(core/->> ys
(map #(core/str " * " (string/replace % #"^ " "") "\n"))
(reduce core/str ""))
" */\n"))))