sourcemap

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const ContentType = "application/x-checkend-sourcemap-index"

ContentType is the content type of an index upload.

Variables

This section is empty.

Functions

func Build

func Build(data []byte) ([]byte, error)

Build makes the index of a source map (the JSON text). The error is an *InvalidError.

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

Jump to

Keyboard shortcuts

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