@barchart/portfolio-api-common 1.2.100 → 1.2.104
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.
|
@@ -166,6 +166,14 @@ module.exports = (() => {
|
|
|
166
166
|
this._dataFormat.cashTotal = null;
|
|
167
167
|
this._dataFormat.portfolioType = null;
|
|
168
168
|
|
|
169
|
+
this._dataActual.periodRealized = null;
|
|
170
|
+
this._dataActual.periodUnrealized = null;
|
|
171
|
+
this._dataActual.periodIncome = null;
|
|
172
|
+
|
|
173
|
+
this._dataFormat.periodRealized = null;
|
|
174
|
+
this._dataFormat.periodUnrealized = null;
|
|
175
|
+
this._dataFormat.periodIncome = null;
|
|
176
|
+
|
|
169
177
|
this._items.forEach((item) => {
|
|
170
178
|
bindItem.call(this, item);
|
|
171
179
|
});
|
|
@@ -662,6 +670,10 @@ module.exports = (() => {
|
|
|
662
670
|
updates.marketPrevious = updates.marketPrevious.add(translate(item, item.data.marketPrevious));
|
|
663
671
|
updates.marketPrevious2 = updates.marketPrevious2.add(translate(item, item.data.marketPrevious2));
|
|
664
672
|
|
|
673
|
+
updates.periodRealized = updates.periodRealized.add(translate(item, item.data.periodRealized));
|
|
674
|
+
updates.periodUnrealized = updates.periodUnrealized.add(translate(item, item.data.periodUnrealized));
|
|
675
|
+
updates.periodIncome = updates.periodIncome.add(translate(item, item.data.periodIncome));
|
|
676
|
+
|
|
665
677
|
if (item.position.instrument.type === InstrumentType.CASH) {
|
|
666
678
|
updates.cashTotal = updates.cashTotal.add(translate(item, item.data.market));
|
|
667
679
|
}
|
|
@@ -677,7 +689,10 @@ module.exports = (() => {
|
|
|
677
689
|
summaryTotalPrevious2: Decimal.ZERO,
|
|
678
690
|
marketPrevious: Decimal.ZERO,
|
|
679
691
|
marketPrevious2: Decimal.ZERO,
|
|
680
|
-
|
|
692
|
+
periodRealized: Decimal.ZERO,
|
|
693
|
+
periodUnrealized: Decimal.ZERO,
|
|
694
|
+
periodIncome: Decimal.ZERO,
|
|
695
|
+
cashTotal: Decimal.ZERO,
|
|
681
696
|
});
|
|
682
697
|
|
|
683
698
|
actual.basis = updates.basis;
|
|
@@ -689,6 +704,9 @@ module.exports = (() => {
|
|
|
689
704
|
actual.summaryTotalPrevious2 = updates.summaryTotalPrevious2;
|
|
690
705
|
actual.marketPrevious = updates.marketPrevious;
|
|
691
706
|
actual.marketPrevious2 = updates.marketPrevious2;
|
|
707
|
+
actual.periodRealized = updates.periodRealized;
|
|
708
|
+
actual.periodUnrealized = updates.periodUnrealized;
|
|
709
|
+
actual.periodIncome = updates.periodIncome;
|
|
692
710
|
actual.cashTotal = updates.cashTotal;
|
|
693
711
|
|
|
694
712
|
format.basis = formatCurrency(actual.basis, currency);
|
|
@@ -702,6 +720,9 @@ module.exports = (() => {
|
|
|
702
720
|
format.summaryTotalPrevious2Negative = updates.summaryTotalPrevious2.getIsNegative();
|
|
703
721
|
format.marketPrevious = formatCurrency(updates.marketPrevious, currency);
|
|
704
722
|
format.marketPrevious2 = formatCurrency(updates.marketPrevious2, currency);
|
|
723
|
+
format.periodRealized = formatCurrency(updates.periodRealized, currency);
|
|
724
|
+
format.periodUnrealized = formatCurrency(updates.periodUnrealized, currency);
|
|
725
|
+
format.periodIncome = formatCurrency(updates.periodIncome, currency);
|
|
705
726
|
format.cashTotal = formatCurrency(updates.cashTotal, currency);
|
|
706
727
|
|
|
707
728
|
calculateUnrealizedPercent(group);
|
|
@@ -78,6 +78,9 @@ module.exports = (() => {
|
|
|
78
78
|
this._data.income = null;
|
|
79
79
|
this._data.basisPrice = null;
|
|
80
80
|
|
|
81
|
+
this._data.realizedPeriod = null;
|
|
82
|
+
this._data.unrealizedPeriod = null;
|
|
83
|
+
|
|
81
84
|
this._data.newsExists = false;
|
|
82
85
|
this._data.fundamental = { };
|
|
83
86
|
this._data.locked = getIsLocked(position);
|
|
@@ -368,8 +371,13 @@ module.exports = (() => {
|
|
|
368
371
|
function calculateStaticData(item) {
|
|
369
372
|
const position = item.position;
|
|
370
373
|
const snapshot = getSnapshot(position, item.currentSummary, item._reporting);
|
|
374
|
+
|
|
371
375
|
const previousSummaries = item.previousSummaries;
|
|
372
376
|
|
|
377
|
+
const previousSummary1 = getPreviousSummary(previousSummaries, 1);
|
|
378
|
+
const previousSummary2 = getPreviousSummary(previousSummaries, 2);
|
|
379
|
+
const previousSummary3 = getPreviousSummary(previousSummaries, 3);
|
|
380
|
+
|
|
373
381
|
const data = item._data;
|
|
374
382
|
|
|
375
383
|
data.previousPrice = position.previous || null;
|
|
@@ -389,19 +397,18 @@ module.exports = (() => {
|
|
|
389
397
|
|
|
390
398
|
data.income = snapshot.income;
|
|
391
399
|
|
|
392
|
-
const previousSummary1 = getPreviousSummary(previousSummaries, 1);
|
|
393
|
-
const previousSummary2 = getPreviousSummary(previousSummaries, 2);
|
|
394
|
-
const previousSummary3 = getPreviousSummary(previousSummaries, 3);
|
|
395
|
-
|
|
396
400
|
data.summaryTotalCurrent = calculateSummaryTotal(item.currentSummary, previousSummary1);
|
|
397
401
|
data.summaryTotalPrevious = calculateSummaryTotal(previousSummary1, previousSummary2);
|
|
398
402
|
data.summaryTotalPrevious2 = calculateSummaryTotal(previousSummary2, previousSummary3);
|
|
399
403
|
|
|
400
404
|
data.marketPrevious = previousSummary1 === null ? Decimal.ZERO : previousSummary1.end.value;
|
|
401
405
|
data.marketPrevious2 = previousSummary2 === null ? Decimal.ZERO : previousSummary2.end.value;
|
|
402
|
-
|
|
403
406
|
data.quantityPrevious = previousSummary1 === null ? Decimal.ZERO : previousSummary1.end.open;
|
|
404
407
|
|
|
408
|
+
data.periodRealized = calculateRealizedPeriod(item.currentSummary, previousSummary1);
|
|
409
|
+
data.periodUnrealized = calculateUnrealizedPeriod(item.currentSummary, previousSummary1);
|
|
410
|
+
data.periodIncome = calculateIncomePeriod(item.currentSummary, previousSummary1);
|
|
411
|
+
|
|
405
412
|
if (snapshot.open.getIsZero()) {
|
|
406
413
|
data.basisPrice = Decimal.ZERO;
|
|
407
414
|
} else {
|
|
@@ -543,6 +550,48 @@ module.exports = (() => {
|
|
|
543
550
|
return returnRef;
|
|
544
551
|
}
|
|
545
552
|
|
|
553
|
+
function calculateRealizedPeriod(currentSummary, previousSummary) {
|
|
554
|
+
let returnRef;
|
|
555
|
+
|
|
556
|
+
if (currentSummary) {
|
|
557
|
+
const period = currentSummary.period;
|
|
558
|
+
|
|
559
|
+
returnRef = period.unrealized;
|
|
560
|
+
} else {
|
|
561
|
+
returnRef = Decimal.ZERO;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
return returnRef;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
function calculateUnrealizedPeriod(currentSummary, previousSummary) {
|
|
568
|
+
let returnRef;
|
|
569
|
+
|
|
570
|
+
if (currentSummary) {
|
|
571
|
+
const period = currentSummary.period;
|
|
572
|
+
|
|
573
|
+
returnRef = period.unrealized.subtract(previousSummary !== null ? previousSummary.period.unrealized : Decimal.ZERO);
|
|
574
|
+
} else {
|
|
575
|
+
returnRef = Decimal.ZERO;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
return returnRef;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
function calculateIncomePeriod(currentSummary, previousSummary) {
|
|
582
|
+
let returnRef;
|
|
583
|
+
|
|
584
|
+
if (currentSummary) {
|
|
585
|
+
const period = currentSummary.period;
|
|
586
|
+
|
|
587
|
+
returnRef = period.income;
|
|
588
|
+
} else {
|
|
589
|
+
returnRef = Decimal.ZERO;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
return returnRef;
|
|
593
|
+
}
|
|
594
|
+
|
|
546
595
|
function getPreviousSummary(previousSummaries, count) {
|
|
547
596
|
const index = previousSummaries.length - count;
|
|
548
597
|
|
package/package.json
CHANGED
package/test/SpecRunner.js
CHANGED
|
@@ -677,7 +677,7 @@ module.exports = (() => {
|
|
|
677
677
|
}
|
|
678
678
|
|
|
679
679
|
function getYearlyRangeDescription(start, end) {
|
|
680
|
-
return `Year ended ${end.
|
|
680
|
+
return `Year ended ${end.format()}`;
|
|
681
681
|
}
|
|
682
682
|
|
|
683
683
|
function getQuarterlyRangeDescription(start, end) {
|
|
@@ -2610,6 +2610,14 @@ module.exports = (() => {
|
|
|
2610
2610
|
this._dataFormat.cashTotal = null;
|
|
2611
2611
|
this._dataFormat.portfolioType = null;
|
|
2612
2612
|
|
|
2613
|
+
this._dataActual.periodRealized = null;
|
|
2614
|
+
this._dataActual.periodUnrealized = null;
|
|
2615
|
+
this._dataActual.periodIncome = null;
|
|
2616
|
+
|
|
2617
|
+
this._dataFormat.periodRealized = null;
|
|
2618
|
+
this._dataFormat.periodUnrealized = null;
|
|
2619
|
+
this._dataFormat.periodIncome = null;
|
|
2620
|
+
|
|
2613
2621
|
this._items.forEach((item) => {
|
|
2614
2622
|
bindItem.call(this, item);
|
|
2615
2623
|
});
|
|
@@ -3106,6 +3114,10 @@ module.exports = (() => {
|
|
|
3106
3114
|
updates.marketPrevious = updates.marketPrevious.add(translate(item, item.data.marketPrevious));
|
|
3107
3115
|
updates.marketPrevious2 = updates.marketPrevious2.add(translate(item, item.data.marketPrevious2));
|
|
3108
3116
|
|
|
3117
|
+
updates.periodRealized = updates.periodRealized.add(translate(item, item.data.periodRealized));
|
|
3118
|
+
updates.periodUnrealized = updates.periodUnrealized.add(translate(item, item.data.periodUnrealized));
|
|
3119
|
+
updates.periodIncome = updates.periodIncome.add(translate(item, item.data.periodIncome));
|
|
3120
|
+
|
|
3109
3121
|
if (item.position.instrument.type === InstrumentType.CASH) {
|
|
3110
3122
|
updates.cashTotal = updates.cashTotal.add(translate(item, item.data.market));
|
|
3111
3123
|
}
|
|
@@ -3121,7 +3133,10 @@ module.exports = (() => {
|
|
|
3121
3133
|
summaryTotalPrevious2: Decimal.ZERO,
|
|
3122
3134
|
marketPrevious: Decimal.ZERO,
|
|
3123
3135
|
marketPrevious2: Decimal.ZERO,
|
|
3124
|
-
|
|
3136
|
+
periodRealized: Decimal.ZERO,
|
|
3137
|
+
periodUnrealized: Decimal.ZERO,
|
|
3138
|
+
periodIncome: Decimal.ZERO,
|
|
3139
|
+
cashTotal: Decimal.ZERO,
|
|
3125
3140
|
});
|
|
3126
3141
|
|
|
3127
3142
|
actual.basis = updates.basis;
|
|
@@ -3133,6 +3148,9 @@ module.exports = (() => {
|
|
|
3133
3148
|
actual.summaryTotalPrevious2 = updates.summaryTotalPrevious2;
|
|
3134
3149
|
actual.marketPrevious = updates.marketPrevious;
|
|
3135
3150
|
actual.marketPrevious2 = updates.marketPrevious2;
|
|
3151
|
+
actual.periodRealized = updates.periodRealized;
|
|
3152
|
+
actual.periodUnrealized = updates.periodUnrealized;
|
|
3153
|
+
actual.periodIncome = updates.periodIncome;
|
|
3136
3154
|
actual.cashTotal = updates.cashTotal;
|
|
3137
3155
|
|
|
3138
3156
|
format.basis = formatCurrency(actual.basis, currency);
|
|
@@ -3146,6 +3164,9 @@ module.exports = (() => {
|
|
|
3146
3164
|
format.summaryTotalPrevious2Negative = updates.summaryTotalPrevious2.getIsNegative();
|
|
3147
3165
|
format.marketPrevious = formatCurrency(updates.marketPrevious, currency);
|
|
3148
3166
|
format.marketPrevious2 = formatCurrency(updates.marketPrevious2, currency);
|
|
3167
|
+
format.periodRealized = formatCurrency(updates.periodRealized, currency);
|
|
3168
|
+
format.periodUnrealized = formatCurrency(updates.periodUnrealized, currency);
|
|
3169
|
+
format.periodIncome = formatCurrency(updates.periodIncome, currency);
|
|
3149
3170
|
format.cashTotal = formatCurrency(updates.cashTotal, currency);
|
|
3150
3171
|
|
|
3151
3172
|
calculateUnrealizedPercent(group);
|
|
@@ -3432,6 +3453,9 @@ module.exports = (() => {
|
|
|
3432
3453
|
this._data.income = null;
|
|
3433
3454
|
this._data.basisPrice = null;
|
|
3434
3455
|
|
|
3456
|
+
this._data.realizedPeriod = null;
|
|
3457
|
+
this._data.unrealizedPeriod = null;
|
|
3458
|
+
|
|
3435
3459
|
this._data.newsExists = false;
|
|
3436
3460
|
this._data.fundamental = { };
|
|
3437
3461
|
this._data.locked = getIsLocked(position);
|
|
@@ -3722,8 +3746,13 @@ module.exports = (() => {
|
|
|
3722
3746
|
function calculateStaticData(item) {
|
|
3723
3747
|
const position = item.position;
|
|
3724
3748
|
const snapshot = getSnapshot(position, item.currentSummary, item._reporting);
|
|
3749
|
+
|
|
3725
3750
|
const previousSummaries = item.previousSummaries;
|
|
3726
3751
|
|
|
3752
|
+
const previousSummary1 = getPreviousSummary(previousSummaries, 1);
|
|
3753
|
+
const previousSummary2 = getPreviousSummary(previousSummaries, 2);
|
|
3754
|
+
const previousSummary3 = getPreviousSummary(previousSummaries, 3);
|
|
3755
|
+
|
|
3727
3756
|
const data = item._data;
|
|
3728
3757
|
|
|
3729
3758
|
data.previousPrice = position.previous || null;
|
|
@@ -3743,19 +3772,18 @@ module.exports = (() => {
|
|
|
3743
3772
|
|
|
3744
3773
|
data.income = snapshot.income;
|
|
3745
3774
|
|
|
3746
|
-
const previousSummary1 = getPreviousSummary(previousSummaries, 1);
|
|
3747
|
-
const previousSummary2 = getPreviousSummary(previousSummaries, 2);
|
|
3748
|
-
const previousSummary3 = getPreviousSummary(previousSummaries, 3);
|
|
3749
|
-
|
|
3750
3775
|
data.summaryTotalCurrent = calculateSummaryTotal(item.currentSummary, previousSummary1);
|
|
3751
3776
|
data.summaryTotalPrevious = calculateSummaryTotal(previousSummary1, previousSummary2);
|
|
3752
3777
|
data.summaryTotalPrevious2 = calculateSummaryTotal(previousSummary2, previousSummary3);
|
|
3753
3778
|
|
|
3754
3779
|
data.marketPrevious = previousSummary1 === null ? Decimal.ZERO : previousSummary1.end.value;
|
|
3755
3780
|
data.marketPrevious2 = previousSummary2 === null ? Decimal.ZERO : previousSummary2.end.value;
|
|
3756
|
-
|
|
3757
3781
|
data.quantityPrevious = previousSummary1 === null ? Decimal.ZERO : previousSummary1.end.open;
|
|
3758
3782
|
|
|
3783
|
+
data.periodRealized = calculateRealizedPeriod(item.currentSummary, previousSummary1);
|
|
3784
|
+
data.periodUnrealized = calculateUnrealizedPeriod(item.currentSummary, previousSummary1);
|
|
3785
|
+
data.periodIncome = calculateIncomePeriod(item.currentSummary, previousSummary1);
|
|
3786
|
+
|
|
3759
3787
|
if (snapshot.open.getIsZero()) {
|
|
3760
3788
|
data.basisPrice = Decimal.ZERO;
|
|
3761
3789
|
} else {
|
|
@@ -3897,6 +3925,48 @@ module.exports = (() => {
|
|
|
3897
3925
|
return returnRef;
|
|
3898
3926
|
}
|
|
3899
3927
|
|
|
3928
|
+
function calculateRealizedPeriod(currentSummary, previousSummary) {
|
|
3929
|
+
let returnRef;
|
|
3930
|
+
|
|
3931
|
+
if (currentSummary) {
|
|
3932
|
+
const period = currentSummary.period;
|
|
3933
|
+
|
|
3934
|
+
returnRef = period.unrealized;
|
|
3935
|
+
} else {
|
|
3936
|
+
returnRef = Decimal.ZERO;
|
|
3937
|
+
}
|
|
3938
|
+
|
|
3939
|
+
return returnRef;
|
|
3940
|
+
}
|
|
3941
|
+
|
|
3942
|
+
function calculateUnrealizedPeriod(currentSummary, previousSummary) {
|
|
3943
|
+
let returnRef;
|
|
3944
|
+
|
|
3945
|
+
if (currentSummary) {
|
|
3946
|
+
const period = currentSummary.period;
|
|
3947
|
+
|
|
3948
|
+
returnRef = period.unrealized.subtract(previousSummary !== null ? previousSummary.period.unrealized : Decimal.ZERO);
|
|
3949
|
+
} else {
|
|
3950
|
+
returnRef = Decimal.ZERO;
|
|
3951
|
+
}
|
|
3952
|
+
|
|
3953
|
+
return returnRef;
|
|
3954
|
+
}
|
|
3955
|
+
|
|
3956
|
+
function calculateIncomePeriod(currentSummary, previousSummary) {
|
|
3957
|
+
let returnRef;
|
|
3958
|
+
|
|
3959
|
+
if (currentSummary) {
|
|
3960
|
+
const period = currentSummary.period;
|
|
3961
|
+
|
|
3962
|
+
returnRef = period.income;
|
|
3963
|
+
} else {
|
|
3964
|
+
returnRef = Decimal.ZERO;
|
|
3965
|
+
}
|
|
3966
|
+
|
|
3967
|
+
return returnRef;
|
|
3968
|
+
}
|
|
3969
|
+
|
|
3900
3970
|
function getPreviousSummary(previousSummaries, count) {
|
|
3901
3971
|
const index = previousSummaries.length - count;
|
|
3902
3972
|
|
|
@@ -6186,11 +6256,12 @@ module.exports = function () {
|
|
|
6186
6256
|
}
|
|
6187
6257
|
|
|
6188
6258
|
/**
|
|
6189
|
-
*
|
|
6259
|
+
* Converts a string (which matches the output of {@link Day#format} into
|
|
6260
|
+
* a {@link Day} instance.
|
|
6190
6261
|
*
|
|
6191
6262
|
* @public
|
|
6192
6263
|
* @static
|
|
6193
|
-
* @param {
|
|
6264
|
+
* @param {String} value
|
|
6194
6265
|
* @returns {Day}
|
|
6195
6266
|
*/
|
|
6196
6267
|
|
|
@@ -6231,24 +6302,6 @@ module.exports = function () {
|
|
|
6231
6302
|
return this._day;
|
|
6232
6303
|
}
|
|
6233
6304
|
}], [{
|
|
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
6305
|
key: 'parse',
|
|
6253
6306
|
value: function parse(value) {
|
|
6254
6307
|
assert.argumentIsRequired(value, 'value', String);
|
|
@@ -6565,17 +6618,15 @@ module.exports = function () {
|
|
|
6565
6618
|
*
|
|
6566
6619
|
* @public
|
|
6567
6620
|
* @param {Boolean=} approximate
|
|
6568
|
-
* @param {Number=} places
|
|
6569
6621
|
* @returns {Boolean}
|
|
6570
6622
|
*/
|
|
6571
6623
|
|
|
6572
6624
|
}, {
|
|
6573
6625
|
key: 'getIsZero',
|
|
6574
|
-
value: function getIsZero(approximate
|
|
6626
|
+
value: function getIsZero(approximate) {
|
|
6575
6627
|
assert.argumentIsOptional(approximate, 'approximate', Boolean);
|
|
6576
|
-
assert.argumentIsOptional(places, 'places', Number);
|
|
6577
6628
|
|
|
6578
|
-
return this._big.eq(zero) || is.boolean(approximate) && approximate && this.round(
|
|
6629
|
+
return this._big.eq(zero) || is.boolean(approximate) && approximate && this.round(20, RoundingMode.NORMAL).getIsZero();
|
|
6579
6630
|
}
|
|
6580
6631
|
|
|
6581
6632
|
/**
|
|
@@ -6674,43 +6725,6 @@ module.exports = function () {
|
|
|
6674
6725
|
return this._big.eq(getBig(other));
|
|
6675
6726
|
}
|
|
6676
6727
|
|
|
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
6728
|
/**
|
|
6715
6729
|
* Emits a floating point value that approximates the value of the current
|
|
6716
6730
|
* instance.
|
|
@@ -6759,11 +6773,10 @@ module.exports = function () {
|
|
|
6759
6773
|
}
|
|
6760
6774
|
|
|
6761
6775
|
/**
|
|
6762
|
-
*
|
|
6776
|
+
* Parses the value emitted by {@link Decimal#toJSON}.
|
|
6763
6777
|
*
|
|
6764
6778
|
* @public
|
|
6765
|
-
* @
|
|
6766
|
-
* @param {Decimal} value
|
|
6779
|
+
* @param {String} value
|
|
6767
6780
|
* @returns {Decimal}
|
|
6768
6781
|
*/
|
|
6769
6782
|
|
|
@@ -6773,22 +6786,6 @@ module.exports = function () {
|
|
|
6773
6786
|
return '[Decimal]';
|
|
6774
6787
|
}
|
|
6775
6788
|
}], [{
|
|
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
6789
|
key: 'parse',
|
|
6793
6790
|
value: function parse(value) {
|
|
6794
6791
|
return new Decimal(value);
|
|
@@ -7810,11 +7807,10 @@ module.exports = function () {
|
|
|
7810
7807
|
}
|
|
7811
7808
|
|
|
7812
7809
|
/**
|
|
7813
|
-
*
|
|
7810
|
+
* Parses the value emitted by {@link Timestamp#toJSON}.
|
|
7814
7811
|
*
|
|
7815
7812
|
* @public
|
|
7816
|
-
* @
|
|
7817
|
-
* @param {Timestamp} value
|
|
7813
|
+
* @param {Number} value
|
|
7818
7814
|
* @returns {Timestamp}
|
|
7819
7815
|
*/
|
|
7820
7816
|
|
|
@@ -7850,22 +7846,6 @@ module.exports = function () {
|
|
|
7850
7846
|
return this._moment;
|
|
7851
7847
|
}
|
|
7852
7848
|
}], [{
|
|
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
7849
|
key: 'parse',
|
|
7870
7850
|
value: function parse(value) {
|
|
7871
7851
|
return new Timestamp(value);
|