Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jridgewell/sourcemap-codec

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jridgewell/sourcemap-codec - npm Package Compare versions

Comparing version 1.4.15 to 1.4.16-beta.0

dist/types/scopes.d.ts

491

dist/sourcemap-codec.umd.js

@@ -7,4 +7,2 @@ (function (global, factory) {

const comma = ','.charCodeAt(0);
const semicolon = ';'.charCodeAt(0);
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';

@@ -18,2 +16,72 @@ const intToChar = new Uint8Array(64); // 64 possible chars.

}
const comma = ','.charCodeAt(0);
const semicolon = ';'.charCodeAt(0);
function hasMoreVlq(mappings, i, length) {
if (i >= length)
return false;
return mappings.charCodeAt(i) !== comma;
}
function indexOf(mappings, char, index) {
const idx = mappings.indexOf(char, index);
return idx === -1 ? mappings.length : idx;
}
let posOut = 0;
function resetPos() {
posOut = 0;
}
function decodeFirstOctet(mappings, pos) {
const c = mappings.charCodeAt(pos);
let value = charToInt[c];
const shouldNegate = value & 1;
value >>>= 1;
if (shouldNegate) {
value = -0x80000000 | -value;
}
return value;
}
function decodeInteger(mappings, pos, relative) {
let value = 0;
let shift = 0;
let integer = 0;
do {
const c = mappings.charCodeAt(pos++);
integer = charToInt[c];
value |= (integer & 31) << shift;
shift += 5;
} while (integer & 32);
const shouldNegate = value & 1;
value >>>= 1;
if (shouldNegate) {
value = -0x80000000 | -value;
}
posOut = pos;
return relative + value;
}
function encodeInteger(buf, pos, num, relative) {
let delta = num - relative;
delta = delta < 0 ? (-delta << 1) | 1 : delta << 1;
do {
let clamped = delta & 0b011111;
delta >>>= 5;
if (delta > 0)
clamped |= 0b100000;
buf[pos++] = intToChar[clamped];
} while (delta > 0);
posOut = pos;
return num;
}
function maybeFlush(build, buf, pos, copy, length) {
if (pos < length) {
posOut = pos;
return build;
}
const out = td.decode(buf);
copy.copyWithin(0, length, pos);
posOut = pos - length;
return build + out;
}
function write(buf, pos, value) {
buf[pos] = value;
posOut = pos + 1;
}
// Provide a fallback for older environments.

@@ -38,33 +106,327 @@ const td = typeof TextDecoder !== 'undefined'

};
const NO_NAME = -1;
const NO_SOURCE = -1;
function decodeOriginalScopes(input) {
let line = 0;
const scopes = [];
const stack = [];
for (let i = 0; i < input.length; i = posOut + 1) {
line = decodeInteger(input, i, line);
const column = decodeInteger(input, posOut, 0);
if (!hasMoreVlq(input, posOut, input.length)) {
const last = stack.pop();
last[2] = line;
last[3] = column;
continue;
}
const kind = decodeInteger(input, posOut, 0);
const fields = decodeInteger(input, posOut, 0);
const name = fields & 0b0001 ? decodeInteger(input, posOut, 0) : NO_NAME;
const scope = name === NO_NAME ? [line, column, 0, 0, kind] : [line, column, 0, 0, kind, name];
scopes.push(scope);
stack.push(scope);
const index = indexOf(input, ',', posOut);
if (posOut < index) {
const vars = [];
scope.vars = vars;
while (posOut < index) {
const varsIndex = decodeInteger(input, posOut, 0);
vars.push(varsIndex);
}
}
}
return scopes;
}
function encodeOriginalScopes(scopes) {
let out = '';
if (scopes.length === 0)
return out;
const bufLength = 1024 * 16;
const subLength = bufLength - (7 * 6 + 1);
const buf = new Uint8Array(bufLength);
const sub = buf.subarray(0, subLength);
resetPos();
const endStack = [];
let lastEndLine = scopes[0][2] + 1;
let lastEndColumn = scopes[0][3];
let line = 0;
for (let i = 0; i < scopes.length; i++) {
const scope = scopes[i];
const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind } = scope;
const name = scope.length === 6 ? scope[5] : NO_NAME;
const vars = 'vars' in scope ? scope.vars : [];
out = maybeFlush(out, buf, posOut, buf, bufLength);
if (i > 0)
write(buf, posOut, comma);
while (startLine > lastEndLine || (startLine === lastEndLine && startColumn >= lastEndColumn)) {
out = maybeFlush(out, sub, posOut, buf, subLength);
line = encodeInteger(buf, posOut, lastEndLine, line);
encodeInteger(buf, posOut, lastEndColumn, 0);
write(buf, posOut, comma);
lastEndColumn = endStack.pop();
lastEndLine = endStack.pop();
}
line = encodeInteger(buf, posOut, startLine, line);
encodeInteger(buf, posOut, startColumn, 0);
endStack.push(lastEndLine);
endStack.push(lastEndColumn);
lastEndLine = endLine;
lastEndColumn = endColumn;
encodeInteger(buf, posOut, kind, 0);
const fields = name === NO_NAME ? 0 : 1;
encodeInteger(buf, posOut, fields, 0);
if (name !== NO_NAME)
encodeInteger(buf, posOut, name, 0);
for (const v of vars) {
out = maybeFlush(out, sub, posOut, buf, subLength);
encodeInteger(buf, posOut, v, 0);
}
}
while (endStack.length > 0) {
out = maybeFlush(out, sub, posOut, buf, subLength);
write(buf, posOut, comma);
line = encodeInteger(buf, posOut, lastEndLine, line);
encodeInteger(buf, posOut, lastEndColumn, 0);
lastEndColumn = endStack.pop();
lastEndLine = endStack.pop();
}
return out + td.decode(buf.subarray(0, posOut));
}
function decodeGeneratedRanges(input) {
let genLine = 0;
let genColumn = 0;
let definitionSourcesIndex = 0;
let definitionScopeIndex = 0;
let callsiteSourcesIndex = 0;
let callsiteLine = 0;
let callsiteColumn = 0;
let bindingLine = 0;
let bindingColumn = 0;
const ranges = [];
const stack = [];
let index = 0;
do {
const semi = indexOf(input, ';', index);
genColumn = 0;
for (let i = index; i < semi; i = posOut + 1) {
genColumn = decodeInteger(input, i, genColumn);
if (hasMoreVlq(input, posOut, semi)) {
const fields = decodeInteger(input, posOut, 0);
let defSourcesIndex = NO_SOURCE;
let defScopeIndex = NO_SOURCE;
if (fields & 0b0001) {
defSourcesIndex = decodeInteger(input, posOut, definitionSourcesIndex);
if (definitionSourcesIndex !== defSourcesIndex) {
definitionScopeIndex = 0;
definitionSourcesIndex = defSourcesIndex;
}
defScopeIndex = definitionScopeIndex = decodeInteger(input, posOut, definitionScopeIndex);
}
const range = [genLine, genColumn, 0, 0, defSourcesIndex, defScopeIndex];
if (fields & 0b0010) {
const callSourcesIndex = decodeInteger(input, posOut, callsiteSourcesIndex);
const sameSource = callSourcesIndex === callsiteSourcesIndex;
const callLine = decodeInteger(input, posOut, sameSource ? callsiteLine : 0);
const sameLine = sameSource && callLine === callsiteLine;
callsiteColumn = decodeInteger(input, posOut, sameLine ? callsiteColumn : 0);
callsiteSourcesIndex = callSourcesIndex;
callsiteLine = callLine;
range.callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn];
}
if (fields & 0b0100) {
range.isScope = true;
}
if (hasMoreVlq(input, posOut, semi)) {
const bindings = [];
range.bindings = bindings;
do {
bindingLine = genLine;
bindingColumn = genColumn;
let name = decodeInteger(input, posOut, 0);
const hasExpressions = decodeFirstOctet(input, posOut);
const binding = [[name]];
bindings.push(binding);
if (hasExpressions < -1) {
const expressionsCount = decodeInteger(input, posOut, 0);
for (let i = -1; i > expressionsCount; i--) {
const prevBindingLine = bindingLine;
bindingLine = decodeInteger(input, posOut, bindingLine);
bindingColumn = decodeInteger(input, posOut, bindingLine === prevBindingLine ? bindingColumn : 0);
name = decodeInteger(input, posOut, 0);
}
binding.push([name, bindingLine, bindingColumn]);
}
} while (hasMoreVlq(input, posOut, semi));
}
ranges.push(range);
stack.push(range);
}
else {
const range = stack.pop();
range[2] = genLine;
range[3] = genColumn;
}
}
genLine++;
index = semi + 1;
} while (index <= input.length);
return ranges;
}
function encodeGeneratedRanges(ranges) {
let out = '';
if (ranges.length === 0)
return out;
const bufLength = 1024 * 16;
const subLength = bufLength - (7 * 7 + 1);
const buf = new Uint8Array(bufLength);
const sub = buf.subarray(0, subLength);
resetPos();
const endStack = [];
let lastEndLine = ranges[0][2] + 1;
let lastEndColumn = ranges[0][3];
let line = 0;
let genColumn = 0;
let definitionSourcesIndex = 0;
let definitionScopeIndex = 0;
let callsiteSourcesIndex = 0;
let callsiteLine = 0;
let callsiteColumn = 0;
for (let i = 0; i < ranges.length; i++) {
const range = ranges[i];
const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: defSourcesIndex, 5: defScopeIndex, } = range;
const isScope = 'isScope' in range && range.isScope;
const hasCallsite = 'callsite' in range;
const hasBindings = 'bindings' in range;
while (startLine > lastEndLine || (startLine === lastEndLine && startColumn >= lastEndColumn)) {
if (line < lastEndLine) {
out = catchupLine(out, buf, bufLength, line, lastEndLine);
line = lastEndLine;
genColumn = 0;
}
else {
out = maybeFlush(out, buf, posOut, buf, bufLength);
write(buf, posOut, comma);
}
out = maybeFlush(out, sub, posOut, buf, subLength);
genColumn = encodeInteger(buf, posOut, lastEndColumn, genColumn);
lastEndColumn = endStack.pop();
lastEndLine = endStack.pop();
}
if (line < startLine) {
out = catchupLine(out, buf, bufLength, line, startLine);
line = startLine;
genColumn = 0;
}
else if (i > 0) {
out = maybeFlush(out, buf, posOut, buf, bufLength);
write(buf, posOut, comma);
}
out = maybeFlush(out, sub, posOut, buf, subLength);
genColumn = encodeInteger(buf, posOut, range[1], genColumn);
endStack.push(lastEndLine);
endStack.push(lastEndColumn);
lastEndLine = endLine;
lastEndColumn = endColumn;
const fields = (defSourcesIndex === NO_SOURCE ? 0 : 0b0001) |
(hasCallsite ? 0b0010 : 0) |
(isScope ? 0b0100 : 0);
encodeInteger(buf, posOut, fields, 0);
if (defSourcesIndex !== NO_SOURCE) {
if (defSourcesIndex !== definitionSourcesIndex)
definitionScopeIndex = 0;
definitionSourcesIndex = encodeInteger(buf, posOut, defSourcesIndex, definitionSourcesIndex);
definitionScopeIndex = encodeInteger(buf, posOut, defScopeIndex, definitionScopeIndex);
}
if (hasCallsite) {
const { 0: callSourcesIndex, 1: callLine, 2: callColumn } = range.callsite;
if (callSourcesIndex !== callsiteSourcesIndex) {
callsiteLine = 0;
callsiteColumn = 0;
}
else if (callLine !== callsiteLine) {
callsiteColumn = 0;
}
callsiteSourcesIndex = encodeInteger(buf, posOut, callSourcesIndex, callsiteSourcesIndex);
callsiteLine = encodeInteger(buf, posOut, callLine, callsiteLine);
callsiteColumn = encodeInteger(buf, posOut, callColumn, callsiteColumn);
}
if (hasBindings) {
for (const binding of range.bindings) {
out = maybeFlush(out, sub, posOut, buf, subLength);
encodeInteger(buf, posOut, binding[0][0], 0);
if (binding.length > 1) {
encodeInteger(buf, posOut, -binding.length, 0);
let bindingStartLine = startLine;
let bindingStartColumn = startColumn;
for (let i = 1; i < binding.length; i++) {
out = maybeFlush(out, sub, posOut, buf, subLength);
const expression = binding[i];
bindingStartLine = encodeInteger(buf, posOut, expression[1], bindingStartLine);
bindingStartColumn = encodeInteger(buf, posOut, expression[2], bindingStartColumn);
encodeInteger(buf, posOut, expression[0], 0);
}
}
}
}
}
while (endStack.length > 0) {
if (line < lastEndLine) {
out = catchupLine(out, buf, bufLength, line, lastEndLine);
line = lastEndLine;
genColumn = 0;
}
else {
out = maybeFlush(out, buf, posOut, buf, bufLength);
write(buf, posOut, comma);
}
out = maybeFlush(out, sub, posOut, buf, subLength);
genColumn = encodeInteger(buf, posOut, lastEndColumn, genColumn);
lastEndColumn = endStack.pop();
lastEndLine = endStack.pop();
}
return out + td.decode(buf.subarray(0, posOut));
}
function catchupLine(build, buf, bufLength, lastLine, line) {
do {
build = maybeFlush(build, buf, posOut, buf, bufLength);
write(buf, posOut, semicolon);
} while (++lastLine < line);
return build;
}
function decode(mappings) {
const state = new Int32Array(5);
const decoded = [];
let genColumn = 0;
let sourcesIndex = 0;
let sourceLine = 0;
let sourceColumn = 0;
let namesIndex = 0;
let index = 0;
do {
const semi = indexOf(mappings, index);
const semi = indexOf(mappings, ';', index);
const line = [];
let sorted = true;
let lastCol = 0;
state[0] = 0;
for (let i = index; i < semi; i++) {
genColumn = 0;
for (let i = index; i < semi; i = posOut + 1) {
let seg;
i = decodeInteger(mappings, i, state, 0); // genColumn
const col = state[0];
if (col < lastCol)
genColumn = decodeInteger(mappings, i, genColumn);
if (genColumn < lastCol)
sorted = false;
lastCol = col;
if (hasMoreVlq(mappings, i, semi)) {
i = decodeInteger(mappings, i, state, 1); // sourcesIndex
i = decodeInteger(mappings, i, state, 2); // sourceLine
i = decodeInteger(mappings, i, state, 3); // sourceColumn
if (hasMoreVlq(mappings, i, semi)) {
i = decodeInteger(mappings, i, state, 4); // namesIndex
seg = [col, state[1], state[2], state[3], state[4]];
lastCol = genColumn;
if (hasMoreVlq(mappings, posOut, semi)) {
sourcesIndex = decodeInteger(mappings, posOut, sourcesIndex);
sourceLine = decodeInteger(mappings, posOut, sourceLine);
sourceColumn = decodeInteger(mappings, posOut, sourceColumn);
if (hasMoreVlq(mappings, posOut, semi)) {
namesIndex = decodeInteger(mappings, posOut, namesIndex);
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];
}
else {
seg = [col, state[1], state[2], state[3]];
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];
}
}
else {
seg = [col];
seg = [genColumn];
}

@@ -80,29 +442,2 @@ line.push(seg);

}
function indexOf(mappings, index) {
const idx = mappings.indexOf(';', index);
return idx === -1 ? mappings.length : idx;
}
function decodeInteger(mappings, pos, state, j) {
let value = 0;
let shift = 0;
let integer = 0;
do {
const c = mappings.charCodeAt(pos++);
integer = charToInt[c];
value |= (integer & 31) << shift;
shift += 5;
} while (integer & 32);
const shouldNegate = value & 1;
value >>>= 1;
if (shouldNegate) {
value = -0x80000000 | -value;
}
state[j] += value;
return pos;
}
function hasMoreVlq(mappings, i, length) {
if (i >= length)
return false;
return mappings.charCodeAt(i) !== comma;
}
function sort(line) {

@@ -115,62 +450,48 @@ line.sort(sortComparator);

function encode(decoded) {
const state = new Int32Array(5);
const bufLength = 1024 * 16;
const subLength = bufLength - 36;
// We can push up to 5 ints, each int can take at most 7 chars, and we
// may push a comma.
const subLength = bufLength - (7 * 5 + 1);
const buf = new Uint8Array(bufLength);
const sub = buf.subarray(0, subLength);
let pos = 0;
resetPos();
let out = '';
let genColumn = 0;
let sourcesIndex = 0;
let sourceLine = 0;
let sourceColumn = 0;
let namesIndex = 0;
for (let i = 0; i < decoded.length; i++) {
const line = decoded[i];
if (i > 0) {
if (pos === bufLength) {
out += td.decode(buf);
pos = 0;
}
buf[pos++] = semicolon;
}
out = maybeFlush(out, buf, posOut, buf, bufLength);
if (i > 0)
write(buf, posOut, semicolon);
if (line.length === 0)
continue;
state[0] = 0;
genColumn = 0;
for (let j = 0; j < line.length; j++) {
const segment = line[j];
// We can push up to 5 ints, each int can take at most 7 chars, and we
// may push a comma.
if (pos > subLength) {
out += td.decode(sub);
buf.copyWithin(0, subLength, pos);
pos -= subLength;
}
out = maybeFlush(out, sub, posOut, buf, subLength);
if (j > 0)
buf[pos++] = comma;
pos = encodeInteger(buf, pos, state, segment, 0); // genColumn
write(buf, posOut, comma);
genColumn = encodeInteger(buf, posOut, segment[0], genColumn);
if (segment.length === 1)
continue;
pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex
pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine
pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn
sourcesIndex = encodeInteger(buf, posOut, segment[1], sourcesIndex);
sourceLine = encodeInteger(buf, posOut, segment[2], sourceLine);
sourceColumn = encodeInteger(buf, posOut, segment[3], sourceColumn);
if (segment.length === 4)
continue;
pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex
namesIndex = encodeInteger(buf, posOut, segment[4], namesIndex);
}
}
return out + td.decode(buf.subarray(0, pos));
return out + td.decode(buf.subarray(0, posOut));
}
function encodeInteger(buf, pos, state, segment, j) {
const next = segment[j];
let num = next - state[j];
state[j] = next;
num = num < 0 ? (-num << 1) | 1 : num << 1;
do {
let clamped = num & 0b011111;
num >>>= 5;
if (num > 0)
clamped |= 0b100000;
buf[pos++] = intToChar[clamped];
} while (num > 0);
return pos;
}
exports.decode = decode;
exports.decodeGeneratedRanges = decodeGeneratedRanges;
exports.decodeOriginalScopes = decodeOriginalScopes;
exports.encode = encode;
exports.encodeGeneratedRanges = encodeGeneratedRanges;
exports.encodeOriginalScopes = encodeOriginalScopes;

@@ -177,0 +498,0 @@ Object.defineProperty(exports, '__esModule', { value: true });

@@ -0,1 +1,3 @@

export { decodeOriginalScopes, encodeOriginalScopes, decodeGeneratedRanges, encodeGeneratedRanges, } from './scopes';
export type { OriginalScope, GeneratedRange, CallSite, ExpressionBinding } from './scopes';
export declare type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number];

@@ -2,0 +4,0 @@ export declare type SourceMapLine = SourceMapSegment[];

5

package.json
{
"name": "@jridgewell/sourcemap-codec",
"version": "1.4.15",
"version": "1.4.16-beta.0",
"description": "Encode/decode sourcemap mappings",

@@ -40,3 +40,2 @@ "keywords": [

"preversion": "run-s test build",
"pretest": "run-s build:rollup",
"test": "run-s -n test:lint test:only",

@@ -59,2 +58,3 @@ "test:debug": "mocha --inspect-brk",

"@rollup/plugin-typescript": "8.3.0",
"@types/mocha": "10.0.6",
"@types/node": "17.0.15",

@@ -74,4 +74,5 @@ "@typescript-eslint/eslint-plugin": "5.10.0",

"sourcemap-codec": "1.4.8",
"tsx": "4.7.1",
"typescript": "4.5.4"
}
}

@@ -63,3 +63,3 @@ # @jridgewell/sourcemap-codec

```
node v18.0.0
node v20.10.0

@@ -69,28 +69,34 @@ amp.js.map - 45120 segments

Decode Memory Usage:
@jridgewell/sourcemap-codec 5479160 bytes
sourcemap-codec 5659336 bytes
source-map-0.6.1 17144440 bytes
source-map-0.8.0 6867424 bytes
Smallest memory usage is @jridgewell/sourcemap-codec
local code 5815135 bytes
@jridgewell/sourcemap-codec 1.4.15 5868160 bytes
sourcemap-codec 5492584 bytes
source-map-0.6.1 13569984 bytes
source-map-0.8.0 6390584 bytes
chrome dev tools 8011136 bytes
Smallest memory usage is sourcemap-codec
Decode 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-codec
decode: local code x 492 ops/sec ±1.22% (90 runs sampled)
decode: @jridgewell/sourcemap-codec 1.4.15 x 499 ops/sec ±1.16% (89 runs sampled)
decode: sourcemap-codec x 376 ops/sec ±1.66% (89 runs sampled)
decode: source-map-0.6.1 x 34.99 ops/sec ±0.94% (48 runs sampled)
decode: source-map-0.8.0 x 351 ops/sec ±0.07% (95 runs sampled)
chrome dev tools x 165 ops/sec ±0.91% (86 runs sampled)
Fastest is decode: @jridgewell/sourcemap-codec 1.4.15
Encode Memory Usage:
@jridgewell/sourcemap-codec 1261620 bytes
sourcemap-codec 9119248 bytes
source-map-0.6.1 8968560 bytes
source-map-0.8.0 8952952 bytes
Smallest memory usage is @jridgewell/sourcemap-codec
local code 444248 bytes
@jridgewell/sourcemap-codec 1.4.15 623024 bytes
sourcemap-codec 8696280 bytes
source-map-0.6.1 8745176 bytes
source-map-0.8.0 8736624 bytes
Smallest memory usage is local code
Encode 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
encode: local code x 796 ops/sec ±0.11% (97 runs sampled)
encode: @jridgewell/sourcemap-codec 1.4.15 x 795 ops/sec ±0.25% (98 runs sampled)
encode: sourcemap-codec x 231 ops/sec ±0.83% (86 runs sampled)
encode: source-map-0.6.1 x 166 ops/sec ±0.57% (86 runs sampled)
encode: source-map-0.8.0 x 203 ops/sec ±0.45% (88 runs sampled)
Fastest is encode: local code,encode: @jridgewell/sourcemap-codec 1.4.15

@@ -104,28 +110,34 @@

Decode Memory Usage:
@jridgewell/sourcemap-codec 35338184 bytes
sourcemap-codec 35922736 bytes
source-map-0.6.1 62366360 bytes
source-map-0.8.0 44337416 bytes
Smallest memory usage is @jridgewell/sourcemap-codec
local code 35424960 bytes
@jridgewell/sourcemap-codec 1.4.15 35424696 bytes
sourcemap-codec 36033464 bytes
source-map-0.6.1 62253704 bytes
source-map-0.8.0 43843920 bytes
chrome dev tools 45111400 bytes
Smallest memory usage is @jridgewell/sourcemap-codec 1.4.15
Decode 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)
decode: local code x 38.18 ops/sec ±5.44% (52 runs sampled)
decode: @jridgewell/sourcemap-codec 1.4.15 x 38.36 ops/sec ±5.02% (52 runs sampled)
decode: sourcemap-codec x 34.05 ops/sec ±4.45% (47 runs sampled)
decode: source-map-0.6.1 x 4.31 ops/sec ±2.76% (15 runs sampled)
decode: source-map-0.8.0 x 55.60 ops/sec ±0.13% (73 runs sampled)
chrome dev tools x 16.94 ops/sec ±3.78% (46 runs sampled)
Fastest is decode: source-map-0.8.0
Encode Memory Usage:
@jridgewell/sourcemap-codec 7212604 bytes
sourcemap-codec 21421456 bytes
source-map-0.6.1 25286888 bytes
source-map-0.8.0 25498744 bytes
Smallest memory usage is @jridgewell/sourcemap-codec
local code 2606016 bytes
@jridgewell/sourcemap-codec 1.4.15 2626440 bytes
sourcemap-codec 21152576 bytes
source-map-0.6.1 25023928 bytes
source-map-0.8.0 25256448 bytes
Smallest memory usage is local code
Encode 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
encode: local code x 127 ops/sec ±0.18% (83 runs sampled)
encode: @jridgewell/sourcemap-codec 1.4.15 x 128 ops/sec ±0.26% (83 runs sampled)
encode: sourcemap-codec x 29.31 ops/sec ±2.55% (53 runs sampled)
encode: source-map-0.6.1 x 18.85 ops/sec ±3.19% (36 runs sampled)
encode: source-map-0.8.0 x 19.34 ops/sec ±1.97% (36 runs sampled)
Fastest is encode: @jridgewell/sourcemap-codec 1.4.15

@@ -139,28 +151,34 @@

Decode Memory Usage:
@jridgewell/sourcemap-codec 500272 bytes
sourcemap-codec 516864 bytes
source-map-0.6.1 1596672 bytes
source-map-0.8.0 517272 bytes
Smallest memory usage is @jridgewell/sourcemap-codec
local code 261696 bytes
@jridgewell/sourcemap-codec 1.4.15 244296 bytes
sourcemap-codec 302816 bytes
source-map-0.6.1 939176 bytes
source-map-0.8.0 336 bytes
chrome dev tools 587368 bytes
Smallest memory usage is source-map-0.8.0
Decode 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-codec
decode: local code x 17,782 ops/sec ±0.32% (97 runs sampled)
decode: @jridgewell/sourcemap-codec 1.4.15 x 17,863 ops/sec ±0.40% (100 runs sampled)
decode: sourcemap-codec x 12,453 ops/sec ±0.27% (101 runs sampled)
decode: source-map-0.6.1 x 1,288 ops/sec ±1.05% (96 runs sampled)
decode: source-map-0.8.0 x 9,289 ops/sec ±0.27% (101 runs sampled)
chrome dev tools x 4,769 ops/sec ±0.18% (100 runs sampled)
Fastest is decode: @jridgewell/sourcemap-codec 1.4.15
Encode Memory Usage:
@jridgewell/sourcemap-codec 321026 bytes
sourcemap-codec 830832 bytes
source-map-0.6.1 586608 bytes
source-map-0.8.0 586680 bytes
Smallest memory usage is @jridgewell/sourcemap-codec
local code 262944 bytes
@jridgewell/sourcemap-codec 1.4.15 25544 bytes
sourcemap-codec 323048 bytes
source-map-0.6.1 507808 bytes
source-map-0.8.0 507480 bytes
Smallest memory usage is @jridgewell/sourcemap-codec 1.4.15
Encode 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
encode: local code x 24,207 ops/sec ±0.79% (95 runs sampled)
encode: @jridgewell/sourcemap-codec 1.4.15 x 24,288 ops/sec ±0.48% (96 runs sampled)
encode: sourcemap-codec x 6,761 ops/sec ±0.21% (100 runs sampled)
encode: source-map-0.6.1 x 5,374 ops/sec ±0.17% (99 runs sampled)
encode: source-map-0.8.0 x 5,633 ops/sec ±0.32% (99 runs sampled)
Fastest is encode: @jridgewell/sourcemap-codec 1.4.15,encode: local code

@@ -174,28 +192,74 @@

Decode Memory Usage:
@jridgewell/sourcemap-codec 734848 bytes
sourcemap-codec 954200 bytes
source-map-0.6.1 2276432 bytes
source-map-0.8.0 955488 bytes
Smallest memory usage is @jridgewell/sourcemap-codec
local code 678816 bytes
@jridgewell/sourcemap-codec 1.4.15 678816 bytes
sourcemap-codec 816400 bytes
source-map-0.6.1 2288864 bytes
source-map-0.8.0 721360 bytes
chrome dev tools 1012512 bytes
Smallest memory usage is local code
Decode 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-codec
decode: local code x 6,178 ops/sec ±0.19% (98 runs sampled)
decode: @jridgewell/sourcemap-codec 1.4.15 x 6,261 ops/sec ±0.22% (100 runs sampled)
decode: sourcemap-codec x 4,472 ops/sec ±0.90% (99 runs sampled)
decode: source-map-0.6.1 x 449 ops/sec ±0.31% (95 runs sampled)
decode: source-map-0.8.0 x 3,219 ops/sec ±0.13% (100 runs sampled)
chrome dev tools x 1,743 ops/sec ±0.20% (99 runs sampled)
Fastest is decode: @jridgewell/sourcemap-codec 1.4.15
Encode Memory Usage:
@jridgewell/sourcemap-codec 638672 bytes
sourcemap-codec 1109840 bytes
source-map-0.6.1 1321224 bytes
source-map-0.8.0 1324448 bytes
Smallest memory usage is @jridgewell/sourcemap-codec
local code 140960 bytes
@jridgewell/sourcemap-codec 1.4.15 159808 bytes
sourcemap-codec 969304 bytes
source-map-0.6.1 930520 bytes
source-map-0.8.0 930248 bytes
Smallest memory usage is local code
Encode 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
encode: local code x 8,013 ops/sec ±0.19% (100 runs sampled)
encode: @jridgewell/sourcemap-codec 1.4.15 x 7,989 ops/sec ±0.20% (101 runs sampled)
encode: sourcemap-codec x 2,472 ops/sec ±0.21% (99 runs sampled)
encode: source-map-0.6.1 x 2,200 ops/sec ±0.17% (99 runs sampled)
encode: source-map-0.8.0 x 2,220 ops/sec ±0.37% (99 runs sampled)
Fastest is encode: local code
***
vscode.map - 2141001 segments
Decode Memory Usage:
local code 198955264 bytes
@jridgewell/sourcemap-codec 1.4.15 199175352 bytes
sourcemap-codec 199102688 bytes
source-map-0.6.1 386323432 bytes
source-map-0.8.0 244116432 bytes
chrome dev tools 293734280 bytes
Smallest memory usage is local code
Decode speed:
decode: local code x 3.90 ops/sec ±22.21% (15 runs sampled)
decode: @jridgewell/sourcemap-codec 1.4.15 x 3.95 ops/sec ±23.53% (15 runs sampled)
decode: sourcemap-codec x 3.82 ops/sec ±17.94% (14 runs sampled)
decode: source-map-0.6.1 x 0.61 ops/sec ±7.81% (6 runs sampled)
decode: source-map-0.8.0 x 9.54 ops/sec ±0.28% (28 runs sampled)
chrome dev tools x 2.18 ops/sec ±10.58% (10 runs sampled)
Fastest is decode: source-map-0.8.0
Encode Memory Usage:
local code 13509880 bytes
@jridgewell/sourcemap-codec 1.4.15 13537648 bytes
sourcemap-codec 32540104 bytes
source-map-0.6.1 127531040 bytes
source-map-0.8.0 127535312 bytes
Smallest memory usage is local code
Encode speed:
encode: local code x 20.10 ops/sec ±0.19% (38 runs sampled)
encode: @jridgewell/sourcemap-codec 1.4.15 x 20.26 ops/sec ±0.32% (38 runs sampled)
encode: sourcemap-codec x 5.44 ops/sec ±1.64% (18 runs sampled)
encode: source-map-0.6.1 x 2.30 ops/sec ±4.79% (10 runs sampled)
encode: source-map-0.8.0 x 2.46 ops/sec ±6.53% (10 runs sampled)
Fastest is encode: @jridgewell/sourcemap-codec 1.4.15
```

@@ -202,0 +266,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc