_serializeMappings() {
    let previousGeneratedColumn = 0
    let previousGeneratedLine = 1
    let previousOriginalColumn = 0
    let previousOriginalLine = 0
    let previousName = 0
    let previousSource = 0
    let result = ''
    let next
    let mapping
    let nameIdx
    let sourceIdx

    const mappings = this._mappings.toArray()
    for (let i = 0, len = mappings.length; i < len; i++) {
      mapping = mappings[i]
      next = ''

      if (mapping.generatedLine !== previousGeneratedLine) {
        previousGeneratedColumn = 0
        while (mapping.generatedLine !== previousGeneratedLine) {
          next += ';'
          previousGeneratedLine++
        }
      } else if (i > 0) {
        if (
          !util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])
        ) {
          continue
        }
        next += ','
      }

      next += base64VLQ.encode(
        mapping.generatedColumn - previousGeneratedColumn
      )
      previousGeneratedColumn = mapping.generatedColumn

      if (mapping.source != null) {
        sourceIdx = this._sources.indexOf(mapping.source)
        next += base64VLQ.encode(sourceIdx - previousSource)
        previousSource = sourceIdx

        // lines are stored 0-based in SourceMap spec version 3
        next += base64VLQ.encode(
          mapping.originalLine - 1 - previousOriginalLine
        )
        previousOriginalLine = mapping.originalLine - 1

        next += base64VLQ.encode(
          mapping.originalColumn - previousOriginalColumn
        )
        previousOriginalColumn = mapping.originalColumn

        if (mapping.name != null) {
          nameIdx = this._names.indexOf(mapping.name)
          next += base64VLQ.encode(nameIdx - previousName)
          previousName = nameIdx
        }
      }

      result += next
    }

    return result
  }
Serialize the accumulated mappings in to the stream of base 64 VLQs
specified by the source map format.