Files
hackathon-v-escape-4ff8b5a6…/frontend/node_modules/prompts/dist/util/lines.js
marianesaldana 80dbd947e5 Initial commit
2026-05-23 08:59:34 -06:00

14 lines
326 B
JavaScript

'use strict';
const strip = require('./strip');
/**
* @param {string} msg
* @param {number} perLine
*/
module.exports = function (msg, perLine) {
let lines = String(strip(msg) || '').split(/\r?\n/);
if (!perLine) return lines.length;
return lines.map(l => Math.ceil(l.length / perLine)).reduce((a, b) => a + b);
};