1
0
mirror of https://github.com/actions/labeler synced 2026-05-06 19:57:47 +02:00
Files
labeler/node_modules/prompts/lib/util/lines.js
David Kale 91fcbb0108 build
2020-09-08 13:25:36 -04:00

12 lines
301 B
JavaScript

'use strict';
const strip = require('./strip');
module.exports = function (msg, perLine = process.stdout.columns) {
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);
};