@tsdotnet/linked-node-list
Advanced tools
Comparing version 1.3.2 to 1.3.3
@@ -330,2 +330,19 @@ /* | ||
} | ||
/** | ||
* Iterable for iterating this collection in reverse order. | ||
* @return {Iterable<ProtectedLinkedNode>} | ||
*/ | ||
get reversed() { | ||
const _ = this; | ||
return { | ||
*[Symbol.iterator]() { | ||
let current, prev = _.last; | ||
while (prev) { | ||
current = prev; | ||
prev = current.previous; | ||
yield current; | ||
} | ||
} | ||
}; | ||
} | ||
*_getIterator() { | ||
@@ -332,0 +349,0 @@ let current, next = this.first; |
@@ -144,2 +144,7 @@ import { ArrayLikeWritable, PredicateWithIndex } from '@tsdotnet/common-interfaces'; | ||
replace(node: TNode, replacement: TNode): this; | ||
/** | ||
* Iterable for iterating this collection in reverse order. | ||
* @return {Iterable<ProtectedLinkedNode>} | ||
*/ | ||
get reversed(): Iterable<ProtectedLinkedNode<TNode>>; | ||
protected _getIterator(): Iterator<ProtectedLinkedNode<TNode>>; | ||
@@ -146,0 +151,0 @@ } |
@@ -334,2 +334,19 @@ "use strict"; | ||
} | ||
/** | ||
* Iterable for iterating this collection in reverse order. | ||
* @return {Iterable<ProtectedLinkedNode>} | ||
*/ | ||
get reversed() { | ||
const _ = this; | ||
return { | ||
*[Symbol.iterator]() { | ||
let current, prev = _.last; | ||
while (prev) { | ||
current = prev; | ||
prev = current.previous; | ||
yield current; | ||
} | ||
} | ||
}; | ||
} | ||
*_getIterator() { | ||
@@ -336,0 +353,0 @@ let current, next = this.first; |
{ | ||
"name": "@tsdotnet/linked-node-list", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "An unprotected bi-directional linked list. Useful for implementing other collections.", | ||
@@ -5,0 +5,0 @@ "author": "electricessence", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
53101
1028