Options
All
  • Public
  • Public/Protected
  • All
Menu

@bloomberg/pasta-sourcemaps

Index

Classes

Interfaces

Type aliases

Functions

Type aliases

FileType

FileType: "TypeScript" | "ECMAScript" | "TSX" | "JSX"

Functions

encode

  • Produces a PASTA enriched source map based on the input source map and the input function descriptions. The enriched source map differs from the input source map in these two ways:

    1) Any function names not already present in the names field get appended to it 2) The function descriptions for each source get encoded into Base64 VLQ encoding, and the encoded values get added to the x_com_bloomberg_sourcesFunctionMappings field.

    throws

    if functionDescs for a source contains partial overlaps

    Parameters

    • sourceMap: SourceMap

      input source map

    • functionDescs: Map<string, FunctionDesc[]>

      a map of function descriptions for each source in the source map. The keys in the map must match elements in source map sources exactly.

    Returns EnrichedSourceMap

    PASTA enriched source map

parse

  • Parse a source file and return descriptions of all functions present in the source file. Each description includes the name of the function, and start and end coordinates. For anonymous functions the name is "".

    throws

    if the filetype is not supported, or if the source file cannot be parsed.

    Parameters

    • source: string

      the contents of a source file

    • filetype: FileType

      the type of the source file (e.g. ECMAScript or TypeScript)

    Returns FunctionDesc[]

Generated using TypeDoc