@gridsheet/functions 3.0.1 → 3.0.3

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,8 +1,8 @@
1
- import { BaseFunction as o, FormulaError as u, ensureNumber as h, eachMatrix as l, conditionArg as f, ensureString as b, stripMatrix as w, check as y, Sheet as x, createBooleanMask as M } from "@gridsheet/core";
2
- const v = "Returns the result of the modulo operation.";
3
- class T extends o {
1
+ import { BaseFunction as o, FormulaError as u, ensureNumber as h, eachMatrix as l, isNumeric as w, conditionArg as f, ensureString as b, stripMatrix as y, check as M, Sheet as x, createBooleanMask as v } from "@gridsheet/core";
2
+ const T = "Returns the result of the modulo operation.";
3
+ class A extends o {
4
4
  constructor() {
5
- super(...arguments), this.example = "MOD(10, 4)", this.description = v, this.defs = [
5
+ super(...arguments), this.example = "MOD(10, 4)", this.description = T, this.defs = [
6
6
  {
7
7
  name: "dividend",
8
8
  description: "A number that will be divided by divisor.",
@@ -23,10 +23,10 @@ class T extends o {
23
23
  return (e % t + t) % t;
24
24
  }
25
25
  }
26
- const A = "Returns the positive square root of a positive number.";
27
- class R extends o {
26
+ const R = "Returns the positive square root of a positive number.";
27
+ class N extends o {
28
28
  constructor() {
29
- super(...arguments), this.example = "SQRT(9)", this.description = A, this.defs = [
29
+ super(...arguments), this.example = "SQRT(9)", this.description = R, this.defs = [
30
30
  {
31
31
  name: "value",
32
32
  description: "A number for which the positive square root is to be found.",
@@ -40,10 +40,10 @@ class R extends o {
40
40
  return Math.sqrt(e);
41
41
  }
42
42
  }
43
- const N = "Returns the product of a series of numbers.";
44
- class F extends o {
43
+ const F = "Returns the product of a series of numbers.";
44
+ class S extends o {
45
45
  constructor() {
46
- super(...arguments), this.example = "PRODUCT(2,3,4)", this.description = N, this.defs = [
46
+ super(...arguments), this.example = "PRODUCT(2,3,4)", this.description = F, this.defs = [
47
47
  {
48
48
  name: "value",
49
49
  description: "Numbers or ranges to multiply.",
@@ -59,17 +59,17 @@ class F extends o {
59
59
  l(
60
60
  n,
61
61
  (r) => {
62
- r == null || typeof r == "string" || (t *= h(r));
62
+ w(r) && (t *= h(r));
63
63
  },
64
64
  this.at
65
65
  );
66
66
  return t;
67
67
  }
68
68
  }
69
- const S = "Round a number to the specified number of decimal places according to standard rules.";
70
- class U extends o {
69
+ const U = "Round a number to the specified number of decimal places according to standard rules.";
70
+ class E extends o {
71
71
  constructor() {
72
- super(...arguments), this.example = "ROUND(99.44,1)", this.description = S, this.defs = [
72
+ super(...arguments), this.example = "ROUND(99.44,1)", this.description = U, this.defs = [
73
73
  {
74
74
  name: "value",
75
75
  description: "A number to be rounded.",
@@ -88,10 +88,10 @@ class U extends o {
88
88
  return Math.round(e * n) / n;
89
89
  }
90
90
  }
91
- const E = "Round down a number to the specified number of decimal places according to standard rules.";
92
- class $ extends o {
91
+ const $ = "Round down a number to the specified number of decimal places according to standard rules.";
92
+ class q extends o {
93
93
  constructor() {
94
- super(...arguments), this.example = "ROUNDDOWN(99.44,1)", this.description = E, this.defs = [
94
+ super(...arguments), this.example = "ROUNDDOWN(99.44,1)", this.description = $, this.defs = [
95
95
  {
96
96
  name: "value",
97
97
  description: "A number to be rounded down.",
@@ -110,10 +110,10 @@ class $ extends o {
110
110
  return Math.floor(e * n) / n;
111
111
  }
112
112
  }
113
- const q = "Round up a number to the specified number of decimal places according to standard rules.";
114
- class C extends o {
113
+ const C = "Round up a number to the specified number of decimal places according to standard rules.";
114
+ class I extends o {
115
115
  constructor() {
116
- super(...arguments), this.example = "ROUNDUP(99.44,1)", this.description = q, this.defs = [
116
+ super(...arguments), this.example = "ROUNDUP(99.44,1)", this.description = C, this.defs = [
117
117
  {
118
118
  name: "value",
119
119
  description: "A number to be rounded up.",
@@ -132,10 +132,10 @@ class C extends o {
132
132
  return Math.ceil(e * n) / n;
133
133
  }
134
134
  }
135
- const I = "Returns the logarithm of a number whose base is the specified number.";
136
- class k extends o {
135
+ const k = "Returns the logarithm of a number whose base is the specified number.";
136
+ class D extends o {
137
137
  constructor() {
138
- super(...arguments), this.example = "LOG(128, 2)", this.description = I, this.defs = [
138
+ super(...arguments), this.example = "LOG(128, 2)", this.description = k, this.defs = [
139
139
  {
140
140
  name: "value",
141
141
  description: "The value for the logarithm of the specified number as base.",
@@ -156,10 +156,10 @@ class k extends o {
156
156
  return Math.log2(e) / Math.log2(t);
157
157
  }
158
158
  }
159
- const D = "Returns the logarithm of 10";
160
- class O extends o {
159
+ const O = "Returns the logarithm of 10";
160
+ class L extends o {
161
161
  constructor() {
162
- super(...arguments), this.example = "LOG10(100)", this.description = D, this.defs = [
162
+ super(...arguments), this.example = "LOG10(100)", this.description = O, this.defs = [
163
163
  {
164
164
  name: "value",
165
165
  description: "The value for the logarithm of 10",
@@ -173,10 +173,10 @@ class O extends o {
173
173
  return Math.log10(e);
174
174
  }
175
175
  }
176
- const L = "Returns the logarithm of e";
177
- class P extends o {
176
+ const P = "Returns the logarithm of e";
177
+ class V extends o {
178
178
  constructor() {
179
- super(...arguments), this.example = "LN(100)", this.description = L, this.defs = [
179
+ super(...arguments), this.example = "LN(100)", this.description = P, this.defs = [
180
180
  {
181
181
  name: "value",
182
182
  description: "The value for the logarithm of e",
@@ -190,10 +190,10 @@ class P extends o {
190
190
  return Math.log(e);
191
191
  }
192
192
  }
193
- const V = "Returns the power of a number whose base is the Euler number e.";
194
- class B extends o {
193
+ const B = "Returns the power of a number whose base is the Euler number e.";
194
+ class _ extends o {
195
195
  constructor() {
196
- super(...arguments), this.example = "EXP(2)", this.description = V, this.defs = [
196
+ super(...arguments), this.example = "EXP(2)", this.description = B, this.defs = [
197
197
  {
198
198
  name: "exponent",
199
199
  description: "It is an exponent of power with e as the base.",
@@ -210,19 +210,19 @@ class B extends o {
210
210
  return Math.exp(e);
211
211
  }
212
212
  }
213
- const _ = "Returns the value of Pi.";
214
- class z extends o {
213
+ const z = "Returns the value of Pi.";
214
+ class j extends o {
215
215
  constructor() {
216
- super(...arguments), this.example = "PI()", this.description = _, this.defs = [], this.category = "math";
216
+ super(...arguments), this.example = "PI()", this.description = z, this.defs = [], this.category = "math";
217
217
  }
218
218
  main() {
219
219
  return Math.PI;
220
220
  }
221
221
  }
222
- const j = "Converts an angle value in degrees to radians.";
223
- class G extends o {
222
+ const G = "Converts an angle value in degrees to radians.";
223
+ class Q extends o {
224
224
  constructor() {
225
- super(...arguments), this.example = "RADIANS(180)", this.description = j, this.defs = [
225
+ super(...arguments), this.example = "RADIANS(180)", this.description = G, this.defs = [
226
226
  {
227
227
  name: "angle",
228
228
  description: "An angle in degrees that you want to convert to radians.",
@@ -234,10 +234,10 @@ class G extends o {
234
234
  return e / 180 * Math.PI;
235
235
  }
236
236
  }
237
- const Q = "Returns the sin of the angle specified in radians.";
238
- class X extends o {
237
+ const X = "Returns the sin of the angle specified in radians.";
238
+ class W extends o {
239
239
  constructor() {
240
- super(...arguments), this.example = "SIN(PI()/2)", this.description = Q, this.defs = [
240
+ super(...arguments), this.example = "SIN(PI()/2)", this.description = X, this.defs = [
241
241
  {
242
242
  name: "angle",
243
243
  description: "An angle in radians, at which you want the sin.",
@@ -249,10 +249,10 @@ class X extends o {
249
249
  return Math.sin(e);
250
250
  }
251
251
  }
252
- const W = "Returns the cos of the angle specified in radians.";
253
- class Y extends o {
252
+ const Y = "Returns the cos of the angle specified in radians.";
253
+ class H extends o {
254
254
  constructor() {
255
- super(...arguments), this.example = "COS(PI())", this.description = W, this.defs = [
255
+ super(...arguments), this.example = "COS(PI())", this.description = Y, this.defs = [
256
256
  {
257
257
  name: "angle",
258
258
  description: "An angle in radians, at which you want the cos.",
@@ -264,10 +264,10 @@ class Y extends o {
264
264
  return Math.cos(e);
265
265
  }
266
266
  }
267
- const H = "Returns the tan of the angle specified in radians.";
268
- class J extends o {
267
+ const J = "Returns the tan of the angle specified in radians.";
268
+ class K extends o {
269
269
  constructor() {
270
- super(...arguments), this.example = "TAN(PI()/4)", this.description = H, this.defs = [
270
+ super(...arguments), this.example = "TAN(PI()/4)", this.description = J, this.defs = [
271
271
  {
272
272
  name: "angle",
273
273
  description: "An angle in radians, at which you want the tan.",
@@ -279,10 +279,10 @@ class J extends o {
279
279
  return Math.tan(e);
280
280
  }
281
281
  }
282
- const K = "Returns the inverse sin of the value in radians.";
283
- class Z extends o {
282
+ const Z = "Returns the inverse sin of the value in radians.";
283
+ class ee extends o {
284
284
  constructor() {
285
- super(...arguments), this.example = "ASIN(1)", this.description = K, this.defs = [
285
+ super(...arguments), this.example = "ASIN(1)", this.description = Z, this.defs = [
286
286
  {
287
287
  name: "value",
288
288
  description: "A value for the inverse sin between -1 and 1.",
@@ -296,10 +296,10 @@ class Z extends o {
296
296
  return Math.asin(e);
297
297
  }
298
298
  }
299
- const ee = "Returns the inverse cos of the value in radians.";
300
- class te extends o {
299
+ const te = "Returns the inverse cos of the value in radians.";
300
+ class ne extends o {
301
301
  constructor() {
302
- super(...arguments), this.example = "ACOS(0)", this.description = ee, this.defs = [
302
+ super(...arguments), this.example = "ACOS(0)", this.description = te, this.defs = [
303
303
  {
304
304
  name: "value",
305
305
  description: "A value for the inverse cos between -1 and 1.",
@@ -313,10 +313,10 @@ class te extends o {
313
313
  return Math.acos(e);
314
314
  }
315
315
  }
316
- const ne = "Returns the inverse tan of the value in radians.";
317
- class se extends o {
316
+ const se = "Returns the inverse tan of the value in radians.";
317
+ class re extends o {
318
318
  constructor() {
319
- super(...arguments), this.example = "ATAN(1)", this.description = ne, this.defs = [
319
+ super(...arguments), this.example = "ATAN(1)", this.description = se, this.defs = [
320
320
  {
321
321
  name: "value",
322
322
  description: "A value for the inverse tan.",
@@ -328,10 +328,10 @@ class se extends o {
328
328
  return Math.atan(e);
329
329
  }
330
330
  }
331
- const re = "Returns the angle in radians between the x-axis and a line passing from the origin through a given coordinate point (x, y).";
332
- class ie extends o {
331
+ const ie = "Returns the angle in radians between the x-axis and a line passing from the origin through a given coordinate point (x, y).";
332
+ class ae extends o {
333
333
  constructor() {
334
- super(...arguments), this.example = "ATAN2(4,3)", this.description = re, this.defs = [
334
+ super(...arguments), this.example = "ATAN2(4,3)", this.description = ie, this.defs = [
335
335
  {
336
336
  name: "x",
337
337
  description: "x of the point.",
@@ -348,19 +348,19 @@ class ie extends o {
348
348
  return Math.atan2(e, t);
349
349
  }
350
350
  }
351
- const ae = "Returns a random number between 0 and 1.";
352
- class oe extends o {
351
+ const oe = "Returns a random number between 0 and 1.";
352
+ class ce extends o {
353
353
  constructor() {
354
- super(...arguments), this.example = "RAND()", this.description = ae, this.defs = [], this.category = "math";
354
+ super(...arguments), this.example = "RAND()", this.description = oe, this.defs = [], this.category = "math";
355
355
  }
356
356
  main() {
357
357
  return Math.random();
358
358
  }
359
359
  }
360
- const ce = "Returns a value interpreted as a percentage, i.e. divides the number by 100.";
361
- class ue extends o {
360
+ const ue = "Returns a value interpreted as a percentage, i.e. divides the number by 100.";
361
+ class me extends o {
362
362
  constructor() {
363
- super(...arguments), this.example = "UNARY_PERCENT(50)", this.description = ce, this.defs = [
363
+ super(...arguments), this.example = "UNARY_PERCENT(50)", this.description = ue, this.defs = [
364
364
  {
365
365
  name: "value",
366
366
  description: "A number to be divided by 100.",
@@ -372,10 +372,10 @@ class ue extends o {
372
372
  return e / 100;
373
373
  }
374
374
  }
375
- const me = "Returns the number with its sign unchanged (unary plus).";
376
- class de extends o {
375
+ const de = "Returns the number with its sign unchanged (unary plus).";
376
+ class he extends o {
377
377
  constructor() {
378
- super(...arguments), this.example = "UPLUS(4)", this.description = me, this.defs = [
378
+ super(...arguments), this.example = "UPLUS(4)", this.description = de, this.defs = [
379
379
  {
380
380
  name: "value",
381
381
  description: "A number to return as-is.",
@@ -387,10 +387,10 @@ class de extends o {
387
387
  return e;
388
388
  }
389
389
  }
390
- const he = "Returns the sum of a series of cells.";
391
- class pe extends o {
390
+ const pe = "Returns the sum of a series of cells.";
391
+ class le extends o {
392
392
  constructor() {
393
- super(...arguments), this.example = 'SUMIF(A1:A10,">20")', this.description = he, this.defs = [
393
+ super(...arguments), this.example = 'SUMIF(A1:A10,">20")', this.description = pe, this.defs = [
394
394
  { name: "range", description: "A condition range.", takesMatrix: !0, acceptedTypes: ["matrix"] },
395
395
  f,
396
396
  {
@@ -419,15 +419,15 @@ class pe extends o {
419
419
  );
420
420
  let m = 0;
421
421
  return s.forEach((c, d) => {
422
- const p = w((n ? a[d] : c) ?? 0, this.at);
423
- typeof p == "number" && y(c, r) && (m += p);
422
+ const p = y((n ? a[d] : c) ?? 0, this.at);
423
+ w(p) && M(c, r) && (m += h(p));
424
424
  }), m;
425
425
  }
426
426
  }
427
- const le = "Returns the sum of a range depending on multiple criteria.";
428
- class fe extends o {
427
+ const fe = "Returns the sum of a range depending on multiple criteria.";
428
+ class ge extends o {
429
429
  constructor() {
430
- super(...arguments), this.example = 'SUMIFS(A1:A10, B1:B10, ">20")', this.description = le, this.defs = [
430
+ super(...arguments), this.example = 'SUMIFS(A1:A10, B1:B10, ">20")', this.description = fe, this.defs = [
431
431
  { name: "sum_range", description: "The range to be summed.", takesMatrix: !0, acceptedTypes: ["matrix"] },
432
432
  {
433
433
  name: "range",
@@ -453,7 +453,7 @@ class fe extends o {
453
453
  throw new u("#VALUE!", "Array arguments to SUMIFS are of different size.");
454
454
  s.push(t[d]), a.push(b(t[d + 1]));
455
455
  }
456
- const m = t[0], c = M(s, a, this.at);
456
+ const m = t[0], c = v(s, a, this.at);
457
457
  return [m, c];
458
458
  }
459
459
  main(e, t) {
@@ -462,18 +462,18 @@ class fe extends o {
462
462
  e,
463
463
  (r, s) => {
464
464
  if (s && t[s.y][s.x]) {
465
- const a = w(r ?? 0, this.at);
466
- typeof a == "number" && (n += a);
465
+ const a = y(r ?? 0, this.at);
466
+ w(a) && (n += h(a));
467
467
  }
468
468
  },
469
469
  this.at
470
470
  ), n;
471
471
  }
472
472
  }
473
- const ge = "Returns the count of a series of cells.";
474
- class xe extends o {
473
+ const xe = "Returns the count of a series of cells.";
474
+ class be extends o {
475
475
  constructor() {
476
- super(...arguments), this.example = 'COUNTIF(A1:A10,">20")', this.description = ge, this.defs = [
476
+ super(...arguments), this.example = 'COUNTIF(A1:A10,">20")', this.description = xe, this.defs = [
477
477
  { name: "range", description: "Target range.", takesMatrix: !0, acceptedTypes: ["matrix"] },
478
478
  { ...f }
479
479
  ], this.category = "math";
@@ -484,16 +484,16 @@ class xe extends o {
484
484
  return l(
485
485
  e,
486
486
  (s) => {
487
- y(s, n) && r++;
487
+ M(s, n) && r++;
488
488
  },
489
489
  this.at
490
490
  ), r;
491
491
  }
492
492
  }
493
- const be = "Returns the count of a range depending on multiple criteria.";
494
- class we extends o {
493
+ const we = "Returns the count of a range depending on multiple criteria.";
494
+ class ye extends o {
495
495
  constructor() {
496
- super(...arguments), this.example = 'COUNTIFS(A1:A10, ">20", B1:B10, "<5")', this.description = be, this.defs = [
496
+ super(...arguments), this.example = 'COUNTIFS(A1:A10, ">20", B1:B10, "<5")', this.description = we, this.defs = [
497
497
  { name: "range1", description: "First condition range.", takesMatrix: !0, acceptedTypes: ["matrix"] },
498
498
  { ...f, name: "condition1" },
499
499
  {
@@ -522,7 +522,7 @@ class we extends o {
522
522
  throw new u("#VALUE!", "Array arguments to COUNTIFS are of different size.");
523
523
  a.push(t[d]), m.push(b(t[d + 1]));
524
524
  }
525
- return [M(a, m, this.at)];
525
+ return [v(a, m, this.at)];
526
526
  }
527
527
  main(e) {
528
528
  let t = 0;
@@ -532,10 +532,10 @@ class we extends o {
532
532
  return t;
533
533
  }
534
534
  }
535
- const ye = "Returns the factorial of a number.";
536
- class Me extends o {
535
+ const Me = "Returns the factorial of a number.";
536
+ class ve extends o {
537
537
  constructor() {
538
- super(...arguments), this.example = "FACT(5)", this.description = ye, this.defs = [
538
+ super(...arguments), this.example = "FACT(5)", this.description = Me, this.defs = [
539
539
  {
540
540
  name: "value",
541
541
  description: "A non-negative integer whose factorial will be returned.",
@@ -552,10 +552,10 @@ class Me extends o {
552
552
  return t;
553
553
  }
554
554
  }
555
- const ve = "Rounds a number down to the nearest integer that is less than or equal to it.";
556
- class Te extends o {
555
+ const Te = "Rounds a number down to the nearest integer that is less than or equal to it.";
556
+ class Ae extends o {
557
557
  constructor() {
558
- super(...arguments), this.example = "INT(8.9)", this.description = ve, this.defs = [
558
+ super(...arguments), this.example = "INT(8.9)", this.description = Te, this.defs = [
559
559
  { name: "value", description: "The value to round down to the nearest integer.", acceptedTypes: ["number"] }
560
560
  ], this.category = "math";
561
561
  }
@@ -563,10 +563,10 @@ class Te extends o {
563
563
  return Math.floor(e);
564
564
  }
565
565
  }
566
- const Ae = "Returns TRUE if the value is even.";
567
- class Re extends o {
566
+ const Re = "Returns TRUE if the value is even.";
567
+ class Ne extends o {
568
568
  constructor() {
569
- super(...arguments), this.example = "ISEVEN(4)", this.description = Ae, this.defs = [
569
+ super(...arguments), this.example = "ISEVEN(4)", this.description = Re, this.defs = [
570
570
  { name: "value", description: "The value to check for being even.", acceptedTypes: ["number"] }
571
571
  ], this.category = "math";
572
572
  }
@@ -574,10 +574,10 @@ class Re extends o {
574
574
  return Math.floor(Math.abs(e)) % 2 === 0;
575
575
  }
576
576
  }
577
- const Ne = "Returns TRUE if the value is odd.";
578
- class Fe extends o {
577
+ const Fe = "Returns TRUE if the value is odd.";
578
+ class Se extends o {
579
579
  constructor() {
580
- super(...arguments), this.example = "ISODD(3)", this.description = Ne, this.defs = [
580
+ super(...arguments), this.example = "ISODD(3)", this.description = Fe, this.defs = [
581
581
  { name: "value", description: "The value to check for being odd.", acceptedTypes: ["number"] }
582
582
  ], this.category = "math";
583
583
  }
@@ -585,15 +585,15 @@ class Fe extends o {
585
585
  return Math.floor(Math.abs(e)) % 2 !== 0;
586
586
  }
587
587
  }
588
- function Se(i, e) {
588
+ function Ue(i, e) {
589
589
  for (i = Math.abs(Math.floor(i)), e = Math.abs(Math.floor(e)); e; )
590
590
  [i, e] = [e, i % e];
591
591
  return i;
592
592
  }
593
- const Ue = "Returns the least common multiple of one or more integers.";
594
- class Ee extends o {
593
+ const Ee = "Returns the least common multiple of one or more integers.";
594
+ class $e extends o {
595
595
  constructor() {
596
- super(...arguments), this.example = "LCM(4, 6)", this.description = Ue, this.defs = [
596
+ super(...arguments), this.example = "LCM(4, 6)", this.description = Ee, this.defs = [
597
597
  { name: "value", description: "Integers (must be >= 1).", acceptedTypes: ["number"], variadic: !0 }
598
598
  ], this.category = "math";
599
599
  }
@@ -608,13 +608,13 @@ class Ee extends o {
608
608
  });
609
609
  }
610
610
  main(...e) {
611
- return e.reduce((t, n) => t * n / Se(t, n), 1);
611
+ return e.reduce((t, n) => t * n / Ue(t, n), 1);
612
612
  }
613
613
  }
614
- const $e = "Rounds a number up to the nearest odd integer.";
615
- class qe extends o {
614
+ const qe = "Rounds a number up to the nearest odd integer.";
615
+ class Ce extends o {
616
616
  constructor() {
617
- super(...arguments), this.example = "ODD(2.3)", this.description = $e, this.defs = [
617
+ super(...arguments), this.example = "ODD(2.3)", this.description = qe, this.defs = [
618
618
  { name: "value", description: "The value to round up to the nearest odd integer.", acceptedTypes: ["number"] }
619
619
  ], this.category = "math";
620
620
  }
@@ -626,10 +626,10 @@ class qe extends o {
626
626
  return n % 2 === 0 && n++, t * n;
627
627
  }
628
628
  }
629
- const Ce = "Rounds a number up to the nearest even integer.";
630
- class Ie extends o {
629
+ const Ie = "Rounds a number up to the nearest even integer.";
630
+ class ke extends o {
631
631
  constructor() {
632
- super(...arguments), this.example = "EVEN(3.1)", this.description = Ce, this.defs = [
632
+ super(...arguments), this.example = "EVEN(3.1)", this.description = Ie, this.defs = [
633
633
  { name: "value", description: "The value to round up to the nearest even integer.", acceptedTypes: ["number"] }
634
634
  ], this.category = "math";
635
635
  }
@@ -641,10 +641,10 @@ class Ie extends o {
641
641
  return n % 2 !== 0 && n++, t * n;
642
642
  }
643
643
  }
644
- const ke = "Returns -1 if the value is negative, 1 if positive, and 0 if zero.";
645
- class De extends o {
644
+ const De = "Returns -1 if the value is negative, 1 if positive, and 0 if zero.";
645
+ class Oe extends o {
646
646
  constructor() {
647
- super(...arguments), this.example = "SIGN(-3)", this.description = ke, this.defs = [
647
+ super(...arguments), this.example = "SIGN(-3)", this.description = De, this.defs = [
648
648
  { name: "value", description: "The number to check the sign of.", acceptedTypes: ["number"] }
649
649
  ], this.category = "math";
650
650
  }
@@ -652,10 +652,10 @@ class De extends o {
652
652
  return e > 0 ? 1 : e < 0 ? -1 : 0;
653
653
  }
654
654
  }
655
- const Oe = "Returns the sum of the squares of a series of numbers or cells.";
656
- class Le extends o {
655
+ const Le = "Returns the sum of the squares of a series of numbers or cells.";
656
+ class Pe extends o {
657
657
  constructor() {
658
- super(...arguments), this.example = "SUMSQ(A1:A10, 3)", this.description = Oe, this.defs = [
658
+ super(...arguments), this.example = "SUMSQ(A1:A10, 3)", this.description = Le, this.defs = [
659
659
  {
660
660
  name: "value",
661
661
  description: "Numbers or ranges to square and sum.",
@@ -679,10 +679,10 @@ class Le extends o {
679
679
  return t;
680
680
  }
681
681
  }
682
- const Pe = "Truncates a number to a certain number of significant digits by omitting less significant digits.";
683
- class Ve extends o {
682
+ const Ve = "Truncates a number to a certain number of significant digits by omitting less significant digits.";
683
+ class Be extends o {
684
684
  constructor() {
685
- super(...arguments), this.example = "TRUNC(3.14159, 2)", this.description = Pe, this.defs = [
685
+ super(...arguments), this.example = "TRUNC(3.14159, 2)", this.description = Ve, this.defs = [
686
686
  { name: "value", description: "The number to truncate.", acceptedTypes: ["number"] },
687
687
  {
688
688
  name: "places",
@@ -697,10 +697,10 @@ class Ve extends o {
697
697
  return (e >= 0 ? Math.floor : Math.ceil)(e * r) / r;
698
698
  }
699
699
  }
700
- const Be = "Converts a number into a text representation in another base, e.g. base 2 for binary.";
701
- class _e extends o {
700
+ const _e = "Converts a number into a text representation in another base, e.g. base 2 for binary.";
701
+ class ze extends o {
702
702
  constructor() {
703
- super(...arguments), this.example = "BASE(255, 16)", this.description = Be, this.defs = [
703
+ super(...arguments), this.example = "BASE(255, 16)", this.description = _e, this.defs = [
704
704
  { name: "value", description: "A non-negative integer to convert.", acceptedTypes: ["number"] },
705
705
  { name: "base", description: "The base (radix) to convert into, between 2 and 36.", acceptedTypes: ["number"] },
706
706
  {
@@ -727,11 +727,11 @@ class _e extends o {
727
727
  return n != null && r.length < n ? r.padStart(n, "0") : r;
728
728
  }
729
729
  }
730
- const ze = `Generates a sequence of numbers in a 2D array.
730
+ const je = `Generates a sequence of numbers in a 2D array.
731
731
  Returns a rows × cols array starting at start, incrementing by step.`;
732
- class je extends o {
732
+ class Ge extends o {
733
733
  constructor() {
734
- super(...arguments), this.autoSpilling = !0, this.example = "SEQUENCE(4, 3, 1, 1)", this.description = ze, this.defs = [
734
+ super(...arguments), this.autoSpilling = !0, this.example = "SEQUENCE(4, 3, 1, 1)", this.description = je, this.defs = [
735
735
  {
736
736
  name: "rows",
737
737
  description: "The number of rows to return.",
@@ -802,11 +802,11 @@ class g extends o {
802
802
  throw new u("#VALUE!", `${t} requires a square matrix.`);
803
803
  }
804
804
  }
805
- const Ge = `Returns the matrix product of two matrices.
805
+ const Qe = `Returns the matrix product of two matrices.
806
806
  The number of columns in matrix1 must equal the number of rows in matrix2.`;
807
- class Qe extends g {
807
+ class Xe extends g {
808
808
  constructor() {
809
- super(...arguments), this.autoSpilling = !0, this.example = "MMULT(A1:B2, C1:D2)", this.description = Ge, this.defs = [
809
+ super(...arguments), this.autoSpilling = !0, this.example = "MMULT(A1:B2, C1:D2)", this.description = Qe, this.defs = [
810
810
  { name: "matrix1", description: "First matrix.", takesMatrix: !0, acceptedTypes: ["matrix"] },
811
811
  { name: "matrix2", description: "Second matrix.", takesMatrix: !0, acceptedTypes: ["matrix"] }
812
812
  ];
@@ -836,11 +836,11 @@ class Qe extends g {
836
836
  return a;
837
837
  }
838
838
  }
839
- const Xe = `Returns the transpose of a matrix.
839
+ const We = `Returns the transpose of a matrix.
840
840
  Rows and columns of the input array are swapped.`;
841
- class We extends g {
841
+ class Ye extends g {
842
842
  constructor() {
843
- super(...arguments), this.autoSpilling = !0, this.example = "TRANSPOSE(A1:C3)", this.description = Xe, this.defs = [
843
+ super(...arguments), this.autoSpilling = !0, this.example = "TRANSPOSE(A1:C3)", this.description = We, this.defs = [
844
844
  { name: "matrix", description: "The matrix to transpose.", takesMatrix: !0, acceptedTypes: ["matrix"] }
845
845
  ];
846
846
  }
@@ -859,11 +859,11 @@ class We extends g {
859
859
  return r;
860
860
  }
861
861
  }
862
- const Ye = `Returns the inverse of a square matrix.
862
+ const He = `Returns the inverse of a square matrix.
863
863
  The matrix must be square and non-singular (determinant ≠ 0).`;
864
- class He extends g {
864
+ class Je extends g {
865
865
  constructor() {
866
- super(...arguments), this.autoSpilling = !0, this.example = "MINVERSE(A1:C3)", this.description = Ye, this.defs = [
866
+ super(...arguments), this.autoSpilling = !0, this.example = "MINVERSE(A1:C3)", this.description = He, this.defs = [
867
867
  { name: "matrix", description: "A square numeric matrix.", takesMatrix: !0, acceptedTypes: ["matrix"] }
868
868
  ];
869
869
  }
@@ -903,10 +903,10 @@ class He extends g {
903
903
  return n.map((r) => r.slice(t));
904
904
  }
905
905
  }
906
- const Je = "Returns the determinant of a square matrix.";
907
- class Ke extends g {
906
+ const Ke = "Returns the determinant of a square matrix.";
907
+ class Ze extends g {
908
908
  constructor() {
909
- super(...arguments), this.example = "MDETERM(A1:C3)", this.description = Je, this.defs = [
909
+ super(...arguments), this.example = "MDETERM(A1:C3)", this.description = Ke, this.defs = [
910
910
  { name: "matrix", description: "A square numeric matrix.", takesMatrix: !0, acceptedTypes: ["matrix"] }
911
911
  ];
912
912
  }
@@ -938,11 +938,11 @@ class Ke extends g {
938
938
  return r;
939
939
  }
940
940
  }
941
- const Ze = `Returns the sum of the products of corresponding array elements.
941
+ const et = `Returns the sum of the products of corresponding array elements.
942
942
  All arrays must have the same dimensions.`;
943
- class et extends g {
943
+ class tt extends g {
944
944
  constructor() {
945
- super(...arguments), this.example = "SUMPRODUCT(A1:A3, B1:B3)", this.description = Ze, this.defs = [
945
+ super(...arguments), this.example = "SUMPRODUCT(A1:A3, B1:B3)", this.description = et, this.defs = [
946
946
  { name: "array1", description: "First array.", takesMatrix: !0, acceptedTypes: ["matrix"] },
947
947
  { name: "array2", description: "Additional arrays.", takesMatrix: !0, acceptedTypes: ["matrix"], variadic: !0 }
948
948
  ];
@@ -969,53 +969,53 @@ class et extends g {
969
969
  return r;
970
970
  }
971
971
  }
972
- const nt = {
973
- mod: T,
974
- sqrt: R,
975
- product: F,
976
- round: U,
977
- rounddown: $,
978
- roundup: C,
979
- log: k,
980
- log10: O,
981
- ln: P,
982
- exp: B,
983
- pi: z,
984
- radians: G,
985
- sin: X,
986
- cos: Y,
987
- tan: J,
988
- asin: Z,
989
- acos: te,
990
- atan: se,
991
- atan2: ie,
992
- rand: oe,
993
- unary_percent: ue,
994
- uplus: de,
995
- sumif: pe,
996
- sumifs: fe,
997
- countif: xe,
998
- countifs: we,
999
- fact: Me,
1000
- int: Te,
1001
- iseven: Re,
1002
- isodd: Fe,
1003
- lcm: Ee,
1004
- odd: qe,
1005
- even: Ie,
1006
- sign: De,
1007
- sumsq: Le,
1008
- trunc: Ve,
1009
- base: _e,
1010
- sequence: je,
1011
- mmult: Qe,
1012
- transpose: We,
1013
- minverse: He,
1014
- mdeterm: Ke,
1015
- sumproduct: et
972
+ const st = {
973
+ mod: A,
974
+ sqrt: N,
975
+ product: S,
976
+ round: E,
977
+ rounddown: q,
978
+ roundup: I,
979
+ log: D,
980
+ log10: L,
981
+ ln: V,
982
+ exp: _,
983
+ pi: j,
984
+ radians: Q,
985
+ sin: W,
986
+ cos: H,
987
+ tan: K,
988
+ asin: ee,
989
+ acos: ne,
990
+ atan: re,
991
+ atan2: ae,
992
+ rand: ce,
993
+ unary_percent: me,
994
+ uplus: he,
995
+ sumif: le,
996
+ sumifs: ge,
997
+ countif: be,
998
+ countifs: ye,
999
+ fact: ve,
1000
+ int: Ae,
1001
+ iseven: Ne,
1002
+ isodd: Se,
1003
+ lcm: $e,
1004
+ odd: Ce,
1005
+ even: ke,
1006
+ sign: Oe,
1007
+ sumsq: Pe,
1008
+ trunc: Be,
1009
+ base: ze,
1010
+ sequence: Ge,
1011
+ mmult: Xe,
1012
+ transpose: Ye,
1013
+ minverse: Je,
1014
+ mdeterm: Ze,
1015
+ sumproduct: tt
1016
1016
  };
1017
1017
  export {
1018
- nt as default,
1019
- nt as mathFunctions
1018
+ st as default,
1019
+ st as mathFunctions
1020
1020
  };
1021
1021
  //# sourceMappingURL=index.js.map