diff options
Diffstat (limited to 'tools/node_modules/eslint/node_modules/unist-util-remove-position')
4 files changed, 221 insertions, 0 deletions
diff --git a/tools/node_modules/eslint/node_modules/unist-util-remove-position/LICENSE b/tools/node_modules/eslint/node_modules/unist-util-remove-position/LICENSE new file mode 100644 index 0000000000..8d8660d36e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/unist-util-remove-position/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/unist-util-remove-position/index.js b/tools/node_modules/eslint/node_modules/unist-util-remove-position/index.js new file mode 100644 index 0000000000..4db10234be --- /dev/null +++ b/tools/node_modules/eslint/node_modules/unist-util-remove-position/index.js @@ -0,0 +1,19 @@ +'use strict'; + +var visit = require('unist-util-visit'); + +module.exports = removePosition; + +/* Remove `position`s from `tree`. */ +function removePosition(node, force) { + visit(node, force ? hard : soft); + return node; +} + +function hard(node) { + delete node.position; +} + +function soft(node) { + node.position = undefined; +} diff --git a/tools/node_modules/eslint/node_modules/unist-util-remove-position/package.json b/tools/node_modules/eslint/node_modules/unist-util-remove-position/package.json new file mode 100644 index 0000000000..0425b921b0 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/unist-util-remove-position/package.json @@ -0,0 +1,103 @@ +{ + "_from": "unist-util-remove-position@^1.0.0", + "_id": "unist-util-remove-position@1.1.1", + "_inBundle": false, + "_integrity": "sha1-WoXBVV/BugwQG4ZwfRXlD6TIcbs=", + "_location": "/unist-util-remove-position", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "unist-util-remove-position@^1.0.0", + "name": "unist-util-remove-position", + "escapedName": "unist-util-remove-position", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.1.tgz", + "_shasum": "5a85c1555fc1ba0c101b86707d15e50fa4c871bb", + "_spec": "unist-util-remove-position@^1.0.0", + "_where": "/Users/cjihrig/iojs/node/tools/eslint-tmp/node_modules/eslint/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + }, + "bugs": { + "url": "https://github.com/syntax-tree/unist-util-remove-position/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "http://wooorm.com" + } + ], + "dependencies": { + "unist-util-visit": "^1.1.0" + }, + "deprecated": false, + "description": "Remove `position`s from a unist tree", + "devDependencies": { + "browserify": "^14.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", + "tape": "^4.0.0", + "unist-builder": "^1.0.2", + "xo": "^0.18.2" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/syntax-tree/unist-util-remove-position#readme", + "keywords": [ + "unist", + "utility", + "remove", + "position", + "location" + ], + "license": "MIT", + "name": "unist-util-remove-position", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/unist-util-remove-position.git" + }, + "scripts": { + "build": "npm run build-md && npm run build-bundle && npm run build-mangle", + "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-md": "remark . -qfo", + "lint": "xo", + "test": "npm run build && npm run lint && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.1.1", + "xo": { + "space": true, + "esnext": false, + "ignores": [ + "unist-util-remove-position.js" + ] + } +} diff --git a/tools/node_modules/eslint/node_modules/unist-util-remove-position/readme.md b/tools/node_modules/eslint/node_modules/unist-util-remove-position/readme.md new file mode 100644 index 0000000000..6063836f57 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/unist-util-remove-position/readme.md @@ -0,0 +1,77 @@ +# unist-util-remove-position [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] + +Remove [`position`][position]s from a [Unist][] tree. + +## Installation + +[npm][]: + +```bash +npm install unist-util-remove-position +``` + +## Usage + +```javascript +var remark = require('remark'); +var removePosition = require('unist-util-remove-position'); + +var tree = remark().parse('Some _emphasis_, **importance**, and `code`.'); + +console.dir(removePosition(tree, true), {depth: null}); +``` + +Yields: + +```js +{ type: 'root', + children: + [ { type: 'paragraph', + children: + [ { type: 'text', value: 'Some ' }, + { type: 'emphasis', + children: [ { type: 'text', value: 'emphasis' } ] }, + { type: 'text', value: ', ' }, + { type: 'strong', + children: [ { type: 'text', value: 'importance' } ] }, + { type: 'text', value: ', and ' }, + { type: 'inlineCode', value: 'code' }, + { type: 'text', value: '.' } ] } ] } +``` + +## API + +### `removePosition(node[, force])` + +Remove [`position`][position]s from [`node`][node]. If `force` is given, +uses `delete`, otherwise, sets `position`s to `undefined`. + +###### Returns + +The given `node`. + +## License + +[MIT][license] © [Titus Wormer][author] + +<!-- Definitions --> + +[travis-badge]: https://img.shields.io/travis/syntax-tree/unist-util-remove-position.svg + +[travis]: https://travis-ci.org/syntax-tree/unist-util-remove-position + +[codecov-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-remove-position.svg + +[codecov]: https://codecov.io/github/syntax-tree/unist-util-remove-position + +[npm]: https://docs.npmjs.com/cli/install + +[license]: LICENSE + +[author]: http://wooorm.com + +[unist]: https://github.com/syntax-tree/unist + +[position]: https://github.com/syntax-tree/unist#position + +[node]: https://github.com/syntax-tree/unist#node |