sourcemap

package module
v0.0.0-...-854c3c5 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2015 License: MIT Imports: 9 Imported by: 0

README

sourcemap

Go library for reading / writing source maps

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(dstName string, sm *SourceMap) error

func WriteFile

func WriteFile(fileName string, m *Map) error

Types

type Map

type Map struct {
	Version        int      `json:"version"`
	File           string   `json:"file,omitempty"`
	SourceRoot     string   `json:"sourceRoot,omitempty"`
	Sources        []string `json:"sources,omitempty"`
	SourcesContent []string `json:"sourcesContent,omitempty"`
	Names          []string `json:"names,omitempty"`
	Mappings       string   `json:"mappings"`
	// contains filtered or unexported fields
}

func Generate

func Generate(name string, r io.Reader) (*Map, error)

func Merge

func Merge(name string, maps ...*Map) *Map

func ReadFile

func ReadFile(fileName string) (*Map, error)

func (*Map) DecodedMappings

func (m *Map) DecodedMappings() []Mapping

type Mapping

type Mapping struct {
	GeneratedLine   int
	GeneratedColumn int
	SourceIndex     int
	SourceLine      int
	SourceColumn    int
	NameIndex       int
}

type RuneReader

type RuneReader interface {
	ReadRune() (r rune, size int, err error)
}

type RuneWriter

type RuneWriter interface {
	WriteRune(r rune) (size int, err error)
}

type Segment

type Segment struct {
	GeneratedLine   int
	GeneratedColumn int
	SourceIndex     int
	SourceLine      int
	SourceColumn    int
	NameIndex       int
}

type SourceMap

type SourceMap struct {
	File           string
	Mappings       [][]Segment
	Sources        []string
	SourcesContent []string
	Names          []string
	// contains filtered or unexported fields
}

func Read

func Read(srcName string) (*SourceMap, error)

func (*SourceMap) UnmarshalJSON

func (sm *SourceMap) UnmarshalJSON(data []byte) error

type Writer

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

func NewWriter

func NewWriter(w io.Writer, file string, sources []string) (*Writer, error)

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) NextSource

func (w *Writer) NextSource() error

func (*Writer) WriteGeneratedLine

func (w *Writer) WriteGeneratedLine(segments ...Segment) error

func (*Writer) WriteSourceLine

func (w *Writer) WriteSourceLine(line string) error

Jump to

Keyboard shortcuts

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