unist-util-position
Advanced tools
Comparing version 3.0.2 to 3.0.3
'use strict' | ||
/* Expose. */ | ||
var position = exports | ||
@@ -9,3 +8,2 @@ | ||
/* Factory to get a `type` point in the positional info of a node. */ | ||
function factory(type) { | ||
@@ -16,3 +14,2 @@ point.displayName = type | ||
/* Get a point in `node.position` at a bound `type`. */ | ||
function point(node) { | ||
@@ -19,0 +16,0 @@ var point = (node && node.position && node.position[type]) || {} |
{ | ||
"name": "unist-util-position", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "Utility to get the position of unist nodes", | ||
@@ -26,12 +26,12 @@ "license": "MIT", | ||
"browserify": "^16.0.0", | ||
"nyc": "^13.0.0", | ||
"prettier": "^1.12.1", | ||
"nyc": "^14.0.0", | ||
"prettier": "^1.0.0", | ||
"remark-cli": "^6.0.0", | ||
"remark-preset-wooorm": "^4.0.0", | ||
"tape": "^4.4.0", | ||
"tinyify": "^2.4.3", | ||
"xo": "^0.23.0" | ||
"remark-preset-wooorm": "^5.0.0", | ||
"tape": "^4.0.0", | ||
"tinyify": "^2.0.0", | ||
"xo": "^0.24.0" | ||
}, | ||
"scripts": { | ||
"format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", | ||
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", | ||
"build-bundle": "browserify . -s unistUtilPosition > unist-util-position.js", | ||
@@ -61,7 +61,2 @@ "build-mangle": "browserify . -s unistUtilPosition -p tinyify > unist-util-position.min.js", | ||
"esnext": false, | ||
"rules": { | ||
"guard-for-in": "off", | ||
"no-var": "off", | ||
"prefer-arrow-callback": "off" | ||
}, | ||
"ignores": [ | ||
@@ -68,0 +63,0 @@ "unist-util-position.js" |
@@ -1,10 +0,18 @@ | ||
# unist-util-position [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] | ||
# unist-util-position | ||
[![Build][build-badge]][build] | ||
[![Coverage][coverage-badge]][coverage] | ||
[![Downloads][downloads-badge]][downloads] | ||
[![Size][size-badge]][size] | ||
[![Sponsors][sponsors-badge]][collective] | ||
[![Backers][backers-badge]][collective] | ||
[![Chat][chat-badge]][chat] | ||
[**unist**][unist] utility to get the positional info of nodes. | ||
## Installation | ||
## Install | ||
[npm][]: | ||
```bash | ||
```sh | ||
npm install unist-util-position | ||
@@ -19,3 +27,3 @@ ``` | ||
var tree = remark().parse(['# foo', '', '* bar', ''].join('\n')) | ||
var tree = remark().parse('# foo\n\n* bar\n') | ||
@@ -46,9 +54,14 @@ position.start(tree) // => {line: 1, column: 1} | ||
Note that in [unist][], `line` and `column` are 1-indexed integers and | ||
`offset` is a 0-indexed integer. | ||
## Contribute | ||
See [`contributing.md` in `syntax-tree/unist`][contributing] for ways to get | ||
See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get | ||
started. | ||
See [`support.md`][support] for ways to get help. | ||
This organisation has a [Code of Conduct][coc]. By interacting with this | ||
repository, organisation, or community you agree to abide by its terms. | ||
This project has a [Code of Conduct][coc]. | ||
By interacting with this repository, organisation, or community you agree to | ||
abide by its terms. | ||
@@ -63,8 +76,26 @@ ## License | ||
[build-status]: https://travis-ci.org/syntax-tree/unist-util-position | ||
[build]: https://travis-ci.org/syntax-tree/unist-util-position | ||
[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-position.svg | ||
[coverage-status]: https://codecov.io/github/syntax-tree/unist-util-position | ||
[coverage]: https://codecov.io/github/syntax-tree/unist-util-position | ||
[downloads-badge]: https://img.shields.io/npm/dm/unist-util-position.svg | ||
[downloads]: https://www.npmjs.com/package/unist-util-position | ||
[size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-position.svg | ||
[size]: https://bundlephobia.com/result?p=unist-util-position | ||
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg | ||
[backers-badge]: https://opencollective.com/unified/backers/badge.svg | ||
[collective]: https://opencollective.com/unified | ||
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg | ||
[chat]: https://spectrum.chat/unified/syntax-tree | ||
[license]: license | ||
@@ -76,2 +107,8 @@ | ||
[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md | ||
[support]: https://github.com/syntax-tree/.github/blob/master/support.md | ||
[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md | ||
[unist]: https://github.com/syntax-tree/unist | ||
@@ -82,5 +119,1 @@ | ||
[point]: https://github.com/syntax-tree/unist#point | ||
[contributing]: https://github.com/syntax-tree/unist/blob/master/contributing.md | ||
[coc]: https://github.com/syntax-tree/unist/blob/master/code-of-conduct.md |
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
6257
115
16