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

@volar/source-map

Package Overview
Dependencies
Maintainers
1
Versions
396
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@volar/source-map - npm Package Compare versions

Comparing version 2.4.0-alpha.13 to 2.4.0-alpha.14

16

lib/translateOffset.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.translateOffset = translateOffset;
let warned = false;
function translateOffset(start, fromOffsets, toOffsets, fromLengths, toLengths = fromLengths) {
const isSorted = fromOffsets.every((value, index) => index === 0 || fromOffsets[index - 1] <= value);
if (!isSorted) {
throw new Error('fromOffsets must be sorted in ascending order');
for (let i = 0; i < fromOffsets.length; i++) {
const fromOffset = fromOffsets[i];
const fromLength = fromLengths[i];
if (start >= fromOffset && start <= fromOffset + fromLength) {
const toLength = toLengths[i];
const toOffset = toOffsets[i];
let rangeOffset = Math.min(start - fromOffset, toLength);
return toOffset + rangeOffset;
}
}
if (!warned) {
warned = true;
console.warn('fromOffsets should be sorted in ascending order');
}
}

@@ -9,0 +23,0 @@ let low = 0;

4

package.json
{
"name": "@volar/source-map",
"version": "2.4.0-alpha.13",
"version": "2.4.0-alpha.14",
"license": "MIT",

@@ -14,3 +14,3 @@ "files": [

},
"gitHead": "5f6d5d8ec51a5dda702d071c283e9133254cae97"
"gitHead": "fc61afbf59f54fd6e92776a8569d6ce591e9b9d5"
}
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