@barchart/portfolio-api-common 1.2.102 → 1.2.106

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.
@@ -498,6 +498,18 @@ module.exports = (() => {
498
498
  }
499
499
  }
500
500
 
501
+ /**
502
+ * Sets a historical forex quote.
503
+ *
504
+ * @public
505
+ * @param {Object} forexQuote
506
+ * @param {Day} date
507
+ */
508
+ setHistoricalForexQuote(forexQuote, date) {
509
+ assert.argumentIsRequired(forexQuote, 'forexQuote', Object);
510
+ assert.argumentIsRequired(date, 'date', Day, 'Day');
511
+ }
512
+
501
513
  /**
502
514
  * Returns all forex symbols that are required to do currency translations.
503
515
  *
@@ -166,6 +166,18 @@ module.exports = (() => {
166
166
  this._dataFormat.cashTotal = null;
167
167
  this._dataFormat.portfolioType = null;
168
168
 
169
+ this._dataActual.periodPrice = null;
170
+ this._dataActual.periodPricePrevious = null;
171
+ this._dataActual.periodRealized = null;
172
+ this._dataActual.periodUnrealized = null;
173
+ this._dataActual.periodIncome = null;
174
+
175
+ this._dataFormat.periodPrice = null;
176
+ this._dataFormat.periodPricePrevious = null;
177
+ this._dataFormat.periodRealized = null;
178
+ this._dataFormat.periodUnrealized = null;
179
+ this._dataFormat.periodIncome = null;
180
+
169
181
  this._items.forEach((item) => {
170
182
  bindItem.call(this, item);
171
183
  });
@@ -662,6 +674,10 @@ module.exports = (() => {
662
674
  updates.marketPrevious = updates.marketPrevious.add(translate(item, item.data.marketPrevious));
663
675
  updates.marketPrevious2 = updates.marketPrevious2.add(translate(item, item.data.marketPrevious2));
664
676
 
677
+ updates.periodRealized = updates.periodRealized.add(translate(item, item.data.periodRealized));
678
+ updates.periodUnrealized = updates.periodUnrealized.add(translate(item, item.data.periodUnrealized));
679
+ updates.periodIncome = updates.periodIncome.add(translate(item, item.data.periodIncome));
680
+
665
681
  if (item.position.instrument.type === InstrumentType.CASH) {
666
682
  updates.cashTotal = updates.cashTotal.add(translate(item, item.data.market));
667
683
  }
@@ -677,7 +693,10 @@ module.exports = (() => {
677
693
  summaryTotalPrevious2: Decimal.ZERO,
678
694
  marketPrevious: Decimal.ZERO,
679
695
  marketPrevious2: Decimal.ZERO,
680
- cashTotal: Decimal.ZERO
696
+ periodRealized: Decimal.ZERO,
697
+ periodUnrealized: Decimal.ZERO,
698
+ periodIncome: Decimal.ZERO,
699
+ cashTotal: Decimal.ZERO,
681
700
  });
682
701
 
683
702
  actual.basis = updates.basis;
@@ -689,6 +708,9 @@ module.exports = (() => {
689
708
  actual.summaryTotalPrevious2 = updates.summaryTotalPrevious2;
690
709
  actual.marketPrevious = updates.marketPrevious;
691
710
  actual.marketPrevious2 = updates.marketPrevious2;
711
+ actual.periodRealized = updates.periodRealized;
712
+ actual.periodUnrealized = updates.periodUnrealized;
713
+ actual.periodIncome = updates.periodIncome;
692
714
  actual.cashTotal = updates.cashTotal;
693
715
 
694
716
  format.basis = formatCurrency(actual.basis, currency);
@@ -702,6 +724,9 @@ module.exports = (() => {
702
724
  format.summaryTotalPrevious2Negative = updates.summaryTotalPrevious2.getIsNegative();
703
725
  format.marketPrevious = formatCurrency(updates.marketPrevious, currency);
704
726
  format.marketPrevious2 = formatCurrency(updates.marketPrevious2, currency);
727
+ format.periodRealized = formatCurrency(updates.periodRealized, currency);
728
+ format.periodUnrealized = formatCurrency(updates.periodUnrealized, currency);
729
+ format.periodIncome = formatCurrency(updates.periodIncome, currency);
705
730
  format.cashTotal = formatCurrency(updates.cashTotal, currency);
706
731
 
707
732
  calculateUnrealizedPercent(group);
@@ -714,11 +739,17 @@ module.exports = (() => {
714
739
 
715
740
  actual.basisPrice = item.data.basisPrice;
716
741
 
742
+ actual.periodPrice = item.data.periodPrice;
743
+ actual.periodPricePrevious = item.data.periodPricePrevious;
744
+
717
745
  format.quantity = formatDecimal(actual.quantity, 2);
718
746
  format.quantityPrevious = formatDecimal(actual.quantityPrevious, 2);
719
-
747
+
720
748
  format.basisPrice = formatCurrency(actual.basisPrice, currency);
721
749
 
750
+ format.periodPrice = formatCurrency(actual.periodPrice, currency);
751
+ format.periodPricePrevious = formatCurrency(actual.periodPricePrevious, currency);
752
+
722
753
  format.invalid = definition.type === PositionLevelType.POSITION && item.invalid;
723
754
  format.locked = definition.type === PositionLevelType.POSITION && item.data.locked;
724
755
  }
@@ -78,6 +78,13 @@ module.exports = (() => {
78
78
  this._data.income = null;
79
79
  this._data.basisPrice = null;
80
80
 
81
+ this._data.periodRealized = null;
82
+ this._data.periodUnrealized = null;
83
+ this._data.periodIncome = null;
84
+
85
+ this._data.periodPrice = null;
86
+ this._data.periodPricePrevious = null;
87
+
81
88
  this._data.newsExists = false;
82
89
  this._data.fundamental = { };
83
90
  this._data.locked = getIsLocked(position);
@@ -367,8 +374,14 @@ module.exports = (() => {
367
374
 
368
375
  function calculateStaticData(item) {
369
376
  const position = item.position;
370
- const snapshot = getSnapshot(position, item.currentSummary, item._reporting);
371
- const previousSummaries = item.previousSummaries;
377
+
378
+ const currentSummary = item.currentSummary;
379
+
380
+ const previousSummary1 = getPreviousSummary(item.previousSummaries, 1);
381
+ const previousSummary2 = getPreviousSummary(item.previousSummaries, 2);
382
+ const previousSummary3 = getPreviousSummary(item.previousSummaries, 3);
383
+
384
+ const snapshot = getSnapshot(position, currentSummary, item._reporting);
372
385
 
373
386
  const data = item._data;
374
387
 
@@ -389,24 +402,35 @@ module.exports = (() => {
389
402
 
390
403
  data.income = snapshot.income;
391
404
 
392
- const previousSummary1 = getPreviousSummary(previousSummaries, 1);
393
- const previousSummary2 = getPreviousSummary(previousSummaries, 2);
394
- const previousSummary3 = getPreviousSummary(previousSummaries, 3);
395
-
396
405
  data.summaryTotalCurrent = calculateSummaryTotal(item.currentSummary, previousSummary1);
397
406
  data.summaryTotalPrevious = calculateSummaryTotal(previousSummary1, previousSummary2);
398
407
  data.summaryTotalPrevious2 = calculateSummaryTotal(previousSummary2, previousSummary3);
399
408
 
400
409
  data.marketPrevious = previousSummary1 === null ? Decimal.ZERO : previousSummary1.end.value;
401
410
  data.marketPrevious2 = previousSummary2 === null ? Decimal.ZERO : previousSummary2.end.value;
402
-
403
411
  data.quantityPrevious = previousSummary1 === null ? Decimal.ZERO : previousSummary1.end.open;
404
412
 
413
+ data.periodRealized = calculateRealizedPeriod(item.currentSummary, previousSummary1);
414
+ data.periodUnrealized = calculateUnrealizedPeriod(item.currentSummary, previousSummary1);
415
+ data.periodIncome = calculateIncomePeriod(item.currentSummary, previousSummary1);
416
+
405
417
  if (snapshot.open.getIsZero()) {
406
418
  data.basisPrice = Decimal.ZERO;
407
419
  } else {
408
420
  data.basisPrice = basis.divide(snapshot.open);
409
421
  }
422
+
423
+ if (currentSummary && !currentSummary.end.open.getIsZero()) {
424
+ data.periodPrice = currentSummary.end.value.divide(currentSummary.end.open);
425
+ } else {
426
+ data.periodPrice = null;
427
+ }
428
+
429
+ if (previousSummary1 && !previousSummary1.end.open.getIsZero()) {
430
+ data.periodPricePrevious = previousSummary1.end.value.divide(previousSummary1.end.open);
431
+ } else {
432
+ data.periodPricePrevious = null;
433
+ }
410
434
  }
411
435
 
412
436
  function calculatePriceData(item, price) {
@@ -543,6 +567,48 @@ module.exports = (() => {
543
567
  return returnRef;
544
568
  }
545
569
 
570
+ function calculateRealizedPeriod(currentSummary, previousSummary) {
571
+ let returnRef;
572
+
573
+ if (currentSummary) {
574
+ const period = currentSummary.period;
575
+
576
+ returnRef = period.realized;
577
+ } else {
578
+ returnRef = Decimal.ZERO;
579
+ }
580
+
581
+ return returnRef;
582
+ }
583
+
584
+ function calculateUnrealizedPeriod(currentSummary, previousSummary) {
585
+ let returnRef;
586
+
587
+ if (currentSummary) {
588
+ const period = currentSummary.period;
589
+
590
+ returnRef = period.unrealized.subtract(previousSummary !== null ? previousSummary.period.unrealized : Decimal.ZERO);
591
+ } else {
592
+ returnRef = Decimal.ZERO;
593
+ }
594
+
595
+ return returnRef;
596
+ }
597
+
598
+ function calculateIncomePeriod(currentSummary, previousSummary) {
599
+ let returnRef;
600
+
601
+ if (currentSummary) {
602
+ const period = currentSummary.period;
603
+
604
+ returnRef = period.income;
605
+ } else {
606
+ returnRef = Decimal.ZERO;
607
+ }
608
+
609
+ return returnRef;
610
+ }
611
+
546
612
  function getPreviousSummary(previousSummaries, count) {
547
613
  const index = previousSummaries.length - count;
548
614
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.2.102",
3
+ "version": "1.2.106",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -1922,6 +1922,18 @@ module.exports = (() => {
1922
1922
  }
1923
1923
  }
1924
1924
 
1925
+ /**
1926
+ * Sets a historical forex quote.
1927
+ *
1928
+ * @public
1929
+ * @param {Object} forexQuote
1930
+ * @param {Day} date
1931
+ */
1932
+ setHistoricalForexQuote(forexQuote, date) {
1933
+ assert.argumentIsRequired(forexQuote, 'forexQuote', Object);
1934
+ assert.argumentIsRequired(date, 'date', Day, 'Day');
1935
+ }
1936
+
1925
1937
  /**
1926
1938
  * Returns all forex symbols that are required to do currency translations.
1927
1939
  *
@@ -2610,6 +2622,18 @@ module.exports = (() => {
2610
2622
  this._dataFormat.cashTotal = null;
2611
2623
  this._dataFormat.portfolioType = null;
2612
2624
 
2625
+ this._dataActual.periodPrice = null;
2626
+ this._dataActual.periodPricePrevious = null;
2627
+ this._dataActual.periodRealized = null;
2628
+ this._dataActual.periodUnrealized = null;
2629
+ this._dataActual.periodIncome = null;
2630
+
2631
+ this._dataFormat.periodPrice = null;
2632
+ this._dataFormat.periodPricePrevious = null;
2633
+ this._dataFormat.periodRealized = null;
2634
+ this._dataFormat.periodUnrealized = null;
2635
+ this._dataFormat.periodIncome = null;
2636
+
2613
2637
  this._items.forEach((item) => {
2614
2638
  bindItem.call(this, item);
2615
2639
  });
@@ -3106,6 +3130,10 @@ module.exports = (() => {
3106
3130
  updates.marketPrevious = updates.marketPrevious.add(translate(item, item.data.marketPrevious));
3107
3131
  updates.marketPrevious2 = updates.marketPrevious2.add(translate(item, item.data.marketPrevious2));
3108
3132
 
3133
+ updates.periodRealized = updates.periodRealized.add(translate(item, item.data.periodRealized));
3134
+ updates.periodUnrealized = updates.periodUnrealized.add(translate(item, item.data.periodUnrealized));
3135
+ updates.periodIncome = updates.periodIncome.add(translate(item, item.data.periodIncome));
3136
+
3109
3137
  if (item.position.instrument.type === InstrumentType.CASH) {
3110
3138
  updates.cashTotal = updates.cashTotal.add(translate(item, item.data.market));
3111
3139
  }
@@ -3121,7 +3149,10 @@ module.exports = (() => {
3121
3149
  summaryTotalPrevious2: Decimal.ZERO,
3122
3150
  marketPrevious: Decimal.ZERO,
3123
3151
  marketPrevious2: Decimal.ZERO,
3124
- cashTotal: Decimal.ZERO
3152
+ periodRealized: Decimal.ZERO,
3153
+ periodUnrealized: Decimal.ZERO,
3154
+ periodIncome: Decimal.ZERO,
3155
+ cashTotal: Decimal.ZERO,
3125
3156
  });
3126
3157
 
3127
3158
  actual.basis = updates.basis;
@@ -3133,6 +3164,9 @@ module.exports = (() => {
3133
3164
  actual.summaryTotalPrevious2 = updates.summaryTotalPrevious2;
3134
3165
  actual.marketPrevious = updates.marketPrevious;
3135
3166
  actual.marketPrevious2 = updates.marketPrevious2;
3167
+ actual.periodRealized = updates.periodRealized;
3168
+ actual.periodUnrealized = updates.periodUnrealized;
3169
+ actual.periodIncome = updates.periodIncome;
3136
3170
  actual.cashTotal = updates.cashTotal;
3137
3171
 
3138
3172
  format.basis = formatCurrency(actual.basis, currency);
@@ -3146,6 +3180,9 @@ module.exports = (() => {
3146
3180
  format.summaryTotalPrevious2Negative = updates.summaryTotalPrevious2.getIsNegative();
3147
3181
  format.marketPrevious = formatCurrency(updates.marketPrevious, currency);
3148
3182
  format.marketPrevious2 = formatCurrency(updates.marketPrevious2, currency);
3183
+ format.periodRealized = formatCurrency(updates.periodRealized, currency);
3184
+ format.periodUnrealized = formatCurrency(updates.periodUnrealized, currency);
3185
+ format.periodIncome = formatCurrency(updates.periodIncome, currency);
3149
3186
  format.cashTotal = formatCurrency(updates.cashTotal, currency);
3150
3187
 
3151
3188
  calculateUnrealizedPercent(group);
@@ -3158,11 +3195,17 @@ module.exports = (() => {
3158
3195
 
3159
3196
  actual.basisPrice = item.data.basisPrice;
3160
3197
 
3198
+ actual.periodPrice = item.data.periodPrice;
3199
+ actual.periodPricePrevious = item.data.periodPricePrevious;
3200
+
3161
3201
  format.quantity = formatDecimal(actual.quantity, 2);
3162
3202
  format.quantityPrevious = formatDecimal(actual.quantityPrevious, 2);
3163
-
3203
+
3164
3204
  format.basisPrice = formatCurrency(actual.basisPrice, currency);
3165
3205
 
3206
+ format.periodPrice = formatCurrency(actual.periodPrice, currency);
3207
+ format.periodPricePrevious = formatCurrency(actual.periodPricePrevious, currency);
3208
+
3166
3209
  format.invalid = definition.type === PositionLevelType.POSITION && item.invalid;
3167
3210
  format.locked = definition.type === PositionLevelType.POSITION && item.data.locked;
3168
3211
  }
@@ -3432,6 +3475,13 @@ module.exports = (() => {
3432
3475
  this._data.income = null;
3433
3476
  this._data.basisPrice = null;
3434
3477
 
3478
+ this._data.periodRealized = null;
3479
+ this._data.periodUnrealized = null;
3480
+ this._data.periodIncome = null;
3481
+
3482
+ this._data.periodPrice = null;
3483
+ this._data.periodPricePrevious = null;
3484
+
3435
3485
  this._data.newsExists = false;
3436
3486
  this._data.fundamental = { };
3437
3487
  this._data.locked = getIsLocked(position);
@@ -3721,8 +3771,14 @@ module.exports = (() => {
3721
3771
 
3722
3772
  function calculateStaticData(item) {
3723
3773
  const position = item.position;
3724
- const snapshot = getSnapshot(position, item.currentSummary, item._reporting);
3725
- const previousSummaries = item.previousSummaries;
3774
+
3775
+ const currentSummary = item.currentSummary;
3776
+
3777
+ const previousSummary1 = getPreviousSummary(item.previousSummaries, 1);
3778
+ const previousSummary2 = getPreviousSummary(item.previousSummaries, 2);
3779
+ const previousSummary3 = getPreviousSummary(item.previousSummaries, 3);
3780
+
3781
+ const snapshot = getSnapshot(position, currentSummary, item._reporting);
3726
3782
 
3727
3783
  const data = item._data;
3728
3784
 
@@ -3743,24 +3799,35 @@ module.exports = (() => {
3743
3799
 
3744
3800
  data.income = snapshot.income;
3745
3801
 
3746
- const previousSummary1 = getPreviousSummary(previousSummaries, 1);
3747
- const previousSummary2 = getPreviousSummary(previousSummaries, 2);
3748
- const previousSummary3 = getPreviousSummary(previousSummaries, 3);
3749
-
3750
3802
  data.summaryTotalCurrent = calculateSummaryTotal(item.currentSummary, previousSummary1);
3751
3803
  data.summaryTotalPrevious = calculateSummaryTotal(previousSummary1, previousSummary2);
3752
3804
  data.summaryTotalPrevious2 = calculateSummaryTotal(previousSummary2, previousSummary3);
3753
3805
 
3754
3806
  data.marketPrevious = previousSummary1 === null ? Decimal.ZERO : previousSummary1.end.value;
3755
3807
  data.marketPrevious2 = previousSummary2 === null ? Decimal.ZERO : previousSummary2.end.value;
3756
-
3757
3808
  data.quantityPrevious = previousSummary1 === null ? Decimal.ZERO : previousSummary1.end.open;
3758
3809
 
3810
+ data.periodRealized = calculateRealizedPeriod(item.currentSummary, previousSummary1);
3811
+ data.periodUnrealized = calculateUnrealizedPeriod(item.currentSummary, previousSummary1);
3812
+ data.periodIncome = calculateIncomePeriod(item.currentSummary, previousSummary1);
3813
+
3759
3814
  if (snapshot.open.getIsZero()) {
3760
3815
  data.basisPrice = Decimal.ZERO;
3761
3816
  } else {
3762
3817
  data.basisPrice = basis.divide(snapshot.open);
3763
3818
  }
3819
+
3820
+ if (currentSummary && !currentSummary.end.open.getIsZero()) {
3821
+ data.periodPrice = currentSummary.end.value.divide(currentSummary.end.open);
3822
+ } else {
3823
+ data.periodPrice = null;
3824
+ }
3825
+
3826
+ if (previousSummary1 && !previousSummary1.end.open.getIsZero()) {
3827
+ data.periodPricePrevious = previousSummary1.end.value.divide(previousSummary1.end.open);
3828
+ } else {
3829
+ data.periodPricePrevious = null;
3830
+ }
3764
3831
  }
3765
3832
 
3766
3833
  function calculatePriceData(item, price) {
@@ -3897,6 +3964,48 @@ module.exports = (() => {
3897
3964
  return returnRef;
3898
3965
  }
3899
3966
 
3967
+ function calculateRealizedPeriod(currentSummary, previousSummary) {
3968
+ let returnRef;
3969
+
3970
+ if (currentSummary) {
3971
+ const period = currentSummary.period;
3972
+
3973
+ returnRef = period.realized;
3974
+ } else {
3975
+ returnRef = Decimal.ZERO;
3976
+ }
3977
+
3978
+ return returnRef;
3979
+ }
3980
+
3981
+ function calculateUnrealizedPeriod(currentSummary, previousSummary) {
3982
+ let returnRef;
3983
+
3984
+ if (currentSummary) {
3985
+ const period = currentSummary.period;
3986
+
3987
+ returnRef = period.unrealized.subtract(previousSummary !== null ? previousSummary.period.unrealized : Decimal.ZERO);
3988
+ } else {
3989
+ returnRef = Decimal.ZERO;
3990
+ }
3991
+
3992
+ return returnRef;
3993
+ }
3994
+
3995
+ function calculateIncomePeriod(currentSummary, previousSummary) {
3996
+ let returnRef;
3997
+
3998
+ if (currentSummary) {
3999
+ const period = currentSummary.period;
4000
+
4001
+ returnRef = period.income;
4002
+ } else {
4003
+ returnRef = Decimal.ZERO;
4004
+ }
4005
+
4006
+ return returnRef;
4007
+ }
4008
+
3900
4009
  function getPreviousSummary(previousSummaries, count) {
3901
4010
  const index = previousSummaries.length - count;
3902
4011
 
@@ -6186,11 +6295,12 @@ module.exports = function () {
6186
6295
  }
6187
6296
 
6188
6297
  /**
6189
- * Clones a {@link Day} instance.
6298
+ * Converts a string (which matches the output of {@link Day#format} into
6299
+ * a {@link Day} instance.
6190
6300
  *
6191
6301
  * @public
6192
6302
  * @static
6193
- * @param {Day} value
6303
+ * @param {String} value
6194
6304
  * @returns {Day}
6195
6305
  */
6196
6306
 
@@ -6231,24 +6341,6 @@ module.exports = function () {
6231
6341
  return this._day;
6232
6342
  }
6233
6343
  }], [{
6234
- key: 'clone',
6235
- value: function clone(value) {
6236
- assert.argumentIsRequired(value, 'value', Day, 'Day');
6237
-
6238
- return new Day(value.year, value.month, value.day);
6239
- }
6240
-
6241
- /**
6242
- * Converts a string (which matches the output of {@link Day#format} into
6243
- * a {@link Day} instance.
6244
- *
6245
- * @public
6246
- * @static
6247
- * @param {String} value
6248
- * @returns {Day}
6249
- */
6250
-
6251
- }, {
6252
6344
  key: 'parse',
6253
6345
  value: function parse(value) {
6254
6346
  assert.argumentIsRequired(value, 'value', String);
@@ -6565,17 +6657,15 @@ module.exports = function () {
6565
6657
  *
6566
6658
  * @public
6567
6659
  * @param {Boolean=} approximate
6568
- * @param {Number=} places
6569
6660
  * @returns {Boolean}
6570
6661
  */
6571
6662
 
6572
6663
  }, {
6573
6664
  key: 'getIsZero',
6574
- value: function getIsZero(approximate, places) {
6665
+ value: function getIsZero(approximate) {
6575
6666
  assert.argumentIsOptional(approximate, 'approximate', Boolean);
6576
- assert.argumentIsOptional(places, 'places', Number);
6577
6667
 
6578
- return this._big.eq(zero) || is.boolean(approximate) && approximate && this.round(places || Big.DP, RoundingMode.NORMAL).getIsZero();
6668
+ return this._big.eq(zero) || is.boolean(approximate) && approximate && this.round(20, RoundingMode.NORMAL).getIsZero();
6579
6669
  }
6580
6670
 
6581
6671
  /**
@@ -6674,43 +6764,6 @@ module.exports = function () {
6674
6764
  return this._big.eq(getBig(other));
6675
6765
  }
6676
6766
 
6677
- /**
6678
- * Returns true if the current instance is an integer (i.e. has no decimal
6679
- * component).
6680
- *
6681
- * @public
6682
- * @return {Boolean}
6683
- */
6684
-
6685
- }, {
6686
- key: 'getIsInteger',
6687
- value: function getIsInteger() {
6688
- return this.getIsEqual(this.round(0));
6689
- }
6690
-
6691
- /**
6692
- * Returns the number of decimal places used.
6693
- *
6694
- * @public
6695
- * @returns {Number}
6696
- */
6697
-
6698
- }, {
6699
- key: 'getDecimalPlaces',
6700
- value: function getDecimalPlaces() {
6701
- var matches = this.toFixed().match(/-?\d*\.(\d*)/);
6702
-
6703
- var returnVal = void 0;
6704
-
6705
- if (matches === null) {
6706
- returnVal = 0;
6707
- } else {
6708
- returnVal = matches[1].length;
6709
- }
6710
-
6711
- return returnVal;
6712
- }
6713
-
6714
6767
  /**
6715
6768
  * Emits a floating point value that approximates the value of the current
6716
6769
  * instance.
@@ -6759,11 +6812,10 @@ module.exports = function () {
6759
6812
  }
6760
6813
 
6761
6814
  /**
6762
- * Clones a {@link Decimal} instance.
6815
+ * Parses the value emitted by {@link Decimal#toJSON}.
6763
6816
  *
6764
6817
  * @public
6765
- * @static
6766
- * @param {Decimal} value
6818
+ * @param {String} value
6767
6819
  * @returns {Decimal}
6768
6820
  */
6769
6821
 
@@ -6773,22 +6825,6 @@ module.exports = function () {
6773
6825
  return '[Decimal]';
6774
6826
  }
6775
6827
  }], [{
6776
- key: 'clone',
6777
- value: function clone(value) {
6778
- assert.argumentIsRequired(value, 'value', Decimal, 'Decimal');
6779
-
6780
- return new Decimal(value._big);
6781
- }
6782
-
6783
- /**
6784
- * Parses the value emitted by {@link Decimal#toJSON}.
6785
- *
6786
- * @public
6787
- * @param {String} value
6788
- * @returns {Decimal}
6789
- */
6790
-
6791
- }, {
6792
6828
  key: 'parse',
6793
6829
  value: function parse(value) {
6794
6830
  return new Decimal(value);
@@ -7810,11 +7846,10 @@ module.exports = function () {
7810
7846
  }
7811
7847
 
7812
7848
  /**
7813
- * Clones a {@link Timestamp} instance.
7849
+ * Parses the value emitted by {@link Timestamp#toJSON}.
7814
7850
  *
7815
7851
  * @public
7816
- * @static
7817
- * @param {Timestamp} value
7852
+ * @param {Number} value
7818
7853
  * @returns {Timestamp}
7819
7854
  */
7820
7855
 
@@ -7850,22 +7885,6 @@ module.exports = function () {
7850
7885
  return this._moment;
7851
7886
  }
7852
7887
  }], [{
7853
- key: 'clone',
7854
- value: function clone(value) {
7855
- assert.argumentIsRequired(value, 'value', Timestamp, 'Timestamp');
7856
-
7857
- return new Timestamp(value._timestamp, value._timezone);
7858
- }
7859
-
7860
- /**
7861
- * Parses the value emitted by {@link Timestamp#toJSON}.
7862
- *
7863
- * @public
7864
- * @param {Number} value
7865
- * @returns {Timestamp}
7866
- */
7867
-
7868
- }, {
7869
7888
  key: 'parse',
7870
7889
  value: function parse(value) {
7871
7890
  return new Timestamp(value);