Documentation
¶
Overview ¶
Package sourcemap builds the compact source map index of Checkend (format v1), so that `ce sourcemaps upload` can send a prebuilt index and the server does no work. The format and the checks follow src/core/sourcemap-index.ts of the server; the tests compare the bytes with indexes that the server builds.
Index format v1, little-endian; u32 = unsigned 32-bit, i32 = signed 32-bit:
header 9 x u32: magic "CKSI", version, lines, segments, sources, names,
source name bytes, name bytes, content bytes
lineStarts u32[lines + 1] the first segment of each generated line
segments i32[segments * 5] generated column, source (-1: none), original line,
original column, name (-1: none); all 0-based
sourceEnds u32[sources + 1] offsets into the source name bytes
nameEnds u32[names + 1] offsets into the name bytes
contentEnds u32[sources + 1] offsets into the content bytes (empty: no content)
then the UTF-8 bytes: source names, names, contents.
Index ¶
Constants ¶
const ContentType = "application/x-checkend-sourcemap-index"
ContentType is the content type of an index upload.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InvalidError ¶
type InvalidError struct{ Msg string }
InvalidError is a source map that the server would refuse. The messages are the server's.
func (*InvalidError) Error ¶
func (e *InvalidError) Error() string