parse-static-imports
Version:
Gracefully parse ECMAScript static imports 💃
13 lines (11 loc) • 389 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = removeBlockComments;
function removeBlockComments(str = "") {
return str.split("/*").map(maybeBlockComment => {
const endBlockIdx = maybeBlockComment.indexOf("*/");
return endBlockIdx >= 0 ? maybeBlockComment.substring(endBlockIdx + 2).trim() : maybeBlockComment;
}).join("");
}