@jridgewell/sourcemap-codec
Advanced tools
Comparing version 1.4.9 to 1.4.10
@@ -40,2 +40,4 @@ (function (global, factory) { | ||
let line = []; | ||
let sorted = true; | ||
let lastCol = 0; | ||
for (let i = 0; i < mappings.length;) { | ||
@@ -47,3 +49,6 @@ const c = mappings.charCodeAt(i); | ||
else if (c === semicolon) { | ||
state[0] = 0; | ||
state[0] = lastCol = 0; | ||
if (!sorted) | ||
sort(line); | ||
sorted = true; | ||
decoded.push(line); | ||
@@ -55,4 +60,8 @@ line = []; | ||
i = decodeInteger(mappings, i, state, 0); // generatedCodeColumn | ||
const col = state[0]; | ||
if (col < lastCol) | ||
sorted = false; | ||
lastCol = col; | ||
if (!hasMoreSegments(mappings, i)) { | ||
line.push([state[0]]); | ||
line.push([col]); | ||
continue; | ||
@@ -64,9 +73,11 @@ } | ||
if (!hasMoreSegments(mappings, i)) { | ||
line.push([state[0], state[1], state[2], state[3]]); | ||
line.push([col, state[1], state[2], state[3]]); | ||
continue; | ||
} | ||
i = decodeInteger(mappings, i, state, 4); // nameIndex | ||
line.push([state[0], state[1], state[2], state[3], state[4]]); | ||
line.push([col, state[1], state[2], state[3], state[4]]); | ||
} | ||
} | ||
if (!sorted) | ||
sort(line); | ||
decoded.push(line); | ||
@@ -101,2 +112,8 @@ return decoded; | ||
} | ||
function sort(line) { | ||
line.sort(sortComparator); | ||
} | ||
function sortComparator(a, b) { | ||
return a[0] - b[0]; | ||
} | ||
function encode(decoded) { | ||
@@ -103,0 +120,0 @@ const state = new Int32Array(5); |
{ | ||
"name": "@jridgewell/sourcemap-codec", | ||
"version": "1.4.9", | ||
"version": "1.4.10", | ||
"description": "Encode/decode sourcemap mappings", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28791
339
8