yaml-ast-parser
Advanced tools
Comparing version
@@ -212,3 +212,3 @@ "use strict"; | ||
} | ||
if (start < end) { | ||
if (start <= end) { | ||
_result = state.input.slice(start, end); | ||
@@ -1307,4 +1307,8 @@ if (checkJson) { | ||
else if (1 === documents.length) { | ||
documents[0].endPosition = input.length; | ||
return documents[0]; | ||
var result = documents[0]; | ||
result.endPosition = input.length; | ||
if (result.startPosition > result.endPosition) { | ||
result.startPosition = result.endPosition; | ||
} | ||
return result; | ||
} | ||
@@ -1311,0 +1315,0 @@ var e = new YAMLException('expected a single document in the stream, but found more'); |
{ | ||
"name": "yaml-ast-parser", | ||
"version": "0.0.27", | ||
"version": "0.0.28", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -299,3 +299,3 @@ import ast=require("./yamlAST") | ||
} | ||
if (start < end) { | ||
if (start <= end) { | ||
_result = state.input.slice(start, end); | ||
@@ -1715,5 +1715,9 @@ | ||
} else if (1 === documents.length) { | ||
var result = documents[0]; | ||
//root node always takes whole file | ||
documents[0].endPosition=input.length | ||
return documents[0]; | ||
result.endPosition=input.length | ||
if(result.startPosition>result.endPosition){ | ||
result.startPosition = result.endPosition; | ||
} | ||
return result; | ||
} | ||
@@ -1720,0 +1724,0 @@ var e=new YAMLException('expected a single document in the stream, but found more'); |
Sorry, the diff of this file is not supported yet
347579
0.12%6913
0.12%