Skip to content

Commit 20fa9b6

Browse files
Grammar and style fixes for the jsdoc documentation
1 parent 3cc48ec commit 20fa9b6

File tree

1 file changed

+41
-39
lines changed

1 file changed

+41
-39
lines changed

lib/SymbolTree.js

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SymbolTree {
2929
}
3030

3131
/**
32-
* You can optionally initialize an object after its creation,
32+
* You can use this function to (optionally) initialize an object right after its creation,
3333
* to take advantage of V8's fast properties. Also useful if you would like to
3434
* freeze your object.
3535
*
@@ -63,7 +63,7 @@ class SymbolTree {
6363
/**
6464
* Returns `true` if the object has any children. Otherwise it returns `false`.
6565
*
66-
* `O(1)`
66+
* * `O(1)`
6767
*
6868
* @method hasChildren
6969
* @memberOf module:symbol-tree#
@@ -75,9 +75,9 @@ class SymbolTree {
7575
}
7676

7777
/**
78-
* Return the first child of the given object.
78+
* Returns the first child of the given object.
7979
*
80-
* `O(1)`
80+
* * `O(1)`
8181
*
8282
* @method firstChild
8383
* @memberOf module:symbol-tree#
@@ -89,9 +89,9 @@ class SymbolTree {
8989
}
9090

9191
/**
92-
* Return the last child of the given object.
92+
* Returns the last child of the given object.
9393
*
94-
* `O(1)`
94+
* * `O(1)`
9595
*
9696
* @method lastChild
9797
* @memberOf module:symbol-tree#
@@ -103,9 +103,9 @@ class SymbolTree {
103103
}
104104

105105
/**
106-
* Return the previous sibling of the given object.
106+
* Returns the previous sibling of the given object.
107107
*
108-
* `O(1)`
108+
* * `O(1)`
109109
*
110110
* @method previousSibling
111111
* @memberOf module:symbol-tree#
@@ -117,9 +117,9 @@ class SymbolTree {
117117
}
118118

119119
/**
120-
* Return the nextSibling sibling of the given object.
120+
* Returns the next sibling of the given object.
121121
*
122-
* `O(1)`
122+
* * `O(1)`
123123
*
124124
* @method nextSibling
125125
* @memberOf module:symbol-tree#
@@ -133,7 +133,7 @@ class SymbolTree {
133133
/**
134134
* Return the parent of the given object.
135135
*
136-
* `O(1)`
136+
* * `O(1)`
137137
*
138138
* @method parent
139139
* @memberOf module:symbol-tree#
@@ -147,7 +147,7 @@ class SymbolTree {
147147
/**
148148
* Find the inclusive descendant that is last in tree order of the given object.
149149
*
150-
* `O(n)` (worst case) where n is the depth of the subtree of `object`
150+
* * `O(n)` (worst case) where `n` is the depth of the subtree of `object`
151151
*
152152
* @method lastInclusiveDescendant
153153
* @memberOf module:symbol-tree#
@@ -169,8 +169,8 @@ class SymbolTree {
169169
* An object A is preceding an object B if A and B are in the same tree
170170
* and A comes before B in tree order.
171171
*
172-
* `O(n)` (worst case) <br>
173-
* `O(1)` (amortized when walking the entire tree)
172+
* * `O(n)` (worst case)
173+
* * `O(1)` (amortized when walking the entire tree)
174174
*
175175
* @method preceding
176176
* @memberOf module:symbol-tree#
@@ -203,8 +203,8 @@ class SymbolTree {
203203
* An object A is following an object B if A and B are in the same tree
204204
* and A comes after B in tree order.
205205
*
206-
* `O(n)` (worst case) where n is the amount of objects in the entire tree<br>
207-
* `O(1)` (amortized when walking the entire tree)
206+
* * `O(n)` (worst case) where `n` is the amount of objects in the entire tree
207+
* * `O(1)` (amortized when walking the entire tree)
208208
*
209209
* @method following
210210
* @memberOf module:symbol-tree#
@@ -249,7 +249,7 @@ class SymbolTree {
249249
/**
250250
* Append all children of the given object to an array.
251251
*
252-
* `O(n)` where n is the amount of children of the given `parent`
252+
* * `O(n)` where `n` is the amount of children of the given `parent`
253253
*
254254
* @method childrenToArray
255255
* @memberOf module:symbol-tree#
@@ -289,7 +289,7 @@ class SymbolTree {
289289
/**
290290
* Append all inclusive ancestors of the given object to an array.
291291
*
292-
* `O(n)` where n is the amount of ancestors of the given `object`
292+
* * `O(n)` where `n` is the amount of ancestors of the given `object`
293293
*
294294
* @method ancestorsToArray
295295
* @memberOf module:symbol-tree#
@@ -322,7 +322,7 @@ class SymbolTree {
322322
/**
323323
* Append all descendants of the given object to an array (in tree order).
324324
*
325-
* `O(n)` where n is the amount of objects in the sub-tree of the given `object`
325+
* * `O(n)` where `n` is the amount of objects in the sub-tree of the given `object`
326326
*
327327
* @method treeToArray
328328
* @memberOf module:symbol-tree#
@@ -355,7 +355,7 @@ class SymbolTree {
355355
/**
356356
* Iterate over all children of the given object
357357
*
358-
* `O(1)` for a single iteration
358+
* * `O(1)` for a single iteration
359359
*
360360
* @method childrenIterator
361361
* @memberOf module:symbol-tree#
@@ -379,7 +379,7 @@ class SymbolTree {
379379
/**
380380
* Iterate over all the previous siblings of the given object. (in reverse tree order)
381381
*
382-
* `O(1)` for a single iteration
382+
* * `O(1)` for a single iteration
383383
*
384384
* @method previousSiblingsIterator
385385
* @memberOf module:symbol-tree#
@@ -398,7 +398,7 @@ class SymbolTree {
398398
/**
399399
* Iterate over all the next siblings of the given object. (in tree order)
400400
*
401-
* `O(1)` for a single iteration
401+
* * `O(1)` for a single iteration
402402
*
403403
* @method nextSiblingsIterator
404404
* @memberOf module:symbol-tree#
@@ -417,7 +417,7 @@ class SymbolTree {
417417
/**
418418
* Iterate over all inclusive ancestors of the given object
419419
*
420-
* `O(1)` for a single iteration
420+
* * `O(1)` for a single iteration
421421
*
422422
* @method ancestorsIterator
423423
* @memberOf module:symbol-tree#
@@ -436,9 +436,10 @@ class SymbolTree {
436436
/**
437437
* Iterate over all descendants of the given object (in tree order).
438438
*
439-
* where n is the amount of objects in the sub-tree of the given `root`:
440-
* `O(n)` (worst case for a single iterator)
441-
* `O(n)` (amortized, when completing the iterator)<br>
439+
* Where `n` is the amount of objects in the sub-tree of the given `root`:
440+
*
441+
* * `O(n)` (worst case for a single iteration)
442+
* * `O(n)` (amortized, when completing the iterator)
442443
*
443444
* @method treeIterator
444445
* @memberOf module:symbol-tree#
@@ -461,8 +462,8 @@ class SymbolTree {
461462
/**
462463
* Find the index of the given object (the number of preceding siblings).
463464
*
464-
* `O(n)` where n is the amount of preceding siblings<br>
465-
* `O(1)` (amortized, if the tree is not modified)
465+
* * `O(n)` where `n` is the amount of preceding siblings
466+
* * `O(1)` (amortized, if the tree is not modified)
466467
*
467468
* @method index
468469
* @memberOf module:symbol-tree#
@@ -515,8 +516,8 @@ class SymbolTree {
515516
/**
516517
* Calculate the number of children.
517518
*
518-
* `O(n)` where n is the amount of children<br>
519-
* `O(1)` (amortized, if the tree is not modified)
519+
* * `O(n)` where `n` is the amount of children
520+
* * `O(1)` (amortized, if the tree is not modified)
520521
*
521522
* @method childrenCount
522523
* @memberOf module:symbol-tree#
@@ -547,10 +548,11 @@ class SymbolTree {
547548
* The semantics are the same as compareDocumentPosition in DOM, with the exception that
548549
* DISCONNECTED never occurs with any other bit.
549550
*
550-
* where n and m are the amount of ancestors of `left` and `right`;
551-
* where o is the amount of children of the lowest common ancestor of `left` and `right`:
552-
* `O(n + m + o)` (worst case)
553-
* `O(n + m)` (amortized, if the tree is not modified)
551+
* where `n` and `m` are the amount of ancestors of `left` and `right`;
552+
* where `o` is the amount of children of the lowest common ancestor of `left` and `right`:
553+
*
554+
* * `O(n + m + o)` (worst case)
555+
* * `O(n + m)` (amortized, if the tree is not modified)
554556
*
555557
* @method compareTreePosition
556558
* @memberOf module:symbol-tree#
@@ -633,7 +635,7 @@ class SymbolTree {
633635
* Remove the object from this tree.
634636
* Has no effect if already removed.
635637
*
636-
* `O(1)`
638+
* * `O(1)`
637639
*
638640
* @method remove
639641
* @memberOf module:symbol-tree#
@@ -679,7 +681,7 @@ class SymbolTree {
679681
* Insert the given object before the reference object.
680682
* `newObject` is now the previous sibling of `referenceObject`.
681683
*
682-
* `O(1)`
684+
* * `O(1)`
683685
*
684686
* @method insertBefore
685687
* @memberOf module:symbol-tree#
@@ -722,7 +724,7 @@ class SymbolTree {
722724
* Insert the given object after the reference object.
723725
* `newObject` is now the next sibling of `referenceObject`.
724726
*
725-
* `O(1)`
727+
* * `O(1)`
726728
*
727729
* @method insertAfter
728730
* @memberOf module:symbol-tree#
@@ -765,7 +767,7 @@ class SymbolTree {
765767
* Insert the given object as the first child of the given reference object.
766768
* `newObject` is now the first child of `referenceObject`.
767769
*
768-
* `O(1)`
770+
* * `O(1)`
769771
*
770772
* @method prependChild
771773
* @memberOf module:symbol-tree#
@@ -799,7 +801,7 @@ class SymbolTree {
799801
* Insert the given object as the last child of the given reference object.
800802
* `newObject` is now the last child of `referenceObject`.
801803
*
802-
* `O(1)`
804+
* * `O(1)`
803805
*
804806
* @method appendChild
805807
* @memberOf module:symbol-tree#

0 commit comments

Comments
 (0)