isSingleLineString.js 249 B

123456789101112
  1. 'use strict';
  2. /**
  3. * Check if a string is a single line (i.e. does not contain
  4. * any newline characters).
  5. *
  6. * @param {string} input
  7. * @return {boolean}
  8. */
  9. module.exports = function isSingleLineString(input) {
  10. return !/[\n\r]/.test(input);
  11. };