You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
464 B
17 lines
464 B
var map = require('./map'); |
|
var trim = require('./trim'); |
|
var regBlockCmt = /(\/\*[\s\S]*?\*\/)/gm; |
|
exports = function(str) { |
|
var ret = str.match(regBlockCmt); |
|
if (!ret) return []; |
|
ret = map(ret, function(comment) { |
|
return trim( |
|
map(comment.split('\n'), function(line) { |
|
return trim(line).replace(/^\/\*+|\*+\/$|^\*+/g, ''); |
|
}).join('\n') |
|
); |
|
}); |
|
return ret; |
|
}; |
|
|
|
module.exports = exports;
|
|
|