114 lines
24 KiB
JSON
114 lines
24 KiB
JSON
|
{
|
||
|
"_args": [
|
||
|
[
|
||
|
{
|
||
|
"raw": "symbol-tree@^3.2.2",
|
||
|
"scope": null,
|
||
|
"escapedName": "symbol-tree",
|
||
|
"name": "symbol-tree",
|
||
|
"rawSpec": "^3.2.2",
|
||
|
"spec": ">=3.2.2 <4.0.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"/home/jdaugherty/work/GT2/GT2-Android/node_modules/jsdom"
|
||
|
]
|
||
|
],
|
||
|
"_from": "symbol-tree@>=3.2.2 <4.0.0",
|
||
|
"_id": "symbol-tree@3.2.2",
|
||
|
"_inCache": true,
|
||
|
"_location": "/symbol-tree",
|
||
|
"_nodeVersion": "7.2.1",
|
||
|
"_npmOperationalInternal": {
|
||
|
"host": "packages-18-east.internal.npmjs.com",
|
||
|
"tmp": "tmp/symbol-tree-3.2.2.tgz_1486847058094_0.6699730809777975"
|
||
|
},
|
||
|
"_npmUser": {
|
||
|
"name": "joris-van-der-wel",
|
||
|
"email": "joris@jorisvanderwel.com"
|
||
|
},
|
||
|
"_npmVersion": "3.10.10",
|
||
|
"_phantomChildren": {},
|
||
|
"_requested": {
|
||
|
"raw": "symbol-tree@^3.2.2",
|
||
|
"scope": null,
|
||
|
"escapedName": "symbol-tree",
|
||
|
"name": "symbol-tree",
|
||
|
"rawSpec": "^3.2.2",
|
||
|
"spec": ">=3.2.2 <4.0.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"_requiredBy": [
|
||
|
"/jsdom"
|
||
|
],
|
||
|
"_resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz",
|
||
|
"_shasum": "ae27db38f660a7ae2e1c3b7d1bc290819b8519e6",
|
||
|
"_shrinkwrap": null,
|
||
|
"_spec": "symbol-tree@^3.2.2",
|
||
|
"_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/jsdom",
|
||
|
"author": {
|
||
|
"name": "Joris van der Wel",
|
||
|
"email": "joris@jorisvanderwel.com"
|
||
|
},
|
||
|
"bugs": {
|
||
|
"url": "https://github.com/jsdom/js-symbol-tree/issues"
|
||
|
},
|
||
|
"dependencies": {},
|
||
|
"description": "Turn any collection of objects into its own efficient tree or linked list using Symbol",
|
||
|
"devDependencies": {
|
||
|
"babel-eslint": "^7.1.1",
|
||
|
"coveralls": "^2.11.15",
|
||
|
"eslint": "^3.12.0",
|
||
|
"eslint-plugin-import": "^2.2.0",
|
||
|
"istanbul": "^0.4.5",
|
||
|
"jsdoc-to-markdown": "^3.0.0",
|
||
|
"tape": "^4.0.0"
|
||
|
},
|
||
|
"directories": {},
|
||
|
"dist": {
|
||
|
"shasum": "ae27db38f660a7ae2e1c3b7d1bc290819b8519e6",
|
||
|
"tarball": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz"
|
||
|
},
|
||
|
"files": [
|
||
|
"lib",
|
||
|
"api.md"
|
||
|
],
|
||
|
"gitHead": "1e213a3f820f79c083859cce601ed091154449b5",
|
||
|
"homepage": "https://github.com/jsdom/js-symbol-tree#symbol-tree",
|
||
|
"keywords": [
|
||
|
"list",
|
||
|
"queue",
|
||
|
"stack",
|
||
|
"linked-list",
|
||
|
"tree",
|
||
|
"es6",
|
||
|
"dom",
|
||
|
"symbol"
|
||
|
],
|
||
|
"license": "MIT",
|
||
|
"main": "lib/SymbolTree.js",
|
||
|
"maintainers": [
|
||
|
{
|
||
|
"name": "joris-van-der-wel",
|
||
|
"email": "joris@jorisvanderwel.com"
|
||
|
}
|
||
|
],
|
||
|
"name": "symbol-tree",
|
||
|
"optionalDependencies": {},
|
||
|
"readme": "symbol-tree\n===========\n[![Travis CI Build Status](https://api.travis-ci.org/jsdom/js-symbol-tree.svg?branch=master)](https://travis-ci.org/jsdom/js-symbol-tree) [![Coverage Status](https://coveralls.io/repos/github/jsdom/js-symbol-tree/badge.svg?branch=master)](https://coveralls.io/github/jsdom/js-symbol-tree?branch=master)\n\nTurn any collection of objects into its own efficient tree or linked list using `Symbol`.\n\nThis library has been designed to provide an efficient backing data structure for DOM trees. You can also use this library as an efficient linked list. Any meta data is stored on your objects directly, which ensures any kind of insertion or deletion is performed in constant time. Because an ES6 `Symbol` is used, the meta data does not interfere with your object in any way.\n\nNode.js 4+, io.js and modern browsers are supported.\n\nExample\n-------\nA linked list:\n\n```javascript\nconst SymbolTree = require('symbol-tree');\nconst tree = new SymbolTree();\n\nlet a = {foo: 'bar'}; // or `new Whatever()`\nlet b = {foo: 'baz'};\nlet c = {foo: 'qux'};\n\ntree.insertBefore(b, a); // insert a before b\ntree.insertAfter(b, c); // insert c after b\n\nconsole.log(tree.nextSibling(a) === b);\nconsole.log(tree.nextSibling(b) === c);\nconsole.log(tree.previousSibling(c) === b);\n\ntree.remove(b);\nconsole.log(tree.nextSibling(a) === c);\n```\n\nA tree:\n\n```javascript\nconst SymbolTree = require('symbol-tree');\nconst tree = new SymbolTree();\n\nlet parent = {};\nlet a = {};\nlet b = {};\nlet c = {};\n\ntree.prependChild(parent, a); // insert a as the first child\ntree.appendChild(parent,c ); // insert c as the last child\ntree.insertAfter(a, b); // insert b after a, it now has the same parent as a\n\nconsole.log(tree.firstChild(parent) === a);\nconsole.log(tree.nextSibling(tree.firstChild(parent)) === b);\nconsole.log(tree.lastChild(parent) === c);\n\nlet grandparent = {};\ntree.prependChild(grandparent, parent);\nconsole.log(tree.firstChild(tree.firstChild(grandparent)) === a);\n```\n\nTesting\n-------\nMake sure you install the dependencies first:\n\n npm install\n\nYou can now run the unit tests by executing:\n\n npm test\n\nThe line and branch coverage should be 100%.\n\nAPI Documentation\n-----------------\n<a name=\"module_symbol-tree\"></a>\n\n## symbol-tree\n**Author:** Joris van der Wel <joris@jorisvanderwel.com>\n\n* [symbol-tree](#module_symbol-tree)\n * [SymbolTree](#exp_module_symbol-tree--SymbolTree) ⏏\n * [new SymbolTree([description])](#new_module_symbol-tree--SymbolTree_new)\n * [.initialize(object)](#module_symbol-tree--SymbolTree+initialize) ⇒ <code>Object</code>\n * [.hasChildren(object)](#module_symbol-tree--SymbolTree+hasChildren) ⇒ <code>Boolean</code>\n * [.firstChild(object)](#module_symbol-tree--SymbolTree+firstChild) ⇒ <code>Object</code>\n * [.lastChild(object)](#module_symbol-tree--SymbolTree+lastChild) ⇒ <code>Object</code>\n * [.previousSibling(object)](#module_symbol-tree--SymbolTree+previousSibling) ⇒ <code>Object</code>\n * [.nextSibling(object)](#module_symbol-tree--SymbolTree+nextSibling) ⇒ <code>Object</code>\n * [.parent(object)](#module_symbol-tree--SymbolTree+parent) ⇒ <code>Object</code>\n * [.lastInclusiveDescendant(object)](#module_symbol-tree--SymbolTree+lastInclusiveDescendant) ⇒ <code>Object</code>\n * [.preceding(object, [options])](#module_symbol-tree--SymbolTree+preceding) ⇒ <code>Object</code>\n * [.following(object, [options])](#module_symbol-tree--SymbolTree+following) ⇒ <code>Object</code>\n * [.childrenToArray(parent, [options])](#module_symbol-tree--SymbolTree+childrenToArray) ⇒ <code>Array.<Object></code>\n * [.ancestorsToArray(object, [options])](#module_symbol-tree--SymbolTree+ancestorsToArray) ⇒ <code>Array.<Object></code>\n * [.treeToArray(root, [options])](#module_symbol-tree--SymbolTree+treeToArray) ⇒ <code>Array.<Object></code>\n * [.childrenIterator(parent, [options])](#module_symb
|
||
|
"readmeFilename": "README.md",
|
||
|
"repository": {
|
||
|
"type": "git",
|
||
|
"url": "git+https://github.com/jsdom/js-symbol-tree.git"
|
||
|
},
|
||
|
"scripts": {
|
||
|
"ci": "istanbul cover test/SymbolTree.js --report lcovonly && cat ./coverage/lcov.info | coveralls",
|
||
|
"documentation": "jsdoc2md --files lib/SymbolTree.js >> README.md",
|
||
|
"lint": "eslint lib test",
|
||
|
"postci": "npm run posttest",
|
||
|
"posttest": "npm run lint",
|
||
|
"predocumentation": "cp readme-header.md README.md",
|
||
|
"test": "istanbul cover test/SymbolTree.js"
|
||
|
},
|
||
|
"version": "3.2.2"
|
||
|
}
|