Packages
moon
2.90.4
2.90.5
retired
2.90.4
2.90.3
2.90.2
2.90.1
2.90.0
2.89.4
2.89.1
2.89.0
2.88.0
2.87.11
2.87.10
2.87.9
2.87.8
2.87.7
2.87.6
2.87.5
2.87.4
2.87.3
2.87.2
2.87.1
2.87.0
2.86.1
2.86.0
2.85.1
2.85.0
2.84.0
2.83.0
2.82.0
2.81.4
2.81.3
2.81.2
2.81.1
2.81.0
2.80.2
2.80.1
2.80.0
2.79.13
2.79.12
2.79.11
2.79.10
2.79.9
2.79.8
2.79.7
2.79.6
2.79.5
2.79.4
2.79.3
2.79.2
2.79.1
2.79.0
2.78.4
2.78.3
2.78.2
2.78.1
2.78.0
2.77.0
2.76.5
2.76.4
2.76.3
2.76.2
2.76.1
2.76.0
2.75.0
2.74.1
2.74.0
2.73.8
2.73.7
2.73.6
2.73.5
2.73.4
2.73.3
2.73.2
2.73.1
2.73.0
2.72.5
2.72.4
2.72.3
2.72.2
2.72.1
2.72.0
2.71.1
2.71.0
2.70.0
2.69.2
2.69.1
2.69.0
2.68.11
2.68.10
Components-based design system written in elixir
Current section
Files
Jump to
Current section
Files
assets/node_modules/@jridgewell/sourcemap-codec/README.md
# @jridgewell/sourcemap-codecEncode/decode the `mappings` property of a [sourcemap](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit).## Why?Sourcemaps are difficult to generate and manipulate, because the `mappings` property – the part that actually links the generated code back to the original source – is encoded using an obscure method called [Variable-length quantity](https://en.wikipedia.org/wiki/Variable-length_quantity). On top of that, each segment in the mapping contains offsets rather than absolute indices, which means that you can't look at a segment in isolation – you have to understand the whole sourcemap.This package makes the process slightly easier.## Installation```bashnpm install @jridgewell/sourcemap-codec```## Usage```jsimport { encode, decode } from '@jridgewell/sourcemap-codec';var decoded = decode( ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' );assert.deepEqual( decoded, [ // the first line (of the generated code) has no mappings, // as shown by the starting semi-colon (which separates lines) [], // the second line contains four (comma-separated) segments [ // segments are encoded as you'd expect: // [ generatedCodeColumn, sourceIndex, sourceCodeLine, sourceCodeColumn, nameIndex ] // i.e. the first segment begins at column 2, and maps back to the second column // of the second line (both zero-based) of the 0th source, and uses the 0th // name in the `map.names` array [ 2, 0, 2, 2, 0 ], // the remaining segments are 4-length rather than 5-length, // because they don't map a name [ 4, 0, 2, 4 ], [ 6, 0, 2, 5 ], [ 7, 0, 2, 7 ] ], // the final line contains two segments [ [ 2, 1, 10, 19 ], [ 12, 1, 11, 20 ] ]]);var encoded = encode( decoded );assert.equal( encoded, ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' );```## Benchmarks```node v18.0.0amp.js.map - 45120 segmentsDecode Memory Usage:@jridgewell/sourcemap-codec 5479160 bytessourcemap-codec 5659336 bytessource-map-0.6.1 17144440 bytessource-map-0.8.0 6867424 bytesSmallest memory usage is @jridgewell/sourcemap-codecDecode speed:decode: @jridgewell/sourcemap-codec x 502 ops/sec ±1.03% (90 runs sampled)decode: sourcemap-codec x 445 ops/sec ±0.97% (92 runs sampled)decode: source-map-0.6.1 x 36.01 ops/sec ±1.64% (49 runs sampled)decode: source-map-0.8.0 x 367 ops/sec ±0.04% (95 runs sampled)Fastest is decode: @jridgewell/sourcemap-codecEncode Memory Usage:@jridgewell/sourcemap-codec 1261620 bytessourcemap-codec 9119248 bytessource-map-0.6.1 8968560 bytessource-map-0.8.0 8952952 bytesSmallest memory usage is @jridgewell/sourcemap-codecEncode speed:encode: @jridgewell/sourcemap-codec x 738 ops/sec ±0.42% (98 runs sampled)encode: sourcemap-codec x 238 ops/sec ±0.73% (88 runs sampled)encode: source-map-0.6.1 x 162 ops/sec ±0.43% (84 runs sampled)encode: source-map-0.8.0 x 191 ops/sec ±0.34% (90 runs sampled)Fastest is encode: @jridgewell/sourcemap-codec***babel.min.js.map - 347793 segmentsDecode Memory Usage:@jridgewell/sourcemap-codec 35338184 bytessourcemap-codec 35922736 bytessource-map-0.6.1 62366360 bytessource-map-0.8.0 44337416 bytesSmallest memory usage is @jridgewell/sourcemap-codecDecode speed:decode: @jridgewell/sourcemap-codec x 40.35 ops/sec ±4.47% (54 runs sampled)decode: sourcemap-codec x 36.76 ops/sec ±3.67% (51 runs sampled)decode: source-map-0.6.1 x 4.44 ops/sec ±2.15% (16 runs sampled)decode: source-map-0.8.0 x 59.35 ops/sec ±0.05% (78 runs sampled)Fastest is decode: source-map-0.8.0Encode Memory Usage:@jridgewell/sourcemap-codec 7212604 bytessourcemap-codec 21421456 bytessource-map-0.6.1 25286888 bytessource-map-0.8.0 25498744 bytesSmallest memory usage is @jridgewell/sourcemap-codecEncode speed:encode: @jridgewell/sourcemap-codec x 112 ops/sec ±0.13% (84 runs sampled)encode: sourcemap-codec x 30.23 ops/sec ±2.76% (53 runs sampled)encode: source-map-0.6.1 x 19.43 ops/sec ±3.70% (37 runs sampled)encode: source-map-0.8.0 x 19.40 ops/sec ±3.26% (37 runs sampled)Fastest is encode: @jridgewell/sourcemap-codec***preact.js.map - 1992 segmentsDecode Memory Usage:@jridgewell/sourcemap-codec 500272 bytessourcemap-codec 516864 bytessource-map-0.6.1 1596672 bytessource-map-0.8.0 517272 bytesSmallest memory usage is @jridgewell/sourcemap-codecDecode speed:decode: @jridgewell/sourcemap-codec x 16,137 ops/sec ±0.17% (99 runs sampled)decode: sourcemap-codec x 12,139 ops/sec ±0.13% (99 runs sampled)decode: source-map-0.6.1 x 1,264 ops/sec ±0.12% (100 runs sampled)decode: source-map-0.8.0 x 9,894 ops/sec ±0.08% (101 runs sampled)Fastest is decode: @jridgewell/sourcemap-codecEncode Memory Usage:@jridgewell/sourcemap-codec 321026 bytessourcemap-codec 830832 bytessource-map-0.6.1 586608 bytessource-map-0.8.0 586680 bytesSmallest memory usage is @jridgewell/sourcemap-codecEncode speed:encode: @jridgewell/sourcemap-codec x 19,876 ops/sec ±0.78% (95 runs sampled)encode: sourcemap-codec x 6,983 ops/sec ±0.15% (100 runs sampled)encode: source-map-0.6.1 x 5,070 ops/sec ±0.12% (102 runs sampled)encode: source-map-0.8.0 x 5,641 ops/sec ±0.17% (100 runs sampled)Fastest is encode: @jridgewell/sourcemap-codec***react.js.map - 5726 segmentsDecode Memory Usage:@jridgewell/sourcemap-codec 734848 bytessourcemap-codec 954200 bytessource-map-0.6.1 2276432 bytessource-map-0.8.0 955488 bytesSmallest memory usage is @jridgewell/sourcemap-codecDecode speed:decode: @jridgewell/sourcemap-codec x 5,723 ops/sec ±0.12% (98 runs sampled)decode: sourcemap-codec x 4,555 ops/sec ±0.09% (101 runs sampled)decode: source-map-0.6.1 x 437 ops/sec ±0.11% (93 runs sampled)decode: source-map-0.8.0 x 3,441 ops/sec ±0.15% (100 runs sampled)Fastest is decode: @jridgewell/sourcemap-codecEncode Memory Usage:@jridgewell/sourcemap-codec 638672 bytessourcemap-codec 1109840 bytessource-map-0.6.1 1321224 bytessource-map-0.8.0 1324448 bytesSmallest memory usage is @jridgewell/sourcemap-codecEncode speed:encode: @jridgewell/sourcemap-codec x 6,801 ops/sec ±0.48% (98 runs sampled)encode: sourcemap-codec x 2,533 ops/sec ±0.13% (101 runs sampled)encode: source-map-0.6.1 x 2,248 ops/sec ±0.08% (100 runs sampled)encode: source-map-0.8.0 x 2,303 ops/sec ±0.15% (100 runs sampled)Fastest is encode: @jridgewell/sourcemap-codec```# LicenseMIT