Skip to content

Main content

Source Map Segment Field Count Tool

Compute source map segment field count from explicit bounded inputs.

Loading tool…

Description

Classify a source-map segment by its supplied field count.

A source-map segment separates field structure, signed deltas and Base64 VLQ serialization. Its sign fold is not the same as other signed integer encodings, and local field counts do not establish valid source positions.

Classify a source-map segment by its supplied field count.

When to use this tool

Use Source Map Segment Field Count when checking one explicit source-map field or sign convention.

How to use the tool and how it works

  1. Enter fields. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read kind. Use the output convention below.

Classify a source-map segment by its supplied field count. Accept only one, four or five fields, returning unmapped, mapped or named respectively.1

Source-map fields use signed delta values and Base64 VLQ conventions; one local field check does not validate a complete mapping.2

Input fieldMeaning and unitsAccepted input
fieldsFieldsRequired. Array of safe integer; maximum items 256.
Output fieldInterpretationReturned shape
kindKindRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "fields": [
      3
    ]
  },
  "output": {
    "kind": "unmapped"
  }
}

Limitations and assumptions

  • Values and deltas are not validated; a recognized count does not prove a valid mapping segment.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Use a conforming complete source-map parser and the actual source files when mapping generated code back to originals.

References

  1. Calculation and input contract: development/source-map-segment-field-count — tool.io

  2. ECMA-426: source map format — Ecma International

Similar or alternative tools