This commit is contained in:
14
node_modules/micromark/lib/util/size-chunks.mjs
generated
vendored
Normal file
14
node_modules/micromark/lib/util/size-chunks.mjs
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
export default sizeChunks
|
||||
|
||||
// Measure the number of character codes in chunks.
|
||||
// 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
|
||||
}
|
||||
Reference in New Issue
Block a user