@barchart/portfolio-api-common 1.29.1 → 1.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -463,10 +463,17 @@ module.exports = (() => {
|
|
|
463
463
|
*
|
|
464
464
|
* @public
|
|
465
465
|
* @param {Boolean} display - If true, all "display" symbols are returned; otherwise Barchart symbols are returned.
|
|
466
|
+
* @param {Boolean} excludeExpired - If true, only non-expired symbols are filtered.
|
|
466
467
|
* @returns {String[]}
|
|
467
468
|
*/
|
|
468
|
-
getPositionSymbols(display) {
|
|
469
|
-
|
|
469
|
+
getPositionSymbols(display, excludeExpired) {
|
|
470
|
+
let items = this._items;
|
|
471
|
+
|
|
472
|
+
if (excludeExpired) {
|
|
473
|
+
items = items.filter(item => !item.data.expired);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
const symbols = items.reduce((symbols, item) => {
|
|
470
477
|
const position = item.position;
|
|
471
478
|
|
|
472
479
|
let symbol;
|