the editable site (validation-lab)
This commit is contained in:
commit
3ac81d5a52
13454 files changed
+2227005
No files matched your search
+11
@@ -0,0 +1,11 @@
|
||||
import stringWidth from 'string-width';
|
||||
|
||||
export default function widestLine(string) {
|
||||
let lineWidth = 0;
|
||||
|
||||
for (const line of string.split('\n')) {
|
||||
lineWidth = Math.max(lineWidth, stringWidth(line));
|
||||
}
|
||||
|
||||
return lineWidth;
|
||||
}
|
||||
Reference in new issue
Block a user