ziko 0.54.4 → 0.55.0

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.
@@ -1,100 +0,0 @@
1
- // Mixed calcul
2
- const sum=(...x)=>{
3
- if(x.every(n=>typeof n==="number")){
4
- let s = x[0];
5
- for (let i = 1; i < x.length; i++) s += x[i];
6
- return s;
7
- }
8
- const Y=[];
9
- for(let i=0;i<x.length;i++){
10
- if(x[i] instanceof Array)Y.push(sum(...x[i]));
11
- else if(x[i] instanceof Object){
12
- Y.push(sum(...Object.values(x[i])))
13
- }
14
- }
15
- return Y.length===1?Y[0]:Y;
16
- }
17
- const prod=(...x)=>{
18
- if(x.every(n=>typeof n==="number")){
19
- let p = x[0];
20
- for (let i = 1; i < x.length; i++) p *= x[i];
21
- return p;
22
- }
23
- const Y=[];
24
- for(let i=0;i<x.length;i++){
25
- if(x[i] instanceof Array)Y.push(prod(...x[i]));
26
- else if(x[i] instanceof Object){
27
- Y.push(prod(...Object.values(x[i])))
28
- }
29
- }
30
- return Y.length===1?Y[0]:Y;
31
- }
32
- // const min=(...num)=>{
33
- // if(num.every(n=>typeof n==="number"))return Math.min(...num);
34
- // const Y=[];
35
- // for(let i=0;i<num.length;i++){
36
- // if(num[i] instanceof Array)Y.push(min(...num[i]));
37
- // else if(num[i] instanceof Object){
38
- // Y.push(
39
- // Object.fromEntries(
40
- // [Object.entries(num[i]).sort((a,b)=>a[1]-b[1])[0]]
41
- // )
42
- // )
43
- // }
44
- // }
45
- // return Y.length===1?Y[0]:Y;
46
- // }
47
- // const max=(...num)=>{
48
- // if(num.every(n=>typeof n==="number"))return Math.max(...num);
49
- // const Y=[];
50
- // for(let i=0;i<num.length;i++){
51
- // if(num[i] instanceof Array)Y.push(min(...num[i]));
52
- // else if(num[i] instanceof Object){
53
- // Y.push(
54
- // Object.fromEntries(
55
- // [Object.entries(num[i]).sort((a,b)=>b[1]-a[1])[0]]
56
- // )
57
- // )
58
- // }
59
- // }
60
- // return Y.length===1?Y[0]:Y;
61
- // }
62
- const accum=(...num)=>{
63
- if(num.every(n=>typeof n==="number")){
64
- let acc = num.reduce((x, y) => [...x, x[x.length - 1] + y], [0]);
65
- acc.shift();
66
- return acc;
67
- }
68
- const Y=[];
69
- for(let i=0;i<num.length;i++){
70
- if(num[i] instanceof Array)Y.push(accum(...num[i]));
71
- else if(num[i] instanceof Object){
72
- Y.push(null
73
- // Object.fromEntries(
74
- // [Object.entries(num[i]).sort((a,b)=>b[1]-a[1])[0]]
75
- // )
76
- )
77
- }
78
- }
79
- return Y.length===1?Y[0]:Y;
80
- }
81
-
82
- // sort
83
-
84
- export{
85
- sum,
86
- prod,
87
- // min,
88
- // max,
89
- accum
90
- }
91
-
92
- //moy
93
- //med
94
- //variance
95
- //std
96
- //mode
97
- //acccum
98
- //min2max
99
- //max2min
100
- //percentile
@@ -1,16 +0,0 @@
1
- import {
2
- sum,
3
- prod,
4
- // min,
5
- // max,
6
- accum
7
- } from "./functions/index.js"
8
- const Stats={
9
- sum,
10
- prod,
11
- // min,
12
- // max,
13
- accum,
14
- }
15
- export default Stats;
16
- export * from "./functions/index.js"
File without changes
File without changes
File without changes