svelte-eslint-parser
Advanced tools
Comparing version 0.0.19 to 0.1.0
@@ -9,3 +9,2 @@ "use strict"; | ||
const path_1 = __importDefault(require("path")); | ||
const lodash_1 = __importDefault(require("lodash")); | ||
const script_let_1 = require("./script-let"); | ||
@@ -215,3 +214,3 @@ const let_directive_collection_1 = require("./let-directive-collection"); | ||
getLocFromIndex(index) { | ||
const lineNumber = lodash_1.default.sortedLastIndex(this.lineStartIndices, index); | ||
const lineNumber = sortedLastIndex(this.lineStartIndices, index); | ||
return { | ||
@@ -229,1 +228,22 @@ line: lineNumber, | ||
exports.LinesAndColumns = LinesAndColumns; | ||
/** | ||
* Uses a binary search to determine the highest index at which value should be inserted into array in order to maintain its sort order. | ||
*/ | ||
function sortedLastIndex(array, value) { | ||
let lower = 0; | ||
let upper = array.length; | ||
while (lower < upper) { | ||
const mid = Math.floor(lower + (upper - lower) / 2); | ||
const target = array[mid]; | ||
if (target < value) { | ||
lower = mid + 1; | ||
} | ||
else if (target > value) { | ||
upper = mid; | ||
} | ||
else { | ||
return mid + 1; | ||
} | ||
} | ||
return upper; | ||
} |
{ | ||
"name": "svelte-eslint-parser", | ||
"version": "0.0.19", | ||
"version": "0.1.0", | ||
"description": "Svelte parser for ESLint", | ||
@@ -41,4 +41,3 @@ "main": "lib/index.js", | ||
"eslint-visitor-keys": "^2.0.0", | ||
"espree": "^7.3.1", | ||
"lodash": "^4.17.20" | ||
"espree": "^7.3.1" | ||
}, | ||
@@ -50,7 +49,6 @@ "peerDependencies": { | ||
"@ota-meshi/eslint-plugin": "^0.7.0", | ||
"@ota-meshi/eslint-plugin-svelte": "0.0.18", | ||
"@ota-meshi/eslint-plugin-svelte": "0.0.19", | ||
"@types/eslint": "^7.2.0", | ||
"@types/eslint-scope": "^3.7.0", | ||
"@types/eslint-visitor-keys": "^1.0.0", | ||
"@types/lodash": "^4.14.167", | ||
"@types/mocha": "^8.0.0", | ||
@@ -68,3 +66,3 @@ "@types/node": "^14.0.13", | ||
"eslint-plugin-prettier": "^3.2.0", | ||
"eslint-plugin-regexp": "^0.10.0", | ||
"eslint-plugin-regexp": "^0.11.0", | ||
"eslint-plugin-svelte3": "^3.2.0", | ||
@@ -81,3 +79,3 @@ "eslint-plugin-vue": "^7.2.0", | ||
"svelte": "^3.37.0", | ||
"ts-node": "^9.0.0", | ||
"ts-node": "^10.0.0", | ||
"typescript": "^4.0.0", | ||
@@ -84,0 +82,0 @@ "vue-eslint-parser": "^7.2.0" |
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
141933
4
32
3433
- Removedlodash@^4.17.20
- Removedlodash@4.17.21(transitive)