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

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

Fix frontend appearance

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