Skip to content

Commit

Permalink
Release. Bump version number
Browse files Browse the repository at this point in the history
  • Loading branch information
bryaningl3 committed Nov 22, 2023
1 parent ec94efe commit 8a12118
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@barchart/portfolio-api-common",
"version": "1.27.1",
"version": "1.27.2",
"description": "Common JavaScript code used by Barchart's Portfolio Service",
"author": {
"name": "Bryan Ingle",
Expand Down
23 changes: 15 additions & 8 deletions test/SpecRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -2672,21 +2672,28 @@ module.exports = (() => {

if (symbol) {
const rate = Rate.fromPair(quote.lastPrice, symbol);
const index = this._forexQuotes.findIndex(existing => existing.formatPair() === rate.formatPair());

let index = this._forexQuotes.findIndex(existing => existing.formatPair() === rate.formatPair());

if (index < 0) {
const inverted = rate.invert();

index = this._forexQuotes.findIndex(existing => existing.formatPair() === inverted.formatPair());
}

if (index < 0) {
this._forexQuotes.push(rate);
} else {
this._forexQuotes[index] = rate;
}

Object.keys(this._trees).forEach((key) => {
this._trees[key].walk(group => group.setForexRates(this._forexQuotes), true, false);
});

recalculatePercentages.call(this);
}
});

Object.keys(this._trees).forEach((key) => {
this._trees[key].walk(group => group.setForexRates(this._forexQuotes), true, false);
});
}

if (positionQuotes.length !== 0 || forexQuotes.length !== 0) {
Expand Down Expand Up @@ -3544,7 +3551,7 @@ module.exports = (() => {
}

/**
* Indicates if the group will only contain one {@link PositionItem} -- that is,
* Indicates if the group will only contain one {@link PositionItem} that is,
* indicates if the group represents a single position.
*
* @public
Expand Down Expand Up @@ -3837,7 +3844,7 @@ module.exports = (() => {
if (summary.count > 0) {
averageFormat = formatPercent(new Decimal(summary.total / summary.count), 2, true);
} else {
averageFormat = '--';
averageFormat = '';
}

summary.averageFormat = averageFormat;
Expand All @@ -3847,7 +3854,7 @@ module.exports = (() => {

return sums;
}, fundamentalFields.reduce((sums, fieldName) => {
sums[fieldName] = { total: 0, count: 0, averageFormat: '--' };
sums[fieldName] = { total: 0, count: 0, averageFormat: '' };

return sums;
}, { }));
Expand Down

0 comments on commit 8a12118

Please sign in to comment.