punchcard-semantic-release
Version:
Punchcard style commits for Semantic Release
20 lines (15 loc) • 334 B
JavaScript
;
/*
* Splits emoji out of a commit message
*/
const getEmoji = (message) => {
const pattern = /^((:(\w+):)*) /;
const match = pattern.exec(message);
if (!match) {
return null;
}
return match[1].split('::').map(e => {
return `:${e.replace(/:/g, '')}:`;
});
};
module.exports.getEmoji = getEmoji;