unist-util-remove-position
Advanced tools
Comparing version 1.1.1 to 1.1.2
14
index.js
@@ -1,19 +0,19 @@ | ||
'use strict'; | ||
'use strict' | ||
var visit = require('unist-util-visit'); | ||
var visit = require('unist-util-visit') | ||
module.exports = removePosition; | ||
module.exports = removePosition | ||
/* Remove `position`s from `tree`. */ | ||
function removePosition(node, force) { | ||
visit(node, force ? hard : soft); | ||
return node; | ||
visit(node, force ? hard : soft) | ||
return node | ||
} | ||
function hard(node) { | ||
delete node.position; | ||
delete node.position | ||
} | ||
function soft(node) { | ||
node.position = undefined; | ||
node.position = undefined | ||
} |
{ | ||
"name": "unist-util-remove-position", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Remove `position`s from a unist tree", | ||
@@ -13,6 +13,3 @@ "license": "MIT", | ||
], | ||
"files": [ | ||
"index.js" | ||
], | ||
"repository": "https://github.com/syntax-tree/unist-util-remove-position", | ||
"repository": "syntax-tree/unist-util-remove-position", | ||
"bugs": "https://github.com/syntax-tree/unist-util-remove-position/issues", | ||
@@ -23,2 +20,5 @@ "author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)", | ||
], | ||
"files": [ | ||
"index.js" | ||
], | ||
"dependencies": { | ||
@@ -28,25 +28,38 @@ "unist-util-visit": "^1.1.0" | ||
"devDependencies": { | ||
"browserify": "^14.0.0", | ||
"browserify": "^16.0.0", | ||
"esmangle": "^1.0.1", | ||
"nyc": "^11.0.0", | ||
"remark": "^7.0.0", | ||
"remark-cli": "^3.0.0", | ||
"remark-preset-wooorm": "^3.0.0", | ||
"prettier": "^1.12.1", | ||
"remark": "^9.0.0", | ||
"remark-cli": "^5.0.0", | ||
"remark-preset-wooorm": "^4.0.0", | ||
"tape": "^4.0.0", | ||
"unist-builder": "^1.0.2", | ||
"xo": "^0.18.2" | ||
"xo": "^0.20.0" | ||
}, | ||
"scripts": { | ||
"build-md": "remark . -qfo", | ||
"format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", | ||
"build-bundle": "browserify index.js --bare -s unistUtilRemovePosition > unist-util-remove-position.js", | ||
"build-mangle": "esmangle < unist-util-remove-position.js > unist-util-remove-position.min.js", | ||
"build": "npm run build-md && npm run build-bundle && npm run build-mangle", | ||
"lint": "xo", | ||
"build": "npm run build-bundle && npm run build-mangle", | ||
"test-api": "node test", | ||
"test-coverage": "nyc --reporter lcov tape test.js", | ||
"test": "npm run build && npm run lint && npm run test-coverage" | ||
"test": "npm run format && npm run build && npm run test-coverage" | ||
}, | ||
"prettier": { | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"singleQuote": true, | ||
"bracketSpacing": false, | ||
"semi": false, | ||
"trailingComma": "none" | ||
}, | ||
"xo": { | ||
"space": true, | ||
"prettier": true, | ||
"esnext": false, | ||
"rules": { | ||
"guard-for-in": "off", | ||
"no-var": "off", | ||
"prefer-arrow-callback": "off" | ||
}, | ||
"ignores": [ | ||
@@ -53,0 +66,0 @@ "unist-util-remove-position.js" |
@@ -16,8 +16,8 @@ # unist-util-remove-position [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] | ||
```javascript | ||
var remark = require('remark'); | ||
var removePosition = require('unist-util-remove-position'); | ||
var remark = require('remark') | ||
var removePosition = require('unist-util-remove-position') | ||
var tree = remark().parse('Some _emphasis_, **importance**, and `code`.'); | ||
var tree = remark().parse('Some _emphasis_, **importance**, and `code`.') | ||
console.dir(removePosition(tree, true), {depth: null}); | ||
console.dir(removePosition(tree, true), {depth: null}) | ||
``` | ||
@@ -54,2 +54,10 @@ | ||
## Contribute | ||
See [`contributing.md` in `syntax-tree/unist`][contributing] for ways to get | ||
started. | ||
This organisation has a [Code of Conduct][coc]. By interacting with this | ||
repository, organisation, or community you agree to abide by its terms. | ||
## License | ||
@@ -80,1 +88,5 @@ | ||
[node]: https://github.com/syntax-tree/unist#node | ||
[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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
5712
90
10