0.0.3 • Published 4 years ago
string2rect v0.0.3
import s2r from 'string2react'
const str = `
a a a b
a a a c
d d d
`;
s2r(str)
/*
{ '$$maxWidth': 4,
'$$maxHeight': 3,
a:
{ width: 4,
height: 2,
index: 1,
startRowIndex: 0,
startColIndex: 0 },
b:
{ width: 1,
height: 1,
index: 0,
startRowIndex: 0,
startColIndex: 3 },
c:
{ width: 1,
height: 1,
index: 1,
startRowIndex: 1,
startColIndex: 3 },
d:
{ width: 3,
height: 1,
index: 2,
startRowIndex: 2,
startColIndex: 0 } }
*/