Comparing version 1.3.0 to 1.3.1
@@ -27,3 +27,3 @@ "use strict"; | ||
* | ||
* Returns a zero-indexed `{ line, col }` location if found, or | ||
* Returns a one-indexed `{ line, col }` location if found, or | ||
* `undefined` otherwise. | ||
@@ -59,7 +59,5 @@ * | ||
if (offset < start) { | ||
var _line = i - 1; | ||
return { | ||
line: _line, | ||
col: offset - lineStarts[_line] | ||
line: i, | ||
col: offset - lineStarts[i - 1] + 1 | ||
}; | ||
@@ -69,11 +67,11 @@ } | ||
if (offset === start) return { | ||
line: i, | ||
col: 0 | ||
line: i + 1, | ||
col: 1 | ||
}; | ||
} | ||
var line = lineStarts.length - 1; | ||
var line = lineStarts.length; | ||
return { | ||
line: line, | ||
col: offset - lineStarts[line] | ||
col: offset - lineStarts[line - 1] + 1 | ||
}; | ||
@@ -80,0 +78,0 @@ } |
@@ -27,3 +27,3 @@ "use strict"; | ||
* | ||
* Returns a zero-indexed `{ line, col }` location if found, or | ||
* Returns a one-indexed `{ line, col }` location if found, or | ||
* `undefined` otherwise. | ||
@@ -59,6 +59,5 @@ * | ||
if (offset < start) { | ||
const line = i - 1; | ||
return { | ||
line, | ||
col: offset - lineStarts[line] | ||
line: i, | ||
col: offset - lineStarts[i - 1] + 1 | ||
}; | ||
@@ -68,11 +67,11 @@ } | ||
if (offset === start) return { | ||
line: i, | ||
col: 0 | ||
line: i + 1, | ||
col: 1 | ||
}; | ||
} | ||
const line = lineStarts.length - 1; | ||
const line = lineStarts.length; | ||
return { | ||
line, | ||
col: offset - lineStarts[line] | ||
col: offset - lineStarts[line - 1] + 1 | ||
}; | ||
@@ -79,0 +78,0 @@ } |
{ | ||
"name": "yaml", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"license": "ISC", | ||
@@ -5,0 +5,0 @@ "author": "Eemeli Aro <eemeli@gmail.com>", |
@@ -5,3 +5,3 @@ # YAML <a href="https://www.npmjs.com/package/yaml"><img align="right" src="https://badge.fury.io/js/yaml.svg" title="npm package" /></a><a href="https://travis-ci.org/eemeli/yaml"><img align="right" src="https://travis-ci.org/eemeli/yaml.svg?branch=master" title="Build status" /></a> | ||
The library is released under the ISC open source license, and the code is [available on GitHub](https://github.com/eemeli/yaml/). It has no external dependencies, and is usable in both browser and node environments. | ||
The library is released under the ISC open source license, and the code is [available on GitHub](https://github.com/eemeli/yaml/). It runs on Node.js 6 and later with no external dependencies, and in browsers from IE 11 upwards using `@babel/runtime` (Note: not included in dependencies, install separately). | ||
@@ -22,3 +22,3 @@ For more information, see the project's documentation site: [**eemeli.org/yaml**](https://eemeli.org/yaml/) | ||
The API provided by `yaml` has three layers, depending on how deep you need to go: [Pure JavaScript](https://eemeli.org/yaml/#pure-javascript), [YAML Documents](https://eemeli.org/yaml/#yaml-documents), and the [CST Parser](https://eemeli.org/yaml/#cst-parser). The first has the simplest API and "just works", the second gets you all the bells and whistles supported by the library along with a decent [AST](https://eemeli.org/yaml/#content-nodes), and the third is the closest to YAML source, making it fast, raw, and crude. | ||
The API provided by `yaml` has three layers, depending on how deep you need to go: [Parse & Stringify](https://eemeli.org/yaml/#parse-amp-stringify), [Documents](https://eemeli.org/yaml/#documents), and the [CST Parser](https://eemeli.org/yaml/#cst-parser). The first has the simplest API and "just works", the second gets you all the bells and whistles supported by the library along with a decent [AST](https://eemeli.org/yaml/#content-nodes), and the third is the closest to YAML source, making it fast, raw, and crude. | ||
@@ -25,0 +25,0 @@ ```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
442690
12088