@fimbul/wotan
Advanced tools
Comparing version 0.15.0-dev.20181006 to 0.15.0-dev.20181016
{ | ||
"name": "@fimbul/wotan", | ||
"version": "0.15.0-dev.20181006", | ||
"version": "0.15.0-dev.20181016", | ||
"description": "Pluggable TypeScript and JavaScript linter", | ||
@@ -65,2 +65,3 @@ "bin": "bin/main.js", | ||
"semver": "^5.4.1", | ||
"stable": "^0.1.8", | ||
"to-absolute-glob": "^2.0.2", | ||
@@ -67,0 +68,0 @@ "tslib": "^1.8.1", |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const stableSort = require("stable"); | ||
function applyFixes(source, fixes) { | ||
@@ -73,6 +74,5 @@ let fixed = fixes.length; | ||
return replacements; | ||
replacements = replacements.slice().sort(compareReplacements); | ||
replacements = stableSort.inplace(replacements.slice(), compareReplacements); | ||
const result = []; | ||
let current = replacements[0]; | ||
let wasInsertion = current.start === current.end; | ||
for (let i = 1; i < replacements.length; ++i) { | ||
@@ -82,6 +82,3 @@ const replacement = replacements[i]; | ||
throw new Error('Replacements of fix overlap.'); | ||
const isInsertion = replacement.start === replacement.end; | ||
if (current.end === replacement.start) { | ||
if (isInsertion && wasInsertion) | ||
throw new Error('Multiple insertion replacements at the same position.'); | ||
current = { | ||
@@ -97,3 +94,2 @@ start: current.start, | ||
} | ||
wasInsertion = isInsertion; | ||
} | ||
@@ -100,0 +96,0 @@ result.push(current); |
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
274357
21
3428
+ Addedstable@^0.1.8
+ Addedstable@0.1.8(transitive)