@barchart/portfolio-api-common 1.2.82 → 1.2.83
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.
- package/lib/processing/PositionContainer.js +12 -10
- package/package.json +1 -1
- package/test/SpecRunner.js +12 -10
|
@@ -276,7 +276,7 @@ module.exports = (() => {
|
|
|
276
276
|
|
|
277
277
|
const existingBarchartSymbols = this.getPositionSymbols(false);
|
|
278
278
|
|
|
279
|
-
removePositionItem.call(this, this._items.find(
|
|
279
|
+
removePositionItem.call(this, this._items.find(item => item.position.position === position.position));
|
|
280
280
|
|
|
281
281
|
summaries.forEach((summary) => {
|
|
282
282
|
addSummaryCurrent(this._summariesCurrent, summary, this._currentSummaryFrame, this._currentSummaryRange);
|
|
@@ -336,7 +336,7 @@ module.exports = (() => {
|
|
|
336
336
|
assert.argumentIsRequired(position, 'position', Object);
|
|
337
337
|
assert.argumentIsRequired(position.position, 'position.position', String);
|
|
338
338
|
|
|
339
|
-
removePositionItem.call(this, this._items.find(
|
|
339
|
+
removePositionItem.call(this, this._items.find(item => item.position.position === position.position));
|
|
340
340
|
|
|
341
341
|
recalculatePercentages.call(this);
|
|
342
342
|
}
|
|
@@ -391,17 +391,19 @@ module.exports = (() => {
|
|
|
391
391
|
}
|
|
392
392
|
|
|
393
393
|
/**
|
|
394
|
-
* Returns
|
|
394
|
+
* Returns a position's lock status.
|
|
395
395
|
*
|
|
396
396
|
* @public
|
|
397
|
-
* @
|
|
397
|
+
* @param {Object} position
|
|
398
|
+
* @return {Boolean}
|
|
398
399
|
*/
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
400
|
+
getPositionLock(portfolio, position) {
|
|
401
|
+
assert.argumentIsRequired(position, 'position', Object);
|
|
402
|
+
assert.argumentIsRequired(position.position, 'position.position', String);
|
|
403
|
+
|
|
404
|
+
const item = this._items.find(i => i.position.position === position.position);
|
|
405
|
+
|
|
406
|
+
return is.object(item) && item.locked;
|
|
405
407
|
}
|
|
406
408
|
|
|
407
409
|
/**
|
package/package.json
CHANGED
package/test/SpecRunner.js
CHANGED
|
@@ -1655,7 +1655,7 @@ module.exports = (() => {
|
|
|
1655
1655
|
|
|
1656
1656
|
const existingBarchartSymbols = this.getPositionSymbols(false);
|
|
1657
1657
|
|
|
1658
|
-
removePositionItem.call(this, this._items.find(
|
|
1658
|
+
removePositionItem.call(this, this._items.find(item => item.position.position === position.position));
|
|
1659
1659
|
|
|
1660
1660
|
summaries.forEach((summary) => {
|
|
1661
1661
|
addSummaryCurrent(this._summariesCurrent, summary, this._currentSummaryFrame, this._currentSummaryRange);
|
|
@@ -1715,7 +1715,7 @@ module.exports = (() => {
|
|
|
1715
1715
|
assert.argumentIsRequired(position, 'position', Object);
|
|
1716
1716
|
assert.argumentIsRequired(position.position, 'position.position', String);
|
|
1717
1717
|
|
|
1718
|
-
removePositionItem.call(this, this._items.find(
|
|
1718
|
+
removePositionItem.call(this, this._items.find(item => item.position.position === position.position));
|
|
1719
1719
|
|
|
1720
1720
|
recalculatePercentages.call(this);
|
|
1721
1721
|
}
|
|
@@ -1770,17 +1770,19 @@ module.exports = (() => {
|
|
|
1770
1770
|
}
|
|
1771
1771
|
|
|
1772
1772
|
/**
|
|
1773
|
-
* Returns
|
|
1773
|
+
* Returns a position's lock status.
|
|
1774
1774
|
*
|
|
1775
1775
|
* @public
|
|
1776
|
-
* @
|
|
1776
|
+
* @param {Object} position
|
|
1777
|
+
* @return {Boolean}
|
|
1777
1778
|
*/
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1779
|
+
getPositionLock(portfolio, position) {
|
|
1780
|
+
assert.argumentIsRequired(position, 'position', Object);
|
|
1781
|
+
assert.argumentIsRequired(position.position, 'position.position', String);
|
|
1782
|
+
|
|
1783
|
+
const item = this._items.find(i => i.position.position === position.position);
|
|
1784
|
+
|
|
1785
|
+
return is.object(item) && item.locked;
|
|
1784
1786
|
}
|
|
1785
1787
|
|
|
1786
1788
|
/**
|