api-doc-validator
Advanced tools
Comparing version 2.25.0 to 2.26.0
@@ -11,6 +11,7 @@ const annotations = require('./annotations'); | ||
var list = []; | ||
var last; | ||
const list = []; | ||
let last; | ||
let index = 0; | ||
comment.split("\n").forEach(function (line, index) { | ||
comment.split("\n").forEach(function (line, i) { | ||
const match = annotationRule.exec(line); | ||
@@ -23,8 +24,10 @@ | ||
start: { | ||
line: index, | ||
line: i, | ||
column: match[1].length, | ||
index: index + match.index + match[1].length, | ||
}, | ||
end: { | ||
line: index, | ||
line: i, | ||
column: line.length, | ||
index: index + match[0].length | ||
}, | ||
@@ -39,4 +42,7 @@ }; | ||
last.end.column = line.length; | ||
last.end.index += line.length + 1; | ||
} | ||
else if (line.trim()) { | ||
const offset = line.match(/^\s*/)[0].length; | ||
last = { | ||
@@ -46,8 +52,10 @@ name: 'description', | ||
start: { | ||
line: index, | ||
column: line.match(/^\s*/)[0].length, | ||
line: i, | ||
column: offset, | ||
index: index + offset, | ||
}, | ||
end: { | ||
line: index, | ||
line: i, | ||
column: line.length, | ||
index: index + line.length + 1, | ||
}, | ||
@@ -58,2 +66,4 @@ }; | ||
} | ||
index += line.length + 1; | ||
}); | ||
@@ -60,0 +70,0 @@ |
@@ -50,2 +50,3 @@ const fs = require('fs'); | ||
let column = 0; | ||
let index = 0; | ||
let array_text = ''; | ||
@@ -57,2 +58,4 @@ let array_start_count = 0; | ||
const updatePos = function (text) { | ||
index += text.length; | ||
const l = countLines(text); | ||
@@ -177,2 +180,3 @@ | ||
column: column - 3, | ||
index: index - 3, | ||
}; | ||
@@ -245,2 +249,3 @@ | ||
column, | ||
index, | ||
} | ||
@@ -247,0 +252,0 @@ }; |
{ | ||
"name": "api-doc-validator", | ||
"version": "2.25.0", | ||
"version": "2.26.0", | ||
"description": "api doc and validator", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
70060
2032