@barchart/portfolio-api-common 1.0.191 → 1.0.192

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.
@@ -490,7 +490,10 @@ module.exports = (() => {
490
490
  getPositions(portfolio) {
491
491
  assert.argumentIsRequired(portfolio, 'portfolio', String);
492
492
 
493
- return getPositionItemsForPortfolio(this._items, portfolio);
493
+ return getPositionItemsForPortfolio(this._items, portfolio)
494
+ .map((item) => {
495
+ return item.position;
496
+ });
494
497
  }
495
498
 
496
499
  /**
@@ -695,7 +698,7 @@ module.exports = (() => {
695
698
  function getPositionItemsForPortfolio(items, portfolio) {
696
699
  return items.reduce((positionItems, item) => {
697
700
  if (item.position.portfolio === portfolio) {
698
- positionItems.push(item.position);
701
+ positionItems.push(item);
699
702
  }
700
703
 
701
704
  return positionItems;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.0.191",
3
+ "version": "1.0.192",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -1206,7 +1206,10 @@ module.exports = (() => {
1206
1206
  getPositions(portfolio) {
1207
1207
  assert.argumentIsRequired(portfolio, 'portfolio', String);
1208
1208
 
1209
- return getPositionItemsForPortfolio(this._items, portfolio);
1209
+ return getPositionItemsForPortfolio(this._items, portfolio)
1210
+ .map((item) => {
1211
+ return item.position;
1212
+ });
1210
1213
  }
1211
1214
 
1212
1215
  /**
@@ -1411,7 +1414,7 @@ module.exports = (() => {
1411
1414
  function getPositionItemsForPortfolio(items, portfolio) {
1412
1415
  return items.reduce((positionItems, item) => {
1413
1416
  if (item.position.portfolio === portfolio) {
1414
- positionItems.push(item.position);
1417
+ positionItems.push(item);
1415
1418
  }
1416
1419
 
1417
1420
  return positionItems;