MCPcopy Create free account
hub / github.com/Rich-Harris/magic-string / length

Method length

src/Bundle.ts:339–346  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

337 }
338
339 length(): number {
340 return this.sources.reduce((length, source, i) => {
341 // mirrors toString(): every source but the first is preceded by a separator
342 const separator = source.separator !== undefined ? source.separator : this.separator
343
344 return length + (i > 0 ? separator.length : 0) + source.content.toString().length
345 }, this.intro.length)
346 }
347
348 trimLines(): this {
349 return this.trim('[\\r\\n]')

Callers 2

Bundle.test.tsFile · 0.45

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected