diff options
Diffstat (limited to 'deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/index.js')
-rw-r--r-- | deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/index.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/index.js b/deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/index.js new file mode 100644 index 0000000000..e5baea9e91 --- /dev/null +++ b/deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/index.js @@ -0,0 +1,8 @@ +'use strict'; +var stringWidth = require('string-width'); + +module.exports = function (str) { + return Math.max.apply(null, str.split('\n').map(function (x) { + return stringWidth(x); + })); +}; |