Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Releases: jridgewell/gen-mapping

v0.3.5

01 Mar 07:40

Choose a tag to compare

What's Changed

Full Changelog: v0.3.4...v0.3.5

v0.3.4

24 Feb 09:37

Choose a tag to compare

Full Changelog: v0.3.3...v0.3.4

v0.3.3

07 Apr 02:44

Choose a tag to compare

Full Changelog: v0.3.2...v0.3.3

v0.3.2

26 Jun 15:56

Choose a tag to compare

Internal

New Contributors

  • @ljharb made their first contribution in #4

Full Changelog: v0.3.1...v0.3.2

v0.3.1

05 May 21:59

Choose a tag to compare

v0.3.0

30 Apr 04:31

Choose a tag to compare

Breaking Changes

  • Segments are no longer sorted by sourcesIndex/sourceLine/sourceColumn/namesIndex when inserting

    Segments are still ordered by genColumn, since this affects the binary search algorithm when tracing. For the other fields, it's not clear that we should sort them. Instead, they're sorted in the order they were added to the map. This allows the maybeAdd* APIs to work.

New Features

Full Changelog: v0.2.0...v0.3.0

v0.2.0

27 Apr 18:55

Choose a tag to compare

v0.1.1

27 Apr 14:36

Choose a tag to compare

v0.1.0

27 Apr 01:04

Choose a tag to compare

import { GenMapping, addMapping, setSourceContent, encodedMap } from '@jridgewell/gen-mapping';

const map = new GenMapping({
  file: 'output.js',
  sourceRoot: 'https://example.com/',
});

setSourceContent(map, 'input.js', `function foo() {}`);

addMapping(map, {
  // Lines start at line 1, columns at column 0.
  generated: { line: 1, column: 0 },
  source: 'input.js',
  original: { line: 1, column: 0 },
});

addMapping(map, {
  generated: { line: 1, column: 9 },
  source: 'input.js',
  original: { line: 1, column: 9 },
  name: 'foo',
});

assert.deepEqual(encodedMap(map), {
  version: 3,
  file: 'output.js',
  names: ['foo'],
  sourceRoot: 'https://example.com/',
  sources: ['input.js'],
  sourcesContent: ['function foo() {}'],
  mappings: 'AAAA,SAASA',
});

Full Changelog: https://github.com/jridgewell/gen-mapping/commits/v0.1.0