@barchart/portfolio-api-common 1.0.140 → 1.0.141
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.
|
@@ -332,12 +332,21 @@ module.exports = (() => {
|
|
|
332
332
|
* @param {String} symbol
|
|
333
333
|
* @param {Object} data
|
|
334
334
|
*/
|
|
335
|
-
setPositionFundamentalData(symbol, data) {
|
|
335
|
+
setPositionFundamentalData(symbol, display, data) {
|
|
336
336
|
assert.argumentIsRequired(symbol, 'symbol', String);
|
|
337
|
+
assert.argumentIsRequired(display, 'display', Boolean);
|
|
337
338
|
assert.argumentIsRequired(data, 'data', Object);
|
|
338
339
|
|
|
339
|
-
|
|
340
|
-
|
|
340
|
+
let map;
|
|
341
|
+
|
|
342
|
+
if (display) {
|
|
343
|
+
map = this._symbolsDisplay;
|
|
344
|
+
} else {
|
|
345
|
+
map = this._symbols;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
if (map.hasOwnProperty(symbol)) {
|
|
349
|
+
map[symbol].forEach(item => item.setPositionFundamentalData(data));
|
|
341
350
|
}
|
|
342
351
|
}
|
|
343
352
|
|
package/package.json
CHANGED
package/test/SpecRunner.js
CHANGED
|
@@ -1048,12 +1048,21 @@ module.exports = (() => {
|
|
|
1048
1048
|
* @param {String} symbol
|
|
1049
1049
|
* @param {Object} data
|
|
1050
1050
|
*/
|
|
1051
|
-
setPositionFundamentalData(symbol, data) {
|
|
1051
|
+
setPositionFundamentalData(symbol, display, data) {
|
|
1052
1052
|
assert.argumentIsRequired(symbol, 'symbol', String);
|
|
1053
|
+
assert.argumentIsRequired(display, 'display', Boolean);
|
|
1053
1054
|
assert.argumentIsRequired(data, 'data', Object);
|
|
1054
1055
|
|
|
1055
|
-
|
|
1056
|
-
|
|
1056
|
+
let map;
|
|
1057
|
+
|
|
1058
|
+
if (display) {
|
|
1059
|
+
map = this._symbolsDisplay;
|
|
1060
|
+
} else {
|
|
1061
|
+
map = this._symbols;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
if (map.hasOwnProperty(symbol)) {
|
|
1065
|
+
map[symbol].forEach(item => item.setPositionFundamentalData(data));
|
|
1057
1066
|
}
|
|
1058
1067
|
}
|
|
1059
1068
|
|