@barchart/portfolio-api-common 1.0.136 → 1.0.137

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.
@@ -146,7 +146,7 @@ module.exports = (() => {
146
146
  this._dataFormat.newsExists = exists;
147
147
  });
148
148
 
149
- item._fundamentalDataChangeEvent((data, sender) => {
149
+ item.registerFundamentalDataChangeHandler((data, sender) => {
150
150
  this._dataFormat.fundamental = data;
151
151
  });
152
152
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.0.136",
3
+ "version": "1.0.137",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -1305,7 +1305,7 @@ module.exports = (() => {
1305
1305
  this._dataFormat.newsExists = exists;
1306
1306
  });
1307
1307
 
1308
- item._fundamentalDataChangeEvent((data, sender) => {
1308
+ item.registerFundamentalDataChangeHandler((data, sender) => {
1309
1309
  this._dataFormat.fundamental = data;
1310
1310
  });
1311
1311
  }
@@ -2859,7 +2859,7 @@ module.exports = function () {
2859
2859
  var Currency = function (_Enum) {
2860
2860
  _inherits(Currency, _Enum);
2861
2861
 
2862
- function Currency(code, description, precision, alternateDescription) {
2862
+ function Currency(code, description, precision) {
2863
2863
  _classCallCheck(this, Currency);
2864
2864
 
2865
2865
  var _this = _possibleConstructorReturn(this, (Currency.__proto__ || Object.getPrototypeOf(Currency)).call(this, code, description));
@@ -2867,11 +2867,7 @@ module.exports = function () {
2867
2867
  assert.argumentIsRequired(precision, 'precision', Number);
2868
2868
  assert.argumentIsValid(precision, 'precision', is.integer, 'is an integer');
2869
2869
 
2870
- assert.argumentIsOptional(alternateDescription, 'alternateDescription', String);
2871
-
2872
2870
  _this._precision = precision;
2873
-
2874
- _this._alternateDescription = alternateDescription || description;
2875
2871
  return _this;
2876
2872
  }
2877
2873
 
@@ -2894,19 +2890,6 @@ module.exports = function () {
2894
2890
  return this._precision;
2895
2891
  }
2896
2892
 
2897
- /**
2898
- * An alternate human-readable description.
2899
- *
2900
- * @public
2901
- * @returns {String}
2902
- */
2903
-
2904
- }, {
2905
- key: 'alternateDescription',
2906
- get: function get() {
2907
- return this._alternateDescription;
2908
- }
2909
-
2910
2893
  /**
2911
2894
  * Given a code, returns the enumeration item.
2912
2895
  *
@@ -2964,9 +2947,9 @@ module.exports = function () {
2964
2947
  return Currency;
2965
2948
  }(Enum);
2966
2949
 
2967
- var cad = new Currency('CAD', 'Canadian Dollar', 2, 'CAD$');
2968
- var eur = new Currency('EUR', 'Euro', 2, 'EUR');
2969
- var usd = new Currency('USD', 'US Dollar', 2, 'US$');
2950
+ var cad = new Currency('CAD', 'Canadian Dollar', 2);
2951
+ var eur = new Currency('EUR', 'Euro', 2);
2952
+ var usd = new Currency('USD', 'US Dollar', 2);
2970
2953
 
2971
2954
  return Currency;
2972
2955
  }();
@@ -3940,9 +3923,9 @@ module.exports = function () {
3940
3923
  assert.argumentIsRequired(a, 'a', Decimal, 'Decimal');
3941
3924
  assert.argumentIsRequired(b, 'b', Decimal, 'Decimal');
3942
3925
 
3943
- if (a._big.gt(b._big)) {
3926
+ if (a._big.gt(b)) {
3944
3927
  return 1;
3945
- } else if (a._big.lt(b._big)) {
3928
+ } else if (a._big.lt(b)) {
3946
3929
  return -1;
3947
3930
  } else {
3948
3931
  return 0;
@@ -4403,10 +4386,12 @@ var _createClass = function () { function defineProperties(target, props) { for
4403
4386
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4404
4387
 
4405
4388
  var assert = require('./assert'),
4389
+ is = require('./is'),
4406
4390
  memoize = require('./memoize');
4407
4391
 
4408
4392
  var Currency = require('./Currency'),
4409
- Decimal = require('./Decimal');
4393
+ Decimal = require('./Decimal'),
4394
+ Enum = require('./Enum');
4410
4395
 
4411
4396
  module.exports = function () {
4412
4397
  'use strict';
@@ -4586,7 +4571,12 @@ module.exports = function () {
4586
4571
  assert.argumentIsRequired(amount, 'amount', Decimal, 'Decimal');
4587
4572
  assert.argumentIsRequired(currency, 'currency', Currency, 'Currency');
4588
4573
  assert.argumentIsRequired(desiredCurrency, 'desiredCurrency', Currency, 'Currency');
4589
- //assert.argumentIsArray(rates, 'rates', Rate, 'Rate');
4574
+
4575
+ for (var _len = arguments.length, rates = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
4576
+ rates[_key - 3] = arguments[_key];
4577
+ }
4578
+
4579
+ assert.argumentIsArray(rates, 'rates', Rate, 'Rate');
4590
4580
 
4591
4581
  var converted = void 0;
4592
4582
 
@@ -4596,10 +4586,6 @@ module.exports = function () {
4596
4586
  var numerator = desiredCurrency;
4597
4587
  var denominator = currency;
4598
4588
 
4599
- for (var _len = arguments.length, rates = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
4600
- rates[_key - 3] = arguments[_key];
4601
- }
4602
-
4603
4589
  var rate = rates.find(function (r) {
4604
4590
  return r.numerator === numerator && r.denominator === denominator || r.numerator === denominator && r.denominator === numerator;
4605
4591
  });
@@ -4650,7 +4636,7 @@ module.exports = function () {
4650
4636
  return Rate;
4651
4637
  }();
4652
4638
 
4653
- },{"./Currency":12,"./Decimal":14,"./assert":19,"./memoize":22}],18:[function(require,module,exports){
4639
+ },{"./Currency":12,"./Decimal":14,"./Enum":16,"./assert":19,"./is":21,"./memoize":22}],18:[function(require,module,exports){
4654
4640
  'use strict';
4655
4641
 
4656
4642
  var assert = require('./assert'),