@amollo-lint/commitlint-plugin-card-id
Version:
recognition and inclusion of the card ID
17 lines (14 loc) • 440 B
JavaScript
/**
* @param {string} value
* @returns {string} replace spaces with syntax <space>...<space>
*/
exports.logFormatSpace = value => {
let formatSpaceValue = value;
if (formatSpaceValue.startsWith(" ")) {
formatSpaceValue = formatSpaceValue.replace(" ", "<space>");
}
if (formatSpaceValue.endsWith(" ")) {
formatSpaceValue = formatSpaceValue.replace(/.$/, "<space>");
}
return formatSpaceValue;
};