UNPKG

micromark

Version:

small commonmark compliant markdown parser with positional info and concrete tokens

17 lines (11 loc) 310 B
'use strict' // Counts tabs based on their expanded size, and CR+LF as one character. function sizeChunks(chunks) { var index = -1 var size = 0 while (++index < chunks.length) { size += typeof chunks[index] === 'string' ? chunks[index].length : 1 } return size } module.exports = sizeChunks