mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-18 03:55:32 +00:00
20 lines
725 B
JavaScript
20 lines
725 B
JavaScript
// NOTICE: This file is generated by Rollup. To modify it,
|
|
// please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
|
|
'use strict';
|
|
|
|
/**
|
|
* Ensures the given rule name is appended to the provided string.
|
|
*
|
|
* If the string does not already end with the rule name in parentheses, the rule name is appended in parentheses.
|
|
*
|
|
* @param {string} string - The message to which the rule name may be appended
|
|
* @param {string} ruleName - The rule name to append
|
|
*
|
|
* @returns {string} The provided string with the given rule name appended
|
|
*/
|
|
function appendRuleName(string, ruleName) {
|
|
return !string.endsWith(`(${ruleName})`) ? `${string} (${ruleName})` : string;
|
|
}
|
|
|
|
module.exports = appendRuleName;
|