@stylistic/stylelint-plugin
Version:
A collection of stylistic/formatting Stylelint rules
9 lines (8 loc) • 299 B
JavaScript
/**
* Checks if a string is a single line (i.e. does not contain any newline characters).
* @param {string} input - The string to check.
* @returns {boolean} True if the string is a single line, false otherwise.
*/
export function isSingleLineString (input) {
return !(/[\n\r]/u).test(input)
}