Files
coopgo/node_modules/micromark/lib/util/size-chunks.js
sgauthier 6e64e138e2
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
planning
2024-10-14 09:15:30 +02:00

17 lines
361 B
JavaScript

'use strict'
// 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
}
module.exports = sizeChunks