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

Method length

src/Bundle.ts:343–351  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

341 }
342
343 length(): number {
344 return this.sources.reduce((length, source, i) => {
345 // mirrors toString(): every source but the first is preceded by a separator
346 /* v8 ignore next -- addSource always normalizes source.separator */
347 const separator = source.separator !== undefined ? source.separator : this.separator
348
349 return length + (i > 0 ? separator.length : 0) + source.content.toString().length
350 }, this.intro.length)
351 }
352
353 trimLines(): this {
354 return this.trim('[\\r\\n]')

Callers 2

Bundle.test.tsFile · 0.45
misc.test.tsFile · 0.45

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected