UNPKG

react-carousel-query

Version:

A infinite carousel component made with react that handles the pagination for you.

17 lines (12 loc) 322 B
'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;