@barchart/portfolio-api-common 1.0.248 → 1.0.252
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.
|
@@ -88,7 +88,7 @@ module.exports = (() => {
|
|
|
88
88
|
.withField('open', DataType.BOOLEAN, true)
|
|
89
89
|
.withField('transaction', DataType.NUMBER)
|
|
90
90
|
.withField('valuation', DataType.forEnum(ValuationType, 'ValuationType'))
|
|
91
|
-
.withField('reinvest', DataType.BOOLEAN)
|
|
91
|
+
.withField('reinvest', DataType.BOOLEAN, true)
|
|
92
92
|
.withField('snapshot.date', DataType.DAY)
|
|
93
93
|
.withField('snapshot.open', DataType.DECIMAL)
|
|
94
94
|
.withField('snapshot.direction', DataType.forEnum(PositionDirection, 'PositionDirection'))
|
|
@@ -120,7 +120,7 @@ module.exports = (() => {
|
|
|
120
120
|
.withField('open', DataType.BOOLEAN, true)
|
|
121
121
|
.withField('transaction', DataType.NUMBER)
|
|
122
122
|
.withField('valuation', DataType.forEnum(ValuationType, 'ValuationType'))
|
|
123
|
-
.withField('reinvest', DataType.BOOLEAN)
|
|
123
|
+
.withField('reinvest', DataType.BOOLEAN, true)
|
|
124
124
|
.withField('snapshot.date', DataType.DAY)
|
|
125
125
|
.withField('snapshot.open', DataType.DECIMAL)
|
|
126
126
|
.withField('snapshot.direction', DataType.forEnum(PositionDirection, 'PositionDirection'))
|
|
@@ -135,6 +135,7 @@ module.exports = (() => {
|
|
|
135
135
|
);
|
|
136
136
|
|
|
137
137
|
const update = new PositionSchema(SchemaBuilder.withName('update')
|
|
138
|
+
.withField('portfolio', DataType.STRING)
|
|
138
139
|
.withField('position', DataType.STRING)
|
|
139
140
|
.withField('reinvest', DataType.BOOLEAN, true)
|
|
140
141
|
.schema
|
package/package.json
CHANGED
package/test/SpecRunner.js
CHANGED
|
@@ -3830,6 +3830,33 @@ module.exports = function () {
|
|
|
3830
3830
|
}
|
|
3831
3831
|
}
|
|
3832
3832
|
|
|
3833
|
+
/**
|
|
3834
|
+
* Climbs the tree, evaluating each parent until a predicate is matched. Once matched,
|
|
3835
|
+
* the {@link Tree} node is returned. Otherwise, if the predicate cannot be matched,
|
|
3836
|
+
* a null value is returned.
|
|
3837
|
+
*
|
|
3838
|
+
* @public
|
|
3839
|
+
* @param {Tree~nodePredicate} predicate - A predicate that tests each child node. The predicate takes two arguments -- the node's value, and the node itself.
|
|
3840
|
+
* @param {boolean=} includeCurrentNode - If true, the predicate will be applied to the current node.
|
|
3841
|
+
* @returns {Tree|null}
|
|
3842
|
+
*/
|
|
3843
|
+
|
|
3844
|
+
}, {
|
|
3845
|
+
key: 'findParent',
|
|
3846
|
+
value: function findParent(predicate, includeCurrentNode) {
|
|
3847
|
+
var returnRef = void 0;
|
|
3848
|
+
|
|
3849
|
+
if (is.boolean(includeCurrentNode) && includeCurrentNode && predicate(this.getValue(), this)) {
|
|
3850
|
+
returnRef = this;
|
|
3851
|
+
} else if (this._parent !== null) {
|
|
3852
|
+
returnRef = this._parent.findParent(predicate, true);
|
|
3853
|
+
} else {
|
|
3854
|
+
returnRef = null;
|
|
3855
|
+
}
|
|
3856
|
+
|
|
3857
|
+
return returnRef;
|
|
3858
|
+
}
|
|
3859
|
+
|
|
3833
3860
|
/**
|
|
3834
3861
|
* Creates a representation of the tree using JavaScript objects and arrays.
|
|
3835
3862
|
*
|