@fileverse-dev/formulajs 4.4.11-mod-3 → 4.4.11-mod-5
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.
- package/lib/browser/formula.js +102 -82
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +93 -73
- package/lib/esm/crypto-constants.mjs +40 -0
- package/lib/esm/index.mjs +2 -2
- package/package.json +5 -2
package/lib/cjs/index.cjs
CHANGED
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
require('jstat');
|
|
3
|
+
var jStat = require('jstat');
|
|
4
4
|
var bessel = require('bessel');
|
|
5
5
|
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var jStat__namespace = /*#__PURE__*/_interopNamespaceDefault(jStat);
|
|
24
|
+
var bessel__namespace = /*#__PURE__*/_interopNamespaceDefault(bessel);
|
|
25
|
+
|
|
6
26
|
const nil = new Error('#NULL!');
|
|
7
27
|
const div0 = new Error('#DIV/0!');
|
|
8
28
|
const value = new Error('#VALUE!');
|
|
@@ -1044,7 +1064,7 @@ function COLUMN(reference, index) {
|
|
|
1044
1064
|
return undefined
|
|
1045
1065
|
}
|
|
1046
1066
|
|
|
1047
|
-
return
|
|
1067
|
+
return jStat__namespace.col(reference, index)
|
|
1048
1068
|
}
|
|
1049
1069
|
|
|
1050
1070
|
/**
|
|
@@ -1068,7 +1088,7 @@ function COLUMNS(array) {
|
|
|
1068
1088
|
return 0
|
|
1069
1089
|
}
|
|
1070
1090
|
|
|
1071
|
-
return
|
|
1091
|
+
return jStat__namespace.cols(array)
|
|
1072
1092
|
}
|
|
1073
1093
|
|
|
1074
1094
|
/**
|
|
@@ -1274,7 +1294,7 @@ function ROWS(array) {
|
|
|
1274
1294
|
return 0
|
|
1275
1295
|
}
|
|
1276
1296
|
|
|
1277
|
-
return
|
|
1297
|
+
return jStat__namespace.rows(array)
|
|
1278
1298
|
}
|
|
1279
1299
|
/**
|
|
1280
1300
|
* Returns a sorted array of the elements in an array. The returned array is the same shape as the provided array argument.
|
|
@@ -2231,7 +2251,7 @@ function AVEDEV() {
|
|
|
2231
2251
|
return range
|
|
2232
2252
|
}
|
|
2233
2253
|
|
|
2234
|
-
return
|
|
2254
|
+
return jStat__namespace.sum(jStat__namespace(range).subtract(jStat__namespace.mean(range)).abs()[0]) / range.length
|
|
2235
2255
|
}
|
|
2236
2256
|
|
|
2237
2257
|
/**
|
|
@@ -2436,7 +2456,7 @@ BETA.DIST = function (x, alpha, beta, cumulative, a, b) {
|
|
|
2436
2456
|
|
|
2437
2457
|
x = (x - a) / (b - a);
|
|
2438
2458
|
|
|
2439
|
-
return cumulative ?
|
|
2459
|
+
return cumulative ? jStat__namespace.beta.cdf(x, alpha, beta) : jStat__namespace.beta.pdf(x, alpha, beta)
|
|
2440
2460
|
};
|
|
2441
2461
|
|
|
2442
2462
|
/**
|
|
@@ -2464,7 +2484,7 @@ BETA.INV = (probability, alpha, beta, a, b) => {
|
|
|
2464
2484
|
return value
|
|
2465
2485
|
}
|
|
2466
2486
|
|
|
2467
|
-
return
|
|
2487
|
+
return jStat__namespace.beta.inv(probability, alpha, beta) * (b - a) + a
|
|
2468
2488
|
};
|
|
2469
2489
|
|
|
2470
2490
|
const BINOM = {};
|
|
@@ -2491,8 +2511,8 @@ BINOM.DIST = (number_s, trials, probability_s, cumulative) => {
|
|
|
2491
2511
|
}
|
|
2492
2512
|
|
|
2493
2513
|
return cumulative
|
|
2494
|
-
?
|
|
2495
|
-
:
|
|
2514
|
+
? jStat__namespace.binomial.cdf(number_s, trials, probability_s)
|
|
2515
|
+
: jStat__namespace.binomial.pdf(number_s, trials, probability_s)
|
|
2496
2516
|
};
|
|
2497
2517
|
|
|
2498
2518
|
/**
|
|
@@ -2549,7 +2569,7 @@ BINOM.INV = (trials, probability_s, alpha) => {
|
|
|
2549
2569
|
let x = 0;
|
|
2550
2570
|
|
|
2551
2571
|
while (x <= trials) {
|
|
2552
|
-
if (
|
|
2572
|
+
if (jStat__namespace.binomial.cdf(x, trials, probability_s) >= alpha) {
|
|
2553
2573
|
return x
|
|
2554
2574
|
}
|
|
2555
2575
|
|
|
@@ -2577,7 +2597,7 @@ CHISQ.DIST = (x, deg_freedom, cumulative) => {
|
|
|
2577
2597
|
return value
|
|
2578
2598
|
}
|
|
2579
2599
|
|
|
2580
|
-
return cumulative ?
|
|
2600
|
+
return cumulative ? jStat__namespace.chisquare.cdf(x, deg_freedom) : jStat__namespace.chisquare.pdf(x, deg_freedom)
|
|
2581
2601
|
};
|
|
2582
2602
|
|
|
2583
2603
|
/**
|
|
@@ -2602,7 +2622,7 @@ CHISQ.DIST.RT = (x, deg_freedom) => {
|
|
|
2602
2622
|
return value
|
|
2603
2623
|
}
|
|
2604
2624
|
|
|
2605
|
-
return 1 -
|
|
2625
|
+
return 1 - jStat__namespace.chisquare.cdf(x, deg_freedom)
|
|
2606
2626
|
};
|
|
2607
2627
|
|
|
2608
2628
|
/**
|
|
@@ -2622,7 +2642,7 @@ CHISQ.INV = (probability, deg_freedom) => {
|
|
|
2622
2642
|
return value
|
|
2623
2643
|
}
|
|
2624
2644
|
|
|
2625
|
-
return
|
|
2645
|
+
return jStat__namespace.chisquare.inv(probability, deg_freedom)
|
|
2626
2646
|
};
|
|
2627
2647
|
|
|
2628
2648
|
/**
|
|
@@ -2647,7 +2667,7 @@ CHISQ.INV.RT = (probability, deg_freedom) => {
|
|
|
2647
2667
|
return value
|
|
2648
2668
|
}
|
|
2649
2669
|
|
|
2650
|
-
return
|
|
2670
|
+
return jStat__namespace.chisquare.inv(1.0 - probability, deg_freedom)
|
|
2651
2671
|
};
|
|
2652
2672
|
|
|
2653
2673
|
/**
|
|
@@ -2762,7 +2782,7 @@ CONFIDENCE.NORM = (alpha, standard_dev, size) => {
|
|
|
2762
2782
|
return value
|
|
2763
2783
|
}
|
|
2764
2784
|
|
|
2765
|
-
return
|
|
2785
|
+
return jStat__namespace.normalci(1, alpha, standard_dev, size)[1] - 1
|
|
2766
2786
|
};
|
|
2767
2787
|
|
|
2768
2788
|
/**
|
|
@@ -2784,7 +2804,7 @@ CONFIDENCE.T = (alpha, standard_dev, size) => {
|
|
|
2784
2804
|
return value
|
|
2785
2805
|
}
|
|
2786
2806
|
|
|
2787
|
-
return
|
|
2807
|
+
return jStat__namespace.tci(1, alpha, standard_dev, size)[1] - 1
|
|
2788
2808
|
};
|
|
2789
2809
|
|
|
2790
2810
|
/**
|
|
@@ -2804,7 +2824,7 @@ function CORREL(array1, array2) {
|
|
|
2804
2824
|
return value
|
|
2805
2825
|
}
|
|
2806
2826
|
|
|
2807
|
-
return
|
|
2827
|
+
return jStat__namespace.corrcoeff(array1, array2)
|
|
2808
2828
|
}
|
|
2809
2829
|
|
|
2810
2830
|
/**
|
|
@@ -2955,8 +2975,8 @@ COVARIANCE.P = (array1, array2) => {
|
|
|
2955
2975
|
return value
|
|
2956
2976
|
}
|
|
2957
2977
|
|
|
2958
|
-
const mean1 =
|
|
2959
|
-
const mean2 =
|
|
2978
|
+
const mean1 = jStat__namespace.mean(array1);
|
|
2979
|
+
const mean2 = jStat__namespace.mean(array2);
|
|
2960
2980
|
|
|
2961
2981
|
let result = 0;
|
|
2962
2982
|
|
|
@@ -2986,7 +3006,7 @@ COVARIANCE.S = (array1, array2) => {
|
|
|
2986
3006
|
return value
|
|
2987
3007
|
}
|
|
2988
3008
|
|
|
2989
|
-
return
|
|
3009
|
+
return jStat__namespace.covariance(array1, array2)
|
|
2990
3010
|
};
|
|
2991
3011
|
|
|
2992
3012
|
/**
|
|
@@ -3004,7 +3024,7 @@ function DEVSQ() {
|
|
|
3004
3024
|
return range
|
|
3005
3025
|
}
|
|
3006
3026
|
|
|
3007
|
-
const mean =
|
|
3027
|
+
const mean = jStat__namespace.mean(range);
|
|
3008
3028
|
|
|
3009
3029
|
let result = 0;
|
|
3010
3030
|
|
|
@@ -3035,7 +3055,7 @@ EXPON.DIST = (x, lambda, cumulative) => {
|
|
|
3035
3055
|
return value
|
|
3036
3056
|
}
|
|
3037
3057
|
|
|
3038
|
-
return cumulative ?
|
|
3058
|
+
return cumulative ? jStat__namespace.exponential.cdf(x, lambda) : jStat__namespace.exponential.pdf(x, lambda)
|
|
3039
3059
|
};
|
|
3040
3060
|
|
|
3041
3061
|
const F = {};
|
|
@@ -3061,8 +3081,8 @@ F.DIST = (x, deg_freedom1, deg_freedom2, cumulative) => {
|
|
|
3061
3081
|
}
|
|
3062
3082
|
|
|
3063
3083
|
return cumulative
|
|
3064
|
-
?
|
|
3065
|
-
:
|
|
3084
|
+
? jStat__namespace.centralF.cdf(x, deg_freedom1, deg_freedom2)
|
|
3085
|
+
: jStat__namespace.centralF.pdf(x, deg_freedom1, deg_freedom2)
|
|
3066
3086
|
};
|
|
3067
3087
|
|
|
3068
3088
|
/**
|
|
@@ -3088,7 +3108,7 @@ F.DIST.RT = function (x, deg_freedom1, deg_freedom2) {
|
|
|
3088
3108
|
return value
|
|
3089
3109
|
}
|
|
3090
3110
|
|
|
3091
|
-
return 1 -
|
|
3111
|
+
return 1 - jStat__namespace.centralF.cdf(x, deg_freedom1, deg_freedom2)
|
|
3092
3112
|
};
|
|
3093
3113
|
|
|
3094
3114
|
/**
|
|
@@ -3114,7 +3134,7 @@ F.INV = (probability, deg_freedom1, deg_freedom2) => {
|
|
|
3114
3134
|
return num
|
|
3115
3135
|
}
|
|
3116
3136
|
|
|
3117
|
-
return
|
|
3137
|
+
return jStat__namespace.centralF.inv(probability, deg_freedom1, deg_freedom2)
|
|
3118
3138
|
};
|
|
3119
3139
|
|
|
3120
3140
|
/**
|
|
@@ -3147,7 +3167,7 @@ F.INV.RT = function (probability, deg_freedom1, deg_freedom2) {
|
|
|
3147
3167
|
return value
|
|
3148
3168
|
}
|
|
3149
3169
|
|
|
3150
|
-
return
|
|
3170
|
+
return jStat__namespace.centralF.inv(1.0 - probability, deg_freedom1, deg_freedom2)
|
|
3151
3171
|
};
|
|
3152
3172
|
|
|
3153
3173
|
/**
|
|
@@ -3247,8 +3267,8 @@ function FORECAST(x, known_ys, known_xs) {
|
|
|
3247
3267
|
return value
|
|
3248
3268
|
}
|
|
3249
3269
|
|
|
3250
|
-
const xmean =
|
|
3251
|
-
const ymean =
|
|
3270
|
+
const xmean = jStat__namespace.mean(known_xs);
|
|
3271
|
+
const ymean = jStat__namespace.mean(known_ys);
|
|
3252
3272
|
|
|
3253
3273
|
const n = known_xs.length;
|
|
3254
3274
|
|
|
@@ -3333,7 +3353,7 @@ function GAMMA(number) {
|
|
|
3333
3353
|
return num
|
|
3334
3354
|
}
|
|
3335
3355
|
|
|
3336
|
-
return
|
|
3356
|
+
return jStat__namespace.gammafn(number)
|
|
3337
3357
|
}
|
|
3338
3358
|
|
|
3339
3359
|
/**
|
|
@@ -3360,7 +3380,7 @@ GAMMA.DIST = function (value$1, alpha, beta, cumulative) {
|
|
|
3360
3380
|
return value
|
|
3361
3381
|
}
|
|
3362
3382
|
|
|
3363
|
-
return cumulative ?
|
|
3383
|
+
return cumulative ? jStat__namespace.gamma.cdf(value$1, alpha, beta, true) : jStat__namespace.gamma.pdf(value$1, alpha, beta, false)
|
|
3364
3384
|
};
|
|
3365
3385
|
|
|
3366
3386
|
/**
|
|
@@ -3386,7 +3406,7 @@ GAMMA.INV = function (probability, alpha, beta) {
|
|
|
3386
3406
|
return value
|
|
3387
3407
|
}
|
|
3388
3408
|
|
|
3389
|
-
return
|
|
3409
|
+
return jStat__namespace.gamma.inv(probability, alpha, beta)
|
|
3390
3410
|
};
|
|
3391
3411
|
|
|
3392
3412
|
/**
|
|
@@ -3404,7 +3424,7 @@ function GAMMALN(x) {
|
|
|
3404
3424
|
return x
|
|
3405
3425
|
}
|
|
3406
3426
|
|
|
3407
|
-
return
|
|
3427
|
+
return jStat__namespace.gammaln(x)
|
|
3408
3428
|
}
|
|
3409
3429
|
|
|
3410
3430
|
/**
|
|
@@ -3428,7 +3448,7 @@ GAMMALN.PRECISE = function (x) {
|
|
|
3428
3448
|
return value
|
|
3429
3449
|
}
|
|
3430
3450
|
|
|
3431
|
-
return
|
|
3451
|
+
return jStat__namespace.gammaln(x)
|
|
3432
3452
|
};
|
|
3433
3453
|
|
|
3434
3454
|
/**
|
|
@@ -3446,7 +3466,7 @@ function GAUSS(z) {
|
|
|
3446
3466
|
return z
|
|
3447
3467
|
}
|
|
3448
3468
|
|
|
3449
|
-
return
|
|
3469
|
+
return jStat__namespace.normal.cdf(z, 0, 1) - 0.5
|
|
3450
3470
|
}
|
|
3451
3471
|
|
|
3452
3472
|
/**
|
|
@@ -3464,7 +3484,7 @@ function GEOMEAN() {
|
|
|
3464
3484
|
return args
|
|
3465
3485
|
}
|
|
3466
3486
|
|
|
3467
|
-
return
|
|
3487
|
+
return jStat__namespace.geomean(args)
|
|
3468
3488
|
}
|
|
3469
3489
|
|
|
3470
3490
|
/**
|
|
@@ -3675,7 +3695,7 @@ function KURT() {
|
|
|
3675
3695
|
return range
|
|
3676
3696
|
}
|
|
3677
3697
|
|
|
3678
|
-
const mean =
|
|
3698
|
+
const mean = jStat__namespace.mean(range);
|
|
3679
3699
|
const n = range.length;
|
|
3680
3700
|
|
|
3681
3701
|
let sigma = 0;
|
|
@@ -3684,7 +3704,7 @@ function KURT() {
|
|
|
3684
3704
|
sigma += Math.pow(range[i] - mean, 4);
|
|
3685
3705
|
}
|
|
3686
3706
|
|
|
3687
|
-
sigma = sigma / Math.pow(
|
|
3707
|
+
sigma = sigma / Math.pow(jStat__namespace.stdev(range, true), 4);
|
|
3688
3708
|
|
|
3689
3709
|
return ((n * (n + 1)) / ((n - 1) * (n - 2) * (n - 3))) * sigma - (3 * (n - 1) * (n - 1)) / ((n - 2) * (n - 3))
|
|
3690
3710
|
}
|
|
@@ -3740,8 +3760,8 @@ function LINEST(known_y, known_x) {
|
|
|
3740
3760
|
return value
|
|
3741
3761
|
}
|
|
3742
3762
|
|
|
3743
|
-
const ymean =
|
|
3744
|
-
const xmean =
|
|
3763
|
+
const ymean = jStat__namespace.mean(known_y);
|
|
3764
|
+
const xmean = jStat__namespace.mean(known_x);
|
|
3745
3765
|
const n = known_x.length;
|
|
3746
3766
|
|
|
3747
3767
|
let num = 0;
|
|
@@ -3821,7 +3841,7 @@ LOGNORM.DIST = (x, mean, standard_dev, cumulative) => {
|
|
|
3821
3841
|
return value
|
|
3822
3842
|
}
|
|
3823
3843
|
|
|
3824
|
-
return cumulative ?
|
|
3844
|
+
return cumulative ? jStat__namespace.lognormal.cdf(x, mean, standard_dev) : jStat__namespace.lognormal.pdf(x, mean, standard_dev)
|
|
3825
3845
|
};
|
|
3826
3846
|
|
|
3827
3847
|
/**
|
|
@@ -3843,7 +3863,7 @@ LOGNORM.INV = (probability, mean, standard_dev) => {
|
|
|
3843
3863
|
return value
|
|
3844
3864
|
}
|
|
3845
3865
|
|
|
3846
|
-
return
|
|
3866
|
+
return jStat__namespace.lognormal.inv(probability, mean, standard_dev)
|
|
3847
3867
|
};
|
|
3848
3868
|
|
|
3849
3869
|
/**
|
|
@@ -3921,7 +3941,7 @@ function MEDIAN() {
|
|
|
3921
3941
|
|
|
3922
3942
|
const range = arrayValuesToNumbers(flatArguments);
|
|
3923
3943
|
|
|
3924
|
-
let result =
|
|
3944
|
+
let result = jStat__namespace.median(range);
|
|
3925
3945
|
|
|
3926
3946
|
if (isNaN(result)) {
|
|
3927
3947
|
result = num;
|
|
@@ -4070,8 +4090,8 @@ NEGBINOM.DIST = (number_f, number_s, probability_s, cumulative) => {
|
|
|
4070
4090
|
}
|
|
4071
4091
|
|
|
4072
4092
|
return cumulative
|
|
4073
|
-
?
|
|
4074
|
-
:
|
|
4093
|
+
? jStat__namespace.negbin.cdf(number_f, number_s, probability_s)
|
|
4094
|
+
: jStat__namespace.negbin.pdf(number_f, number_s, probability_s)
|
|
4075
4095
|
};
|
|
4076
4096
|
|
|
4077
4097
|
const NORM = {};
|
|
@@ -4101,7 +4121,7 @@ NORM.DIST = (x, mean, standard_dev, cumulative) => {
|
|
|
4101
4121
|
}
|
|
4102
4122
|
|
|
4103
4123
|
// Return normal distribution computed by jStat [http://jstat.org]
|
|
4104
|
-
return cumulative ?
|
|
4124
|
+
return cumulative ? jStat__namespace.normal.cdf(x, mean, standard_dev) : jStat__namespace.normal.pdf(x, mean, standard_dev)
|
|
4105
4125
|
};
|
|
4106
4126
|
|
|
4107
4127
|
/**
|
|
@@ -4123,7 +4143,7 @@ NORM.INV = (probability, mean, standard_dev) => {
|
|
|
4123
4143
|
return value
|
|
4124
4144
|
}
|
|
4125
4145
|
|
|
4126
|
-
return
|
|
4146
|
+
return jStat__namespace.normal.inv(probability, mean, standard_dev)
|
|
4127
4147
|
};
|
|
4128
4148
|
|
|
4129
4149
|
NORM.S = {};
|
|
@@ -4144,7 +4164,7 @@ NORM.S.DIST = (z, cumulative) => {
|
|
|
4144
4164
|
return value
|
|
4145
4165
|
}
|
|
4146
4166
|
|
|
4147
|
-
return cumulative ?
|
|
4167
|
+
return cumulative ? jStat__namespace.normal.cdf(z, 0, 1) : jStat__namespace.normal.pdf(z, 0, 1)
|
|
4148
4168
|
};
|
|
4149
4169
|
|
|
4150
4170
|
/**
|
|
@@ -4162,7 +4182,7 @@ NORM.S.INV = (probability) => {
|
|
|
4162
4182
|
return value
|
|
4163
4183
|
}
|
|
4164
4184
|
|
|
4165
|
-
return
|
|
4185
|
+
return jStat__namespace.normal.inv(probability, 0, 1)
|
|
4166
4186
|
};
|
|
4167
4187
|
|
|
4168
4188
|
/**
|
|
@@ -4182,8 +4202,8 @@ function PEARSON(array1, array2) {
|
|
|
4182
4202
|
return value
|
|
4183
4203
|
}
|
|
4184
4204
|
|
|
4185
|
-
const xmean =
|
|
4186
|
-
const ymean =
|
|
4205
|
+
const xmean = jStat__namespace.mean(array1);
|
|
4206
|
+
const ymean = jStat__namespace.mean(array2);
|
|
4187
4207
|
const n = array1.length;
|
|
4188
4208
|
|
|
4189
4209
|
let num = 0;
|
|
@@ -4428,7 +4448,7 @@ POISSON.DIST = (x, mean, cumulative) => {
|
|
|
4428
4448
|
return value
|
|
4429
4449
|
}
|
|
4430
4450
|
|
|
4431
|
-
return cumulative ?
|
|
4451
|
+
return cumulative ? jStat__namespace.poisson.cdf(x, mean) : jStat__namespace.poisson.pdf(x, mean)
|
|
4432
4452
|
};
|
|
4433
4453
|
|
|
4434
4454
|
/**
|
|
@@ -4629,7 +4649,7 @@ function ROW(reference, index) {
|
|
|
4629
4649
|
return undefined
|
|
4630
4650
|
}
|
|
4631
4651
|
|
|
4632
|
-
return
|
|
4652
|
+
return jStat__namespace.row(reference, index)
|
|
4633
4653
|
}
|
|
4634
4654
|
|
|
4635
4655
|
/**
|
|
@@ -4668,7 +4688,7 @@ function SKEW() {
|
|
|
4668
4688
|
return range
|
|
4669
4689
|
}
|
|
4670
4690
|
|
|
4671
|
-
const mean =
|
|
4691
|
+
const mean = jStat__namespace.mean(range);
|
|
4672
4692
|
const n = range.length;
|
|
4673
4693
|
|
|
4674
4694
|
let sigma = 0;
|
|
@@ -4677,7 +4697,7 @@ function SKEW() {
|
|
|
4677
4697
|
sigma += Math.pow(range[i] - mean, 3);
|
|
4678
4698
|
}
|
|
4679
4699
|
|
|
4680
|
-
return (n * sigma) / ((n - 1) * (n - 2) * Math.pow(
|
|
4700
|
+
return (n * sigma) / ((n - 1) * (n - 2) * Math.pow(jStat__namespace.stdev(range, true), 3))
|
|
4681
4701
|
}
|
|
4682
4702
|
|
|
4683
4703
|
/**
|
|
@@ -4694,7 +4714,7 @@ SKEW.P = function () {
|
|
|
4694
4714
|
return range
|
|
4695
4715
|
}
|
|
4696
4716
|
|
|
4697
|
-
const mean =
|
|
4717
|
+
const mean = jStat__namespace.mean(range);
|
|
4698
4718
|
const n = range.length;
|
|
4699
4719
|
|
|
4700
4720
|
let m2 = 0;
|
|
@@ -4728,8 +4748,8 @@ function SLOPE(known_y, known_x) {
|
|
|
4728
4748
|
return value
|
|
4729
4749
|
}
|
|
4730
4750
|
|
|
4731
|
-
const xmean =
|
|
4732
|
-
const ymean =
|
|
4751
|
+
const xmean = jStat__namespace.mean(known_x);
|
|
4752
|
+
const ymean = jStat__namespace.mean(known_y);
|
|
4733
4753
|
const n = known_x.length;
|
|
4734
4754
|
|
|
4735
4755
|
let num = 0;
|
|
@@ -4874,8 +4894,8 @@ function STEYX(known_y, known_x) {
|
|
|
4874
4894
|
return value
|
|
4875
4895
|
}
|
|
4876
4896
|
|
|
4877
|
-
const xmean =
|
|
4878
|
-
const ymean =
|
|
4897
|
+
const xmean = jStat__namespace.mean(known_x);
|
|
4898
|
+
const ymean = jStat__namespace.mean(known_y);
|
|
4879
4899
|
const n = known_x.length;
|
|
4880
4900
|
|
|
4881
4901
|
let lft = 0;
|
|
@@ -4931,7 +4951,7 @@ T.DIST['2T'] = function (x, deg_freedom) {
|
|
|
4931
4951
|
return value
|
|
4932
4952
|
}
|
|
4933
4953
|
|
|
4934
|
-
return (1 -
|
|
4954
|
+
return (1 - jStat__namespace.studentt.cdf(x, deg_freedom)) * 2
|
|
4935
4955
|
};
|
|
4936
4956
|
|
|
4937
4957
|
/**
|
|
@@ -4956,7 +4976,7 @@ T.DIST.RT = function (x, deg_freedom) {
|
|
|
4956
4976
|
return value
|
|
4957
4977
|
}
|
|
4958
4978
|
|
|
4959
|
-
return 1 -
|
|
4979
|
+
return 1 - jStat__namespace.studentt.cdf(x, deg_freedom)
|
|
4960
4980
|
};
|
|
4961
4981
|
|
|
4962
4982
|
/**
|
|
@@ -4976,7 +4996,7 @@ T.INV = (probability, deg_freedom) => {
|
|
|
4976
4996
|
return value
|
|
4977
4997
|
}
|
|
4978
4998
|
|
|
4979
|
-
return
|
|
4999
|
+
return jStat__namespace.studentt.inv(probability, deg_freedom)
|
|
4980
5000
|
};
|
|
4981
5001
|
|
|
4982
5002
|
/**
|
|
@@ -5000,7 +5020,7 @@ T.INV['2T'] = (probability, deg_freedom) => {
|
|
|
5000
5020
|
return value
|
|
5001
5021
|
}
|
|
5002
5022
|
|
|
5003
|
-
return Math.abs(
|
|
5023
|
+
return Math.abs(jStat__namespace.studentt.inv(probability / 2, deg_freedom))
|
|
5004
5024
|
};
|
|
5005
5025
|
|
|
5006
5026
|
// The algorithm can be found here:
|
|
@@ -5022,8 +5042,8 @@ T.TEST = (array1, array2) => {
|
|
|
5022
5042
|
return value
|
|
5023
5043
|
}
|
|
5024
5044
|
|
|
5025
|
-
const mean_x =
|
|
5026
|
-
const mean_y =
|
|
5045
|
+
const mean_x = jStat__namespace.mean(array1);
|
|
5046
|
+
const mean_y = jStat__namespace.mean(array2);
|
|
5027
5047
|
|
|
5028
5048
|
let s_x = 0;
|
|
5029
5049
|
let s_y = 0;
|
|
@@ -5095,7 +5115,7 @@ function TRIMMEAN(range, percent) {
|
|
|
5095
5115
|
|
|
5096
5116
|
const trim = FLOOR(range.length * percent, 2) / 2;
|
|
5097
5117
|
|
|
5098
|
-
return
|
|
5118
|
+
return jStat__namespace.mean(
|
|
5099
5119
|
initial(
|
|
5100
5120
|
rest(
|
|
5101
5121
|
range.sort((a, b) => a - b),
|
|
@@ -8569,7 +8589,7 @@ function BESSELI(x, n) {
|
|
|
8569
8589
|
return value
|
|
8570
8590
|
}
|
|
8571
8591
|
|
|
8572
|
-
return
|
|
8592
|
+
return bessel__namespace.besseli(x, n)
|
|
8573
8593
|
}
|
|
8574
8594
|
|
|
8575
8595
|
/**
|
|
@@ -8589,7 +8609,7 @@ function BESSELJ(x, n) {
|
|
|
8589
8609
|
return value
|
|
8590
8610
|
}
|
|
8591
8611
|
|
|
8592
|
-
return
|
|
8612
|
+
return bessel__namespace.besselj(x, n)
|
|
8593
8613
|
}
|
|
8594
8614
|
|
|
8595
8615
|
/**
|
|
@@ -8609,7 +8629,7 @@ function BESSELK(x, n) {
|
|
|
8609
8629
|
return value
|
|
8610
8630
|
}
|
|
8611
8631
|
|
|
8612
|
-
return
|
|
8632
|
+
return bessel__namespace.besselk(x, n)
|
|
8613
8633
|
}
|
|
8614
8634
|
|
|
8615
8635
|
/**
|
|
@@ -8629,7 +8649,7 @@ function BESSELY(x, n) {
|
|
|
8629
8649
|
return value
|
|
8630
8650
|
}
|
|
8631
8651
|
|
|
8632
|
-
return
|
|
8652
|
+
return bessel__namespace.bessely(x, n)
|
|
8633
8653
|
}
|
|
8634
8654
|
|
|
8635
8655
|
/**
|
|
@@ -9480,7 +9500,7 @@ function ERF(lower_limit, upper_limit) {
|
|
|
9480
9500
|
return value
|
|
9481
9501
|
}
|
|
9482
9502
|
|
|
9483
|
-
return
|
|
9503
|
+
return jStat__namespace.erf(lower_limit)
|
|
9484
9504
|
}
|
|
9485
9505
|
|
|
9486
9506
|
// TODO
|
|
@@ -9513,7 +9533,7 @@ function ERFC(x) {
|
|
|
9513
9533
|
return value
|
|
9514
9534
|
}
|
|
9515
9535
|
|
|
9516
|
-
return
|
|
9536
|
+
return jStat__namespace.erfc(x)
|
|
9517
9537
|
}
|
|
9518
9538
|
|
|
9519
9539
|
// TODO
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// src/crypto-constants.js
|
|
2
|
+
var SERVICE_API_KEY = {
|
|
3
|
+
Etherscan: "ETHERSCAN_API_KEY"
|
|
4
|
+
};
|
|
5
|
+
var FUNCTION_LOCALE = [
|
|
6
|
+
{
|
|
7
|
+
n: "GETTXLIST",
|
|
8
|
+
t: 20,
|
|
9
|
+
d: "Returns the list of transactions performed by an address, with optional pagination.",
|
|
10
|
+
a: "Returns the list of transactions performed by an address, with optional pagination.",
|
|
11
|
+
p: [
|
|
12
|
+
{
|
|
13
|
+
name: "value1",
|
|
14
|
+
detail: "The address string representing the addresses to check for balance",
|
|
15
|
+
example: `"0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC"`,
|
|
16
|
+
require: "m"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "value2",
|
|
20
|
+
detail: "Page number.",
|
|
21
|
+
example: "1",
|
|
22
|
+
require: "o",
|
|
23
|
+
repeat: "n",
|
|
24
|
+
type: "rangenumber"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "value3",
|
|
28
|
+
detail: "Page size(offset).",
|
|
29
|
+
example: "100",
|
|
30
|
+
require: "o",
|
|
31
|
+
repeat: "n",
|
|
32
|
+
type: "rangenumber"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
export {
|
|
38
|
+
FUNCTION_LOCALE,
|
|
39
|
+
SERVICE_API_KEY
|
|
40
|
+
};
|
package/lib/esm/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/formulajs",
|
|
3
|
-
"version": "4.4.11-mod-
|
|
3
|
+
"version": "4.4.11-mod-5",
|
|
4
4
|
"description": "JavaScript implementation of most Microsoft Excel formula functions",
|
|
5
5
|
"author": "Formulajs",
|
|
6
6
|
"publishConfig": {
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"unpkg": "./lib/browser/formula.min.js",
|
|
25
25
|
"jsdelivr": "./lib/browser/formula.min.js",
|
|
26
26
|
"exports": {
|
|
27
|
+
"./crypto-constants": "./lib/esm/crypto-constants.mjs",
|
|
27
28
|
".": {
|
|
28
29
|
"import": {
|
|
29
30
|
"types": "./types/esm/index.d.mts",
|
|
@@ -43,7 +44,8 @@
|
|
|
43
44
|
"types"
|
|
44
45
|
],
|
|
45
46
|
"scripts": {
|
|
46
|
-
"build": "
|
|
47
|
+
"build:crypto-constants": "esbuild src/crypto-constants.js --bundle --outfile=lib/esm/crypto-constants.mjs --format=esm",
|
|
48
|
+
"build": "rollup -c && npm run types && npm run build:crypto-constants",
|
|
47
49
|
"format": "npm run prettier:fix && npm run lint:fix",
|
|
48
50
|
"lint": "eslint .",
|
|
49
51
|
"lint:fix": "eslint --fix .",
|
|
@@ -70,6 +72,7 @@
|
|
|
70
72
|
"c8": "^10.1.3",
|
|
71
73
|
"chai": "^5.2.0",
|
|
72
74
|
"cli-table3": "^0.6.5",
|
|
75
|
+
"esbuild": "^0.25.4",
|
|
73
76
|
"eslint": "^9.20.1",
|
|
74
77
|
"globals": "^15.15.0",
|
|
75
78
|
"mocha": "^11.1.0",
|