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

9 lines
292 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);
};