UNPKG

svg-paper

Version:

The world's most maintainable way to create paper-printable documents 🖨💘

17 lines (13 loc) • 299 B
import subStringByWidth from './sub-string-by-width' export default (string, width) => { let splits = [] while (true) { let split = subStringByWidth(string, 0, width) splits.push(split) string = string.replace(split, '') if (!string) { break } } return splits }