mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-10 13:44:39 +08:00
DISABLE_THIRD_PARTY_CHECK=NPM update R=jacktfranklin@chromium.org Bug: none Change-Id: I41b7006f336b9465677cc7434abd70a732c58221 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2692907 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
15 lines
345 B
JavaScript
15 lines
345 B
JavaScript
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
|
|
}
|