Questionnaire-of-the-Facebo.../node_modules/widest-line/index.js

17 lines
322 B
JavaScript
Raw Normal View History

2021-03-11 01:43:28 +00:00
'use strict';
const stringWidth = require('string-width');
const widestLine = input => {
let max = 0;
for (const line of input.split('\n')) {
max = Math.max(max, stringWidth(line));
}
return max;
};
module.exports = widestLine;
// TODO: remove this in the next major version
module.exports.default = widestLine;