source: frontend/node_modules/prompts/dist/util/lines.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 326 bytes
Line 
1'use strict';
2
3const strip = require('./strip');
4/**
5 * @param {string} msg
6 * @param {number} perLine
7 */
8
9
10module.exports = function (msg, perLine) {
11 let lines = String(strip(msg) || '').split(/\r?\n/);
12 if (!perLine) return lines.length;
13 return lines.map(l => Math.ceil(l.length / perLine)).reduce((a, b) => a + b);
14};
Note: See TracBrowser for help on using the repository browser.