Là một dự án backend, jsdom/js-symbol-tree đã đạt 113 sao trên GitHub, ngôn ngữ JavaScript. Turn any collection of objects into its own efficient tree or linked list using Symbol
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Turn any collection of objects into its own efficient tree or linked list using Symbol.
This 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.
Node.js 4+, io.js and modern browsers are supported.
Example
A linked list:
const SymbolTree = require('symbol-tree');
const tree = new SymbolTree();
let a = {foo: 'bar'}; // or `new Whatever()`
let b = {foo: 'baz'};
let c = {foo: 'qux'};
tree.insertBefore(b, a); // insert a before b
tree.insertAfter(b, c); // insert c after b
console.log(tree.nextSibling(a) === b);
console.log(tree.nextSibling(b) === c);
console.log(tree.previousSibling(c) === b);
tree.remove(b);
console.log(tree.nextSibling(a) === c);
A tree:
const SymbolTree = require('symbol-tree');
const tree = new SymbolTree();
let parent = {};
let a = {};
let b = {};
let c = {};
tree.prependChild(parent, a); // insert a as the first child
tree.appendChild(parent,c ); // insert c as the last child
tree.insertAfter(a, b); // insert b after a, it now has the same parent as a
console.log(tree.firstChild(parent) === a);
console.log(tree.nextSibling(tree.firstChild(parent)) === b);
console.log(tree.lastChild(parent) === c);
let grandparent = {};
tree.prependChild(grandparent, parent);
console.log(tree.firstChild(tree.firstChild(grandparent)) === a);
You can use this function to (optionally) initialize an object right after its creation,
to take advantage of V8's fast properties. Also useful if you would like to
freeze your object.
O(1)
Kind: instance method of SymbolTree Returns: Object - object
Param
Type
object
Object
symbolTree.hasChildren(object) ⇒ Boolean
Returns true if the object has any children. Otherwise it returns false.
Find the inclusive descendant that is last in tree order of the given object.
O(n) (worst case) where n is the depth of the subtree of object
Kind: instance method of SymbolTree
Param
Type
object
Object
symbolTree.preceding(object, [options]) ⇒ Object
Find the preceding object (A) of the given object (B).
An object A is preceding an object B if A and B are in the same tree
and A comes before B in tree order.
O(n) (worst case)
O(1) (amortized when walking the entire tree)
Kind: instance method of SymbolTree
Param
Type
Description
object
Object
[options]
Object
[options.root]
Object
If set, root must be an inclusive ancestor of the return value (or else null is returned). This check assumes that root is also an inclusive ancestor of the given object
symbolTree.following(object, [options]) ⇒ Object
Find the following object (A) of the given object (B).
An object A is following an object B if A and B are in the same tree
and A comes after B in tree order.
O(n) (worst case) where n is the amount of objects in the entire tree
O(1) (amortized when walking the entire tree)
Kind: instance method of SymbolTree
Param
Type
Default
Description
object
Object
[options]
Object
[options.root]
Object
If set, root must be an inclusive ancestor of the return value (or else null is returned). This check assumes that root is also an inclusive ancestor of the given object
jsdom/js-symbol-tree thuộc nhóm Backend trên TopGit, cùng 15 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về jsdom/js-symbol-tree ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/jsdom/js-symbol-tree là nguồn chính thức.
jsdom/js-symbol-tree có bao nhiêu sao?
jsdom/js-symbol-tree có 113 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/jsdom/js-symbol-tree. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
Có — jsdom/js-symbol-tree phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/jsdom/js-symbol-tree.
jsdom/js-symbol-tree có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho jsdom/js-symbol-tree. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
jsdom/js-symbol-tree còn đang phát triển không?
Commit gần nhất trên jsdom/js-symbol-tree là 6.3 năm trước (theo timestamp GitHub). Repo có 23 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về js-symbol-tree?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về js-symbol-tree.