mirror of
https://github.com/nodejs/node.git
synced 2025-05-17 23:45:33 +00:00

PR-URL: https://github.com/nodejs/node/pull/32495 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gus Caplan <me@gus.host>
9 lines
191 B
JavaScript
9 lines
191 B
JavaScript
'use strict';
|
|
const stringWidth = require('string-width');
|
|
|
|
module.exports = input => {
|
|
let max = 0;
|
|
for (const s of input.split('\n')) max = Math.max(max, stringWidth(s));
|
|
return max;
|
|
};
|