vfile-location
Advanced tools
Comparing version 2.0.3 to 2.0.4
19
index.js
'use strict' | ||
/* Expose. */ | ||
module.exports = factory | ||
/* Factory. */ | ||
function factory(file) { | ||
@@ -16,9 +14,8 @@ var contents = indices(String(file)) | ||
/* Factory to get the line and column-based `position` for | ||
* `offset` in the bound indices. */ | ||
// Factory to get the line and column-based `position` for `offset` in the bound | ||
// indices. | ||
function offsetToPositionFactory(indices) { | ||
return offsetToPosition | ||
/* Get the line and column-based `position` for | ||
* `offset` in the bound indices. */ | ||
// Get the line and column-based `position` for `offset` in the bound indices. | ||
function offsetToPosition(offset) { | ||
@@ -46,9 +43,9 @@ var index = -1 | ||
/* Factory to get the `offset` for a line and column-based | ||
* `position` in the bound indices. */ | ||
// Factory to get the `offset` for a line and column-based `position` in the | ||
// bound indices. | ||
function positionToOffsetFactory(indices) { | ||
return positionToOffset | ||
/* Get the `offset` for a line and column-based | ||
* `position` in the bound indices. */ | ||
// Get the `offset` for a line and column-based `position` in the bound | ||
// indices. | ||
function positionToOffset(position) { | ||
@@ -66,3 +63,3 @@ var line = position && position.line | ||
/* Get indices of line-breaks in `value`. */ | ||
// Get indices of line-breaks in `value`. | ||
function indices(value) { | ||
@@ -69,0 +66,0 @@ var result = [] |
{ | ||
"name": "vfile-location", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Convert between positions (line and column-based) and offsets (range-based) locations in a virtual file", | ||
@@ -15,5 +15,5 @@ "license": "MIT", | ||
"bugs": "https://github.com/vfile/vfile-location/issues", | ||
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)", | ||
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)", | ||
"contributors": [ | ||
"Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)" | ||
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)" | ||
], | ||
@@ -26,15 +26,15 @@ "dependencies": {}, | ||
"browserify": "^16.0.0", | ||
"esmangle": "^1.0.1", | ||
"nyc": "^11.0.0", | ||
"nyc": "^13.0.0", | ||
"prettier": "^1.12.1", | ||
"remark-cli": "^5.0.0", | ||
"remark-cli": "^6.0.0", | ||
"remark-preset-wooorm": "^4.0.0", | ||
"tape": "^4.0.0", | ||
"vfile": "^2.0.0", | ||
"xo": "^0.20.0" | ||
"tinyify": "^2.4.3", | ||
"vfile": "^3.0.0", | ||
"xo": "^0.23.0" | ||
}, | ||
"scripts": { | ||
"format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", | ||
"build-bundle": "browserify index.js --bare -s vfileLocation > vfile-location.js", | ||
"build-mangle": "esmangle vfile-location.js > vfile-location.min.js", | ||
"build-bundle": "browserify . -s vfileLocation > vfile-location.js", | ||
"build-mangle": "browserify . -s vfileLocation -p tinyify > vfile-location.min.js", | ||
"build": "npm run build-bundle && npm run build-mangle", | ||
@@ -41,0 +41,0 @@ "test-api": "node test", |
@@ -1,3 +0,8 @@ | ||
# vfile-location [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] | ||
# vfile-location | ||
[![Build][build-badge]][build] | ||
[![Coverage][coverage-badge]][coverage] | ||
[![Downloads][downloads-badge]][downloads] | ||
[![Chat][chat-badge]][chat] | ||
Convert between positions (line and column-based) and offsets | ||
@@ -60,15 +65,23 @@ (range-based) locations in a [virtual file][vfile]. | ||
[travis-badge]: https://img.shields.io/travis/vfile/vfile-location.svg | ||
[build-badge]: https://img.shields.io/travis/vfile/vfile-location.svg | ||
[travis]: https://travis-ci.org/vfile/vfile-location | ||
[build]: https://travis-ci.org/vfile/vfile-location | ||
[codecov-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-location.svg | ||
[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-location.svg | ||
[codecov]: https://codecov.io/github/vfile/vfile-location | ||
[coverage]: https://codecov.io/github/vfile/vfile-location | ||
[downloads-badge]: https://img.shields.io/npm/dm/vfile-location.svg | ||
[downloads]: https://www.npmjs.com/package/vfile-location | ||
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg | ||
[chat]: https://spectrum.chat/unified/vfile | ||
[npm]: https://docs.npmjs.com/cli/install | ||
[license]: LICENSE | ||
[license]: license | ||
[author]: http://wooorm.com | ||
[author]: https://wooorm.com | ||
@@ -75,0 +88,0 @@ [vfile]: https://github.com/vfile/vfile |
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
7053
98
58