sourcemap

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NameIndex

type NameIndex int

type RawSourceMap

type RawSourceMap struct {
	Version        int       `json:"version"`
	File           string    `json:"file"`
	SourceRoot     string    `json:"sourceRoot,omitempty"`
	Sources        []string  `json:"sources"`
	Names          []string  `json:"names,omitempty"`
	Mappings       string    `json:"mappings"`
	SourcesContent []*string `json:"sourcesContent,omitempty"`
}

type SourceIndex

type SourceIndex int

type SourceMapGenerator

type SourceMapGenerator struct {
	// contains filtered or unexported fields
}

func NewSourceMapGenerator

func NewSourceMapGenerator(file string, sourceRoot string, sourcesDirectoryPath string, options tspath.ComparePathsOptions) *SourceMapGenerator

func (*SourceMapGenerator) AddGeneratedMapping

func (gen *SourceMapGenerator) AddGeneratedMapping(generatedLine int, generatedCharacter int) error

Adds a mapping without source information

func (*SourceMapGenerator) AddName

func (gen *SourceMapGenerator) AddName(name string) NameIndex

Declares a name in the source map, returning the index of the name

func (*SourceMapGenerator) AddNamedSourceMapping

func (gen *SourceMapGenerator) AddNamedSourceMapping(generatedLine int, generatedCharacter int, sourceIndex SourceIndex, sourceLine int, sourceCharacter int, nameIndex NameIndex) error

Adds a mapping with source and name information

func (*SourceMapGenerator) AddSource

func (gen *SourceMapGenerator) AddSource(fileName string) SourceIndex

Adds a source to the source map

func (*SourceMapGenerator) AddSourceMapping

func (gen *SourceMapGenerator) AddSourceMapping(generatedLine int, generatedCharacter int, sourceIndex SourceIndex, sourceLine int, sourceCharacter int) error

Adds a mapping with source information

func (*SourceMapGenerator) RawSourceMap

func (gen *SourceMapGenerator) RawSourceMap() *RawSourceMap

Gets the source map as a `RawSourceMap` object

func (*SourceMapGenerator) SetSourceContent

func (gen *SourceMapGenerator) SetSourceContent(sourceIndex SourceIndex, content string) error

Sets the content for a source

func (*SourceMapGenerator) Sources

func (gen *SourceMapGenerator) Sources() []string

func (*SourceMapGenerator) String

func (gen *SourceMapGenerator) String() string

Gets the string representation of the source map

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL