@gridsheet/functions 3.0.0-rc.10

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.
Files changed (439) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +75 -0
  3. package/dist/functions/src/index.d.ts +7 -0
  4. package/dist/functions/src/index.d.ts.map +1 -0
  5. package/dist/functions/src/information/index.d.ts +4 -0
  6. package/dist/functions/src/information/index.d.ts.map +1 -0
  7. package/dist/functions/src/information/isblank.d.ts +9 -0
  8. package/dist/functions/src/information/isblank.d.ts.map +1 -0
  9. package/dist/functions/src/information/isblank.spec.d.ts +2 -0
  10. package/dist/functions/src/information/isblank.spec.d.ts.map +1 -0
  11. package/dist/functions/src/information/isdate.d.ts +9 -0
  12. package/dist/functions/src/information/isdate.d.ts.map +1 -0
  13. package/dist/functions/src/information/isdate.spec.d.ts +2 -0
  14. package/dist/functions/src/information/isdate.spec.d.ts.map +1 -0
  15. package/dist/functions/src/information/isemail.d.ts +9 -0
  16. package/dist/functions/src/information/isemail.d.ts.map +1 -0
  17. package/dist/functions/src/information/isemail.spec.d.ts +2 -0
  18. package/dist/functions/src/information/isemail.spec.d.ts.map +1 -0
  19. package/dist/functions/src/information/iserr.d.ts +9 -0
  20. package/dist/functions/src/information/iserr.d.ts.map +1 -0
  21. package/dist/functions/src/information/iserr.spec.d.ts +2 -0
  22. package/dist/functions/src/information/iserr.spec.d.ts.map +1 -0
  23. package/dist/functions/src/information/iserror.d.ts +9 -0
  24. package/dist/functions/src/information/iserror.d.ts.map +1 -0
  25. package/dist/functions/src/information/iserror.spec.d.ts +2 -0
  26. package/dist/functions/src/information/iserror.spec.d.ts.map +1 -0
  27. package/dist/functions/src/information/isformula.d.ts +9 -0
  28. package/dist/functions/src/information/isformula.d.ts.map +1 -0
  29. package/dist/functions/src/information/isformula.spec.d.ts +2 -0
  30. package/dist/functions/src/information/isformula.spec.d.ts.map +1 -0
  31. package/dist/functions/src/information/islogical.d.ts +9 -0
  32. package/dist/functions/src/information/islogical.d.ts.map +1 -0
  33. package/dist/functions/src/information/islogical.spec.d.ts +2 -0
  34. package/dist/functions/src/information/islogical.spec.d.ts.map +1 -0
  35. package/dist/functions/src/information/isna.d.ts +9 -0
  36. package/dist/functions/src/information/isna.d.ts.map +1 -0
  37. package/dist/functions/src/information/isna.spec.d.ts +2 -0
  38. package/dist/functions/src/information/isna.spec.d.ts.map +1 -0
  39. package/dist/functions/src/information/isnontext.d.ts +9 -0
  40. package/dist/functions/src/information/isnontext.d.ts.map +1 -0
  41. package/dist/functions/src/information/isnontext.spec.d.ts +2 -0
  42. package/dist/functions/src/information/isnontext.spec.d.ts.map +1 -0
  43. package/dist/functions/src/information/isref.d.ts +9 -0
  44. package/dist/functions/src/information/isref.d.ts.map +1 -0
  45. package/dist/functions/src/information/isref.spec.d.ts +2 -0
  46. package/dist/functions/src/information/isref.spec.d.ts.map +1 -0
  47. package/dist/functions/src/information/istext.d.ts +9 -0
  48. package/dist/functions/src/information/istext.d.ts.map +1 -0
  49. package/dist/functions/src/information/istext.spec.d.ts +2 -0
  50. package/dist/functions/src/information/istext.spec.d.ts.map +1 -0
  51. package/dist/functions/src/information/n.d.ts +9 -0
  52. package/dist/functions/src/information/n.d.ts.map +1 -0
  53. package/dist/functions/src/information/n.spec.d.ts +2 -0
  54. package/dist/functions/src/information/n.spec.d.ts.map +1 -0
  55. package/dist/functions/src/information/na.d.ts +9 -0
  56. package/dist/functions/src/information/na.d.ts.map +1 -0
  57. package/dist/functions/src/information/na.spec.d.ts +2 -0
  58. package/dist/functions/src/information/na.spec.d.ts.map +1 -0
  59. package/dist/functions/src/information/sheets.d.ts +9 -0
  60. package/dist/functions/src/information/sheets.d.ts.map +1 -0
  61. package/dist/functions/src/information/sheets.spec.d.ts +2 -0
  62. package/dist/functions/src/information/sheets.spec.d.ts.map +1 -0
  63. package/dist/functions/src/logical/ifna.d.ts +10 -0
  64. package/dist/functions/src/logical/ifna.d.ts.map +1 -0
  65. package/dist/functions/src/logical/ifs.d.ts +10 -0
  66. package/dist/functions/src/logical/ifs.d.ts.map +1 -0
  67. package/dist/functions/src/logical/index.d.ts +4 -0
  68. package/dist/functions/src/logical/index.d.ts.map +1 -0
  69. package/dist/functions/src/logical/xor.d.ts +9 -0
  70. package/dist/functions/src/logical/xor.d.ts.map +1 -0
  71. package/dist/functions/src/lookup/column.d.ts +12 -0
  72. package/dist/functions/src/lookup/column.d.ts.map +1 -0
  73. package/dist/functions/src/lookup/column.spec.d.ts +2 -0
  74. package/dist/functions/src/lookup/column.spec.d.ts.map +1 -0
  75. package/dist/functions/src/lookup/columns.d.ts +9 -0
  76. package/dist/functions/src/lookup/columns.d.ts.map +1 -0
  77. package/dist/functions/src/lookup/columns.spec.d.ts +2 -0
  78. package/dist/functions/src/lookup/columns.spec.d.ts.map +1 -0
  79. package/dist/functions/src/lookup/hlookup.d.ts +9 -0
  80. package/dist/functions/src/lookup/hlookup.d.ts.map +1 -0
  81. package/dist/functions/src/lookup/hlookup.spec.d.ts +2 -0
  82. package/dist/functions/src/lookup/hlookup.spec.d.ts.map +1 -0
  83. package/dist/functions/src/lookup/index.d.ts +4 -0
  84. package/dist/functions/src/lookup/index.d.ts.map +1 -0
  85. package/dist/functions/src/lookup/indexFn.d.ts +10 -0
  86. package/dist/functions/src/lookup/indexFn.d.ts.map +1 -0
  87. package/dist/functions/src/lookup/indexFn.spec.d.ts +2 -0
  88. package/dist/functions/src/lookup/indexFn.spec.d.ts.map +1 -0
  89. package/dist/functions/src/lookup/match.d.ts +10 -0
  90. package/dist/functions/src/lookup/match.d.ts.map +1 -0
  91. package/dist/functions/src/lookup/match.spec.d.ts +2 -0
  92. package/dist/functions/src/lookup/match.spec.d.ts.map +1 -0
  93. package/dist/functions/src/lookup/row.d.ts +12 -0
  94. package/dist/functions/src/lookup/row.d.ts.map +1 -0
  95. package/dist/functions/src/lookup/row.spec.d.ts +2 -0
  96. package/dist/functions/src/lookup/row.spec.d.ts.map +1 -0
  97. package/dist/functions/src/lookup/rows.d.ts +9 -0
  98. package/dist/functions/src/lookup/rows.d.ts.map +1 -0
  99. package/dist/functions/src/lookup/rows.spec.d.ts +2 -0
  100. package/dist/functions/src/lookup/rows.spec.d.ts.map +1 -0
  101. package/dist/functions/src/lookup/sheet.d.ts +9 -0
  102. package/dist/functions/src/lookup/sheet.d.ts.map +1 -0
  103. package/dist/functions/src/lookup/sheet.spec.d.ts +2 -0
  104. package/dist/functions/src/lookup/sheet.spec.d.ts.map +1 -0
  105. package/dist/functions/src/lookup/vlookup.d.ts +9 -0
  106. package/dist/functions/src/lookup/vlookup.d.ts.map +1 -0
  107. package/dist/functions/src/lookup/vlookup.spec.d.ts +2 -0
  108. package/dist/functions/src/lookup/vlookup.spec.d.ts.map +1 -0
  109. package/dist/functions/src/math/__matrix_base.d.ts +15 -0
  110. package/dist/functions/src/math/__matrix_base.d.ts.map +1 -0
  111. package/dist/functions/src/math/acos.d.ts +9 -0
  112. package/dist/functions/src/math/acos.d.ts.map +1 -0
  113. package/dist/functions/src/math/acos.spec.d.ts +2 -0
  114. package/dist/functions/src/math/acos.spec.d.ts.map +1 -0
  115. package/dist/functions/src/math/asin.d.ts +9 -0
  116. package/dist/functions/src/math/asin.d.ts.map +1 -0
  117. package/dist/functions/src/math/asin.spec.d.ts +2 -0
  118. package/dist/functions/src/math/asin.spec.d.ts.map +1 -0
  119. package/dist/functions/src/math/atan.d.ts +9 -0
  120. package/dist/functions/src/math/atan.d.ts.map +1 -0
  121. package/dist/functions/src/math/atan.spec.d.ts +2 -0
  122. package/dist/functions/src/math/atan.spec.d.ts.map +1 -0
  123. package/dist/functions/src/math/atan2.d.ts +9 -0
  124. package/dist/functions/src/math/atan2.d.ts.map +1 -0
  125. package/dist/functions/src/math/atan2.spec.d.ts +2 -0
  126. package/dist/functions/src/math/atan2.spec.d.ts.map +1 -0
  127. package/dist/functions/src/math/base.d.ts +10 -0
  128. package/dist/functions/src/math/base.d.ts.map +1 -0
  129. package/dist/functions/src/math/base.spec.d.ts +2 -0
  130. package/dist/functions/src/math/base.spec.d.ts.map +1 -0
  131. package/dist/functions/src/math/cos.d.ts +9 -0
  132. package/dist/functions/src/math/cos.d.ts.map +1 -0
  133. package/dist/functions/src/math/cos.spec.d.ts +2 -0
  134. package/dist/functions/src/math/cos.spec.d.ts.map +1 -0
  135. package/dist/functions/src/math/countif.d.ts +9 -0
  136. package/dist/functions/src/math/countif.d.ts.map +1 -0
  137. package/dist/functions/src/math/countif.spec.d.ts +2 -0
  138. package/dist/functions/src/math/countif.spec.d.ts.map +1 -0
  139. package/dist/functions/src/math/countifs.d.ts +10 -0
  140. package/dist/functions/src/math/countifs.d.ts.map +1 -0
  141. package/dist/functions/src/math/countifs.spec.d.ts +2 -0
  142. package/dist/functions/src/math/countifs.spec.d.ts.map +1 -0
  143. package/dist/functions/src/math/even.d.ts +9 -0
  144. package/dist/functions/src/math/even.d.ts.map +1 -0
  145. package/dist/functions/src/math/even.spec.d.ts +2 -0
  146. package/dist/functions/src/math/even.spec.d.ts.map +1 -0
  147. package/dist/functions/src/math/exp.d.ts +10 -0
  148. package/dist/functions/src/math/exp.d.ts.map +1 -0
  149. package/dist/functions/src/math/exp.spec.d.ts +2 -0
  150. package/dist/functions/src/math/exp.spec.d.ts.map +1 -0
  151. package/dist/functions/src/math/fact.d.ts +9 -0
  152. package/dist/functions/src/math/fact.d.ts.map +1 -0
  153. package/dist/functions/src/math/fact.spec.d.ts +2 -0
  154. package/dist/functions/src/math/fact.spec.d.ts.map +1 -0
  155. package/dist/functions/src/math/index.d.ts +4 -0
  156. package/dist/functions/src/math/index.d.ts.map +1 -0
  157. package/dist/functions/src/math/int.d.ts +9 -0
  158. package/dist/functions/src/math/int.d.ts.map +1 -0
  159. package/dist/functions/src/math/int.spec.d.ts +2 -0
  160. package/dist/functions/src/math/int.spec.d.ts.map +1 -0
  161. package/dist/functions/src/math/iseven.d.ts +9 -0
  162. package/dist/functions/src/math/iseven.d.ts.map +1 -0
  163. package/dist/functions/src/math/iseven.spec.d.ts +2 -0
  164. package/dist/functions/src/math/iseven.spec.d.ts.map +1 -0
  165. package/dist/functions/src/math/isodd.d.ts +9 -0
  166. package/dist/functions/src/math/isodd.d.ts.map +1 -0
  167. package/dist/functions/src/math/isodd.spec.d.ts +2 -0
  168. package/dist/functions/src/math/isodd.spec.d.ts.map +1 -0
  169. package/dist/functions/src/math/lcm.d.ts +10 -0
  170. package/dist/functions/src/math/lcm.d.ts.map +1 -0
  171. package/dist/functions/src/math/lcm.spec.d.ts +2 -0
  172. package/dist/functions/src/math/lcm.spec.d.ts.map +1 -0
  173. package/dist/functions/src/math/ln.d.ts +9 -0
  174. package/dist/functions/src/math/ln.d.ts.map +1 -0
  175. package/dist/functions/src/math/ln.spec.d.ts +2 -0
  176. package/dist/functions/src/math/ln.spec.d.ts.map +1 -0
  177. package/dist/functions/src/math/log.d.ts +10 -0
  178. package/dist/functions/src/math/log.d.ts.map +1 -0
  179. package/dist/functions/src/math/log.spec.d.ts +2 -0
  180. package/dist/functions/src/math/log.spec.d.ts.map +1 -0
  181. package/dist/functions/src/math/log10.d.ts +9 -0
  182. package/dist/functions/src/math/log10.d.ts.map +1 -0
  183. package/dist/functions/src/math/log10.spec.d.ts +2 -0
  184. package/dist/functions/src/math/log10.spec.d.ts.map +1 -0
  185. package/dist/functions/src/math/mdeterm.d.ts +11 -0
  186. package/dist/functions/src/math/mdeterm.d.ts.map +1 -0
  187. package/dist/functions/src/math/minverse.d.ts +12 -0
  188. package/dist/functions/src/math/minverse.d.ts.map +1 -0
  189. package/dist/functions/src/math/mmult.d.ts +11 -0
  190. package/dist/functions/src/math/mmult.d.ts.map +1 -0
  191. package/dist/functions/src/math/mod.d.ts +10 -0
  192. package/dist/functions/src/math/mod.d.ts.map +1 -0
  193. package/dist/functions/src/math/mod.spec.d.ts +2 -0
  194. package/dist/functions/src/math/mod.spec.d.ts.map +1 -0
  195. package/dist/functions/src/math/odd.d.ts +9 -0
  196. package/dist/functions/src/math/odd.d.ts.map +1 -0
  197. package/dist/functions/src/math/odd.spec.d.ts +2 -0
  198. package/dist/functions/src/math/odd.spec.d.ts.map +1 -0
  199. package/dist/functions/src/math/pi.d.ts +9 -0
  200. package/dist/functions/src/math/pi.d.ts.map +1 -0
  201. package/dist/functions/src/math/pi.spec.d.ts +2 -0
  202. package/dist/functions/src/math/pi.spec.d.ts.map +1 -0
  203. package/dist/functions/src/math/product.d.ts +9 -0
  204. package/dist/functions/src/math/product.d.ts.map +1 -0
  205. package/dist/functions/src/math/product.spec.d.ts +2 -0
  206. package/dist/functions/src/math/product.spec.d.ts.map +1 -0
  207. package/dist/functions/src/math/radians.d.ts +9 -0
  208. package/dist/functions/src/math/radians.d.ts.map +1 -0
  209. package/dist/functions/src/math/radians.spec.d.ts +2 -0
  210. package/dist/functions/src/math/radians.spec.d.ts.map +1 -0
  211. package/dist/functions/src/math/rand.d.ts +9 -0
  212. package/dist/functions/src/math/rand.d.ts.map +1 -0
  213. package/dist/functions/src/math/rand.spec.d.ts +2 -0
  214. package/dist/functions/src/math/rand.spec.d.ts.map +1 -0
  215. package/dist/functions/src/math/round.d.ts +9 -0
  216. package/dist/functions/src/math/round.d.ts.map +1 -0
  217. package/dist/functions/src/math/round.spec.d.ts +2 -0
  218. package/dist/functions/src/math/round.spec.d.ts.map +1 -0
  219. package/dist/functions/src/math/rounddown.d.ts +9 -0
  220. package/dist/functions/src/math/rounddown.d.ts.map +1 -0
  221. package/dist/functions/src/math/rounddown.spec.d.ts +2 -0
  222. package/dist/functions/src/math/rounddown.spec.d.ts.map +1 -0
  223. package/dist/functions/src/math/roundup.d.ts +9 -0
  224. package/dist/functions/src/math/roundup.d.ts.map +1 -0
  225. package/dist/functions/src/math/roundup.spec.d.ts +2 -0
  226. package/dist/functions/src/math/roundup.spec.d.ts.map +1 -0
  227. package/dist/functions/src/math/sequence.d.ts +11 -0
  228. package/dist/functions/src/math/sequence.d.ts.map +1 -0
  229. package/dist/functions/src/math/sequence.spec.d.ts +2 -0
  230. package/dist/functions/src/math/sequence.spec.d.ts.map +1 -0
  231. package/dist/functions/src/math/sign.d.ts +9 -0
  232. package/dist/functions/src/math/sign.d.ts.map +1 -0
  233. package/dist/functions/src/math/sign.spec.d.ts +2 -0
  234. package/dist/functions/src/math/sign.spec.d.ts.map +1 -0
  235. package/dist/functions/src/math/sin.d.ts +9 -0
  236. package/dist/functions/src/math/sin.d.ts.map +1 -0
  237. package/dist/functions/src/math/sin.spec.d.ts +2 -0
  238. package/dist/functions/src/math/sin.spec.d.ts.map +1 -0
  239. package/dist/functions/src/math/sqrt.d.ts +9 -0
  240. package/dist/functions/src/math/sqrt.d.ts.map +1 -0
  241. package/dist/functions/src/math/sqrt.spec.d.ts +2 -0
  242. package/dist/functions/src/math/sqrt.spec.d.ts.map +1 -0
  243. package/dist/functions/src/math/sumif.d.ts +9 -0
  244. package/dist/functions/src/math/sumif.d.ts.map +1 -0
  245. package/dist/functions/src/math/sumifs.d.ts +10 -0
  246. package/dist/functions/src/math/sumifs.d.ts.map +1 -0
  247. package/dist/functions/src/math/sumifs.spec.d.ts +2 -0
  248. package/dist/functions/src/math/sumifs.spec.d.ts.map +1 -0
  249. package/dist/functions/src/math/sumproduct.d.ts +10 -0
  250. package/dist/functions/src/math/sumproduct.d.ts.map +1 -0
  251. package/dist/functions/src/math/sumsq.d.ts +9 -0
  252. package/dist/functions/src/math/sumsq.d.ts.map +1 -0
  253. package/dist/functions/src/math/sumsq.spec.d.ts +2 -0
  254. package/dist/functions/src/math/sumsq.spec.d.ts.map +1 -0
  255. package/dist/functions/src/math/tan.d.ts +9 -0
  256. package/dist/functions/src/math/tan.d.ts.map +1 -0
  257. package/dist/functions/src/math/tan.spec.d.ts +2 -0
  258. package/dist/functions/src/math/tan.spec.d.ts.map +1 -0
  259. package/dist/functions/src/math/transpose.d.ts +11 -0
  260. package/dist/functions/src/math/transpose.d.ts.map +1 -0
  261. package/dist/functions/src/math/trunc.d.ts +9 -0
  262. package/dist/functions/src/math/trunc.d.ts.map +1 -0
  263. package/dist/functions/src/math/trunc.spec.d.ts +2 -0
  264. package/dist/functions/src/math/trunc.spec.d.ts.map +1 -0
  265. package/dist/functions/src/math/unaryPercent.d.ts +9 -0
  266. package/dist/functions/src/math/unaryPercent.d.ts.map +1 -0
  267. package/dist/functions/src/math/unaryPercent.spec.d.ts +2 -0
  268. package/dist/functions/src/math/unaryPercent.spec.d.ts.map +1 -0
  269. package/dist/functions/src/math/uplus.d.ts +9 -0
  270. package/dist/functions/src/math/uplus.d.ts.map +1 -0
  271. package/dist/functions/src/math/uplus.spec.d.ts +2 -0
  272. package/dist/functions/src/math/uplus.spec.d.ts.map +1 -0
  273. package/dist/functions/src/statistics/averageif.d.ts +9 -0
  274. package/dist/functions/src/statistics/averageif.d.ts.map +1 -0
  275. package/dist/functions/src/statistics/averageifs.d.ts +10 -0
  276. package/dist/functions/src/statistics/averageifs.d.ts.map +1 -0
  277. package/dist/functions/src/statistics/averageifs.spec.d.ts +2 -0
  278. package/dist/functions/src/statistics/averageifs.spec.d.ts.map +1 -0
  279. package/dist/functions/src/statistics/correl.d.ts +10 -0
  280. package/dist/functions/src/statistics/correl.d.ts.map +1 -0
  281. package/dist/functions/src/statistics/correl.spec.d.ts +2 -0
  282. package/dist/functions/src/statistics/correl.spec.d.ts.map +1 -0
  283. package/dist/functions/src/statistics/covariance_p.d.ts +10 -0
  284. package/dist/functions/src/statistics/covariance_p.d.ts.map +1 -0
  285. package/dist/functions/src/statistics/covariance_p.spec.d.ts +2 -0
  286. package/dist/functions/src/statistics/covariance_p.spec.d.ts.map +1 -0
  287. package/dist/functions/src/statistics/covariance_s.d.ts +10 -0
  288. package/dist/functions/src/statistics/covariance_s.d.ts.map +1 -0
  289. package/dist/functions/src/statistics/covariance_s.spec.d.ts +2 -0
  290. package/dist/functions/src/statistics/covariance_s.spec.d.ts.map +1 -0
  291. package/dist/functions/src/statistics/index.d.ts +4 -0
  292. package/dist/functions/src/statistics/index.d.ts.map +1 -0
  293. package/dist/functions/src/statistics/median.d.ts +10 -0
  294. package/dist/functions/src/statistics/median.d.ts.map +1 -0
  295. package/dist/functions/src/statistics/median.spec.d.ts +2 -0
  296. package/dist/functions/src/statistics/median.spec.d.ts.map +1 -0
  297. package/dist/functions/src/statistics/mode_sngl.d.ts +10 -0
  298. package/dist/functions/src/statistics/mode_sngl.d.ts.map +1 -0
  299. package/dist/functions/src/statistics/mode_sngl.spec.d.ts +2 -0
  300. package/dist/functions/src/statistics/mode_sngl.spec.d.ts.map +1 -0
  301. package/dist/functions/src/statistics/percentile_inc.d.ts +10 -0
  302. package/dist/functions/src/statistics/percentile_inc.d.ts.map +1 -0
  303. package/dist/functions/src/statistics/percentile_inc.spec.d.ts +2 -0
  304. package/dist/functions/src/statistics/percentile_inc.spec.d.ts.map +1 -0
  305. package/dist/functions/src/statistics/quartile_inc.d.ts +10 -0
  306. package/dist/functions/src/statistics/quartile_inc.d.ts.map +1 -0
  307. package/dist/functions/src/statistics/quartile_inc.spec.d.ts +2 -0
  308. package/dist/functions/src/statistics/quartile_inc.spec.d.ts.map +1 -0
  309. package/dist/functions/src/statistics/rank_eq.d.ts +10 -0
  310. package/dist/functions/src/statistics/rank_eq.d.ts.map +1 -0
  311. package/dist/functions/src/statistics/rank_eq.spec.d.ts +2 -0
  312. package/dist/functions/src/statistics/rank_eq.spec.d.ts.map +1 -0
  313. package/dist/functions/src/statistics/rsq.d.ts +10 -0
  314. package/dist/functions/src/statistics/rsq.d.ts.map +1 -0
  315. package/dist/functions/src/statistics/rsq.spec.d.ts +2 -0
  316. package/dist/functions/src/statistics/rsq.spec.d.ts.map +1 -0
  317. package/dist/functions/src/statistics/stdev_p.d.ts +10 -0
  318. package/dist/functions/src/statistics/stdev_p.d.ts.map +1 -0
  319. package/dist/functions/src/statistics/stdev_p.spec.d.ts +2 -0
  320. package/dist/functions/src/statistics/stdev_p.spec.d.ts.map +1 -0
  321. package/dist/functions/src/statistics/stdev_s.d.ts +10 -0
  322. package/dist/functions/src/statistics/stdev_s.d.ts.map +1 -0
  323. package/dist/functions/src/statistics/stdev_s.spec.d.ts +2 -0
  324. package/dist/functions/src/statistics/stdev_s.spec.d.ts.map +1 -0
  325. package/dist/functions/src/statistics/t_test.d.ts +10 -0
  326. package/dist/functions/src/statistics/t_test.d.ts.map +1 -0
  327. package/dist/functions/src/statistics/t_test.spec.d.ts +2 -0
  328. package/dist/functions/src/statistics/t_test.spec.d.ts.map +1 -0
  329. package/dist/functions/src/statistics/var_p.d.ts +10 -0
  330. package/dist/functions/src/statistics/var_p.d.ts.map +1 -0
  331. package/dist/functions/src/statistics/var_p.spec.d.ts +2 -0
  332. package/dist/functions/src/statistics/var_p.spec.d.ts.map +1 -0
  333. package/dist/functions/src/statistics/var_s.d.ts +10 -0
  334. package/dist/functions/src/statistics/var_s.d.ts.map +1 -0
  335. package/dist/functions/src/statistics/var_s.spec.d.ts +2 -0
  336. package/dist/functions/src/statistics/var_s.spec.d.ts.map +1 -0
  337. package/dist/functions/src/text/char.d.ts +9 -0
  338. package/dist/functions/src/text/char.d.ts.map +1 -0
  339. package/dist/functions/src/text/char.spec.d.ts +2 -0
  340. package/dist/functions/src/text/char.spec.d.ts.map +1 -0
  341. package/dist/functions/src/text/clean.d.ts +9 -0
  342. package/dist/functions/src/text/clean.d.ts.map +1 -0
  343. package/dist/functions/src/text/clean.spec.d.ts +2 -0
  344. package/dist/functions/src/text/clean.spec.d.ts.map +1 -0
  345. package/dist/functions/src/text/concatenate.d.ts +9 -0
  346. package/dist/functions/src/text/concatenate.d.ts.map +1 -0
  347. package/dist/functions/src/text/concatenate.spec.d.ts +2 -0
  348. package/dist/functions/src/text/concatenate.spec.d.ts.map +1 -0
  349. package/dist/functions/src/text/exact.d.ts +9 -0
  350. package/dist/functions/src/text/exact.d.ts.map +1 -0
  351. package/dist/functions/src/text/exact.spec.d.ts +2 -0
  352. package/dist/functions/src/text/exact.spec.d.ts.map +1 -0
  353. package/dist/functions/src/text/index.d.ts +4 -0
  354. package/dist/functions/src/text/index.d.ts.map +1 -0
  355. package/dist/functions/src/text/join.d.ts +10 -0
  356. package/dist/functions/src/text/join.d.ts.map +1 -0
  357. package/dist/functions/src/text/join.spec.d.ts +2 -0
  358. package/dist/functions/src/text/join.spec.d.ts.map +1 -0
  359. package/dist/functions/src/text/lenb.d.ts +9 -0
  360. package/dist/functions/src/text/lenb.d.ts.map +1 -0
  361. package/dist/functions/src/text/lenb.spec.d.ts +2 -0
  362. package/dist/functions/src/text/lenb.spec.d.ts.map +1 -0
  363. package/dist/functions/src/text/lower.d.ts +9 -0
  364. package/dist/functions/src/text/lower.d.ts.map +1 -0
  365. package/dist/functions/src/text/lower.spec.d.ts +2 -0
  366. package/dist/functions/src/text/lower.spec.d.ts.map +1 -0
  367. package/dist/functions/src/text/proper.d.ts +9 -0
  368. package/dist/functions/src/text/proper.d.ts.map +1 -0
  369. package/dist/functions/src/text/proper.spec.d.ts +2 -0
  370. package/dist/functions/src/text/proper.spec.d.ts.map +1 -0
  371. package/dist/functions/src/text/replace.d.ts +10 -0
  372. package/dist/functions/src/text/replace.d.ts.map +1 -0
  373. package/dist/functions/src/text/replace.spec.d.ts +2 -0
  374. package/dist/functions/src/text/replace.spec.d.ts.map +1 -0
  375. package/dist/functions/src/text/rept.d.ts +10 -0
  376. package/dist/functions/src/text/rept.d.ts.map +1 -0
  377. package/dist/functions/src/text/rept.spec.d.ts +2 -0
  378. package/dist/functions/src/text/rept.spec.d.ts.map +1 -0
  379. package/dist/functions/src/text/trim.d.ts +9 -0
  380. package/dist/functions/src/text/trim.d.ts.map +1 -0
  381. package/dist/functions/src/text/trim.spec.d.ts +2 -0
  382. package/dist/functions/src/text/trim.spec.d.ts.map +1 -0
  383. package/dist/functions/src/text/unichar.d.ts +9 -0
  384. package/dist/functions/src/text/unichar.d.ts.map +1 -0
  385. package/dist/functions/src/text/unichar.spec.d.ts +2 -0
  386. package/dist/functions/src/text/unichar.spec.d.ts.map +1 -0
  387. package/dist/functions/src/text/unicode.d.ts +9 -0
  388. package/dist/functions/src/text/unicode.d.ts.map +1 -0
  389. package/dist/functions/src/text/unicode.spec.d.ts +2 -0
  390. package/dist/functions/src/text/unicode.spec.d.ts.map +1 -0
  391. package/dist/functions/src/text/upper.d.ts +9 -0
  392. package/dist/functions/src/text/upper.d.ts.map +1 -0
  393. package/dist/functions/src/text/upper.spec.d.ts +2 -0
  394. package/dist/functions/src/text/upper.spec.d.ts.map +1 -0
  395. package/dist/functions/src/time/date.d.ts +9 -0
  396. package/dist/functions/src/time/date.d.ts.map +1 -0
  397. package/dist/functions/src/time/day.d.ts +9 -0
  398. package/dist/functions/src/time/day.d.ts.map +1 -0
  399. package/dist/functions/src/time/days.d.ts +9 -0
  400. package/dist/functions/src/time/days.d.ts.map +1 -0
  401. package/dist/functions/src/time/hour.d.ts +9 -0
  402. package/dist/functions/src/time/hour.d.ts.map +1 -0
  403. package/dist/functions/src/time/index.d.ts +4 -0
  404. package/dist/functions/src/time/index.d.ts.map +1 -0
  405. package/dist/functions/src/time/minute.d.ts +9 -0
  406. package/dist/functions/src/time/minute.d.ts.map +1 -0
  407. package/dist/functions/src/time/month.d.ts +9 -0
  408. package/dist/functions/src/time/month.d.ts.map +1 -0
  409. package/dist/functions/src/time/second.d.ts +9 -0
  410. package/dist/functions/src/time/second.d.ts.map +1 -0
  411. package/dist/functions/src/time/time.d.ts +9 -0
  412. package/dist/functions/src/time/time.d.ts.map +1 -0
  413. package/dist/functions/src/time/today.d.ts +9 -0
  414. package/dist/functions/src/time/today.d.ts.map +1 -0
  415. package/dist/functions/src/time/workday.d.ts +9 -0
  416. package/dist/functions/src/time/workday.d.ts.map +1 -0
  417. package/dist/functions/src/time/year.d.ts +9 -0
  418. package/dist/functions/src/time/year.d.ts.map +1 -0
  419. package/dist/functions/src/types.d.ts +2 -0
  420. package/dist/functions/src/types.d.ts.map +1 -0
  421. package/dist/index.d.ts +6 -0
  422. package/dist/index.js +321 -0
  423. package/dist/index.js.map +1 -0
  424. package/dist/lookup/index.d.ts +6 -0
  425. package/dist/lookup/index.js +360 -0
  426. package/dist/lookup/index.js.map +1 -0
  427. package/dist/math/index.d.ts +6 -0
  428. package/dist/math/index.js +1021 -0
  429. package/dist/math/index.js.map +1 -0
  430. package/dist/statistics/index.d.ts +6 -0
  431. package/dist/statistics/index.js +706 -0
  432. package/dist/statistics/index.js.map +1 -0
  433. package/dist/text/index.d.ts +6 -0
  434. package/dist/text/index.js +258 -0
  435. package/dist/text/index.js.map +1 -0
  436. package/dist/time/index.d.ts +6 -0
  437. package/dist/time/index.js +194 -0
  438. package/dist/time/index.js.map +1 -0
  439. package/package.json +85 -0
@@ -0,0 +1,1021 @@
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 {
4
+ constructor() {
5
+ super(...arguments), this.example = "MOD(10, 4)", this.description = v, this.defs = [
6
+ {
7
+ name: "dividend",
8
+ description: "A number that will be divided by divisor.",
9
+ acceptedTypes: ["number"]
10
+ },
11
+ { name: "divisor", description: "A number that will divide a dividend.", acceptedTypes: ["number"] }
12
+ ], this.category = "math";
13
+ }
14
+ validate(e) {
15
+ if (e.length !== 2)
16
+ throw new u("#N/A", "Number of arguments for MOD is incorrect.");
17
+ const t = e.map((n) => h(n));
18
+ if (t[1] === 0)
19
+ throw new u("#DIV/0!", "The second argument must be non-zero.");
20
+ return t;
21
+ }
22
+ main(e, t) {
23
+ return (e % t + t) % t;
24
+ }
25
+ }
26
+ const A = "Returns the positive square root of a positive number.";
27
+ class R extends o {
28
+ constructor() {
29
+ super(...arguments), this.example = "SQRT(9)", this.description = A, this.defs = [
30
+ {
31
+ name: "value",
32
+ description: "A number for which the positive square root is to be found.",
33
+ acceptedTypes: ["number"]
34
+ }
35
+ ], this.category = "math";
36
+ }
37
+ main(e) {
38
+ if (e < 0)
39
+ throw new u("NUM!", "First argument must be positive.");
40
+ return Math.sqrt(e);
41
+ }
42
+ }
43
+ const N = "Returns the product of a series of numbers.";
44
+ class F extends o {
45
+ constructor() {
46
+ super(...arguments), this.example = "PRODUCT(2,3,4)", this.description = N, this.defs = [
47
+ {
48
+ name: "value",
49
+ description: "Numbers or ranges to multiply.",
50
+ takesMatrix: !0,
51
+ acceptedTypes: ["number", "matrix"],
52
+ variadic: !0
53
+ }
54
+ ], this.category = "math";
55
+ }
56
+ main(...e) {
57
+ let t = 1;
58
+ for (const n of e)
59
+ l(
60
+ n,
61
+ (r) => {
62
+ r == null || typeof r == "string" || (t *= h(r));
63
+ },
64
+ this.at
65
+ );
66
+ return t;
67
+ }
68
+ }
69
+ const S = "Round a number to the specified number of decimal places according to standard rules.";
70
+ class U extends o {
71
+ constructor() {
72
+ super(...arguments), this.example = "ROUND(99.44,1)", this.description = S, this.defs = [
73
+ {
74
+ name: "value",
75
+ description: "A number to be rounded.",
76
+ acceptedTypes: ["number"]
77
+ },
78
+ {
79
+ name: "digit",
80
+ description: "The number of decimal places after rounding.",
81
+ acceptedTypes: ["number"],
82
+ optional: !0
83
+ }
84
+ ], this.category = "math";
85
+ }
86
+ main(e, t = 0) {
87
+ const n = Math.pow(10, t);
88
+ return Math.round(e * n) / n;
89
+ }
90
+ }
91
+ const E = "Round down a number to the specified number of decimal places according to standard rules.";
92
+ class $ extends o {
93
+ constructor() {
94
+ super(...arguments), this.example = "ROUNDDOWN(99.44,1)", this.description = E, this.defs = [
95
+ {
96
+ name: "value",
97
+ description: "A number to be rounded down.",
98
+ acceptedTypes: ["number"]
99
+ },
100
+ {
101
+ name: "digit",
102
+ description: "The number of decimal places after rounding.",
103
+ acceptedTypes: ["number"],
104
+ optional: !0
105
+ }
106
+ ], this.category = "math";
107
+ }
108
+ main(e, t = 0) {
109
+ const n = Math.pow(10, t);
110
+ return Math.floor(e * n) / n;
111
+ }
112
+ }
113
+ const q = "Round up a number to the specified number of decimal places according to standard rules.";
114
+ class C extends o {
115
+ constructor() {
116
+ super(...arguments), this.example = "ROUNDUP(99.44,1)", this.description = q, this.defs = [
117
+ {
118
+ name: "value",
119
+ description: "A number to be rounded up.",
120
+ acceptedTypes: ["number"]
121
+ },
122
+ {
123
+ name: "digit",
124
+ description: "The number of decimal places after rounding.",
125
+ acceptedTypes: ["number"],
126
+ optional: !0
127
+ }
128
+ ], this.category = "math";
129
+ }
130
+ main(e, t = 0) {
131
+ const n = Math.pow(10, t);
132
+ return Math.ceil(e * n) / n;
133
+ }
134
+ }
135
+ const I = "Returns the logarithm of a number whose base is the specified number.";
136
+ class k extends o {
137
+ constructor() {
138
+ super(...arguments), this.example = "LOG(128, 2)", this.description = I, this.defs = [
139
+ {
140
+ name: "value",
141
+ description: "The value for the logarithm of the specified number as base.",
142
+ acceptedTypes: ["number"]
143
+ },
144
+ { name: "base", description: "An exponent to power the base.", acceptedTypes: ["number"] }
145
+ ], this.category = "math";
146
+ }
147
+ validate(e) {
148
+ const [t, n] = super.validate(e);
149
+ if (t <= 0)
150
+ throw new u("NUM!", "value must be greater than 0");
151
+ if (n <= 1)
152
+ throw new u("NUM!", "base must be greater than 1");
153
+ return [t, n];
154
+ }
155
+ main(e, t) {
156
+ return Math.log2(e) / Math.log2(t);
157
+ }
158
+ }
159
+ const D = "Returns the logarithm of 10";
160
+ class O extends o {
161
+ constructor() {
162
+ super(...arguments), this.example = "LOG10(100)", this.description = D, this.defs = [
163
+ {
164
+ name: "value",
165
+ description: "The value for the logarithm of 10",
166
+ acceptedTypes: ["number"]
167
+ }
168
+ ], this.category = "math";
169
+ }
170
+ main(e) {
171
+ if (e <= 0)
172
+ throw new u("NUM!", "value must be greater than 0");
173
+ return Math.log10(e);
174
+ }
175
+ }
176
+ const L = "Returns the logarithm of e";
177
+ class P extends o {
178
+ constructor() {
179
+ super(...arguments), this.example = "LN(100)", this.description = L, this.defs = [
180
+ {
181
+ name: "value",
182
+ description: "The value for the logarithm of e",
183
+ acceptedTypes: ["number"]
184
+ }
185
+ ], this.category = "math";
186
+ }
187
+ main(e) {
188
+ if (e <= 0)
189
+ throw new u("NUM!", "value must be greater than 0");
190
+ return Math.log(e);
191
+ }
192
+ }
193
+ const V = "Returns the power of a number whose base is the Euler number e.";
194
+ class B extends o {
195
+ constructor() {
196
+ super(...arguments), this.example = "EXP(2)", this.description = V, this.defs = [
197
+ {
198
+ name: "exponent",
199
+ description: "It is an exponent of power with e as the base.",
200
+ acceptedTypes: ["number"]
201
+ }
202
+ ], this.category = "math";
203
+ }
204
+ validate(e) {
205
+ if (e.length !== 1)
206
+ throw new u("#N/A", "Number of arguments for EXP is incorrect.");
207
+ return [h(e[0])];
208
+ }
209
+ main(e) {
210
+ return Math.exp(e);
211
+ }
212
+ }
213
+ const _ = "Returns the value of Pi.";
214
+ class z extends o {
215
+ constructor() {
216
+ super(...arguments), this.example = "PI()", this.description = _, this.defs = [], this.category = "math";
217
+ }
218
+ main() {
219
+ return Math.PI;
220
+ }
221
+ }
222
+ const j = "Converts an angle value in degrees to radians.";
223
+ class G extends o {
224
+ constructor() {
225
+ super(...arguments), this.example = "RADIANS(180)", this.description = j, this.defs = [
226
+ {
227
+ name: "angle",
228
+ description: "An angle in degrees that you want to convert to radians.",
229
+ acceptedTypes: ["number"]
230
+ }
231
+ ], this.category = "math";
232
+ }
233
+ main(e) {
234
+ return e / 180 * Math.PI;
235
+ }
236
+ }
237
+ const Q = "Returns the sin of the angle specified in radians.";
238
+ class X extends o {
239
+ constructor() {
240
+ super(...arguments), this.example = "SIN(PI()/2)", this.description = Q, this.defs = [
241
+ {
242
+ name: "angle",
243
+ description: "An angle in radians, at which you want the sin.",
244
+ acceptedTypes: ["number"]
245
+ }
246
+ ], this.category = "math";
247
+ }
248
+ main(e) {
249
+ return Math.sin(e);
250
+ }
251
+ }
252
+ const W = "Returns the cos of the angle specified in radians.";
253
+ class Y extends o {
254
+ constructor() {
255
+ super(...arguments), this.example = "COS(PI())", this.description = W, this.defs = [
256
+ {
257
+ name: "angle",
258
+ description: "An angle in radians, at which you want the cos.",
259
+ acceptedTypes: ["number"]
260
+ }
261
+ ], this.category = "math";
262
+ }
263
+ main(e) {
264
+ return Math.cos(e);
265
+ }
266
+ }
267
+ const H = "Returns the tan of the angle specified in radians.";
268
+ class J extends o {
269
+ constructor() {
270
+ super(...arguments), this.example = "TAN(PI()/4)", this.description = H, this.defs = [
271
+ {
272
+ name: "angle",
273
+ description: "An angle in radians, at which you want the tan.",
274
+ acceptedTypes: ["number"]
275
+ }
276
+ ], this.category = "math";
277
+ }
278
+ main(e) {
279
+ return Math.tan(e);
280
+ }
281
+ }
282
+ const K = "Returns the inverse sin of the value in radians.";
283
+ class Z extends o {
284
+ constructor() {
285
+ super(...arguments), this.example = "ASIN(1)", this.description = K, this.defs = [
286
+ {
287
+ name: "value",
288
+ description: "A value for the inverse sin between -1 and 1.",
289
+ acceptedTypes: ["number"]
290
+ }
291
+ ], this.category = "math";
292
+ }
293
+ main(e) {
294
+ if (-1 > e || e > 1)
295
+ throw new u("#NUM!", "value must be between -1 and 1");
296
+ return Math.asin(e);
297
+ }
298
+ }
299
+ const ee = "Returns the inverse cos of the value in radians.";
300
+ class te extends o {
301
+ constructor() {
302
+ super(...arguments), this.example = "ACOS(0)", this.description = ee, this.defs = [
303
+ {
304
+ name: "value",
305
+ description: "A value for the inverse cos between -1 and 1.",
306
+ acceptedTypes: ["number"]
307
+ }
308
+ ], this.category = "math";
309
+ }
310
+ main(e) {
311
+ if (-1 > e || e > 1)
312
+ throw new u("#NUM!", "value must be between -1 and 1");
313
+ return Math.acos(e);
314
+ }
315
+ }
316
+ const ne = "Returns the inverse tan of the value in radians.";
317
+ class se extends o {
318
+ constructor() {
319
+ super(...arguments), this.example = "ATAN(1)", this.description = ne, this.defs = [
320
+ {
321
+ name: "value",
322
+ description: "A value for the inverse tan.",
323
+ acceptedTypes: ["number"]
324
+ }
325
+ ], this.category = "math";
326
+ }
327
+ main(e) {
328
+ return Math.atan(e);
329
+ }
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 {
333
+ constructor() {
334
+ super(...arguments), this.example = "ATAN2(4,3)", this.description = re, this.defs = [
335
+ {
336
+ name: "x",
337
+ description: "x of the point.",
338
+ acceptedTypes: ["number"]
339
+ },
340
+ {
341
+ name: "y",
342
+ description: "y of the point.",
343
+ acceptedTypes: ["number"]
344
+ }
345
+ ], this.category = "math";
346
+ }
347
+ main(e, t) {
348
+ return Math.atan2(e, t);
349
+ }
350
+ }
351
+ const ae = "Returns a random number between 0 and 1.";
352
+ class oe extends o {
353
+ constructor() {
354
+ super(...arguments), this.example = "RAND()", this.description = ae, this.defs = [], this.category = "math";
355
+ }
356
+ main() {
357
+ return Math.random();
358
+ }
359
+ }
360
+ const ce = "Returns a value interpreted as a percentage, i.e. divides the number by 100.";
361
+ class ue extends o {
362
+ constructor() {
363
+ super(...arguments), this.example = "UNARY_PERCENT(50)", this.description = ce, this.defs = [
364
+ {
365
+ name: "value",
366
+ description: "A number to be divided by 100.",
367
+ acceptedTypes: ["number"]
368
+ }
369
+ ], this.category = "math";
370
+ }
371
+ main(e) {
372
+ return e / 100;
373
+ }
374
+ }
375
+ const me = "Returns the number with its sign unchanged (unary plus).";
376
+ class de extends o {
377
+ constructor() {
378
+ super(...arguments), this.example = "UPLUS(4)", this.description = me, this.defs = [
379
+ {
380
+ name: "value",
381
+ description: "A number to return as-is.",
382
+ acceptedTypes: ["number"]
383
+ }
384
+ ], this.category = "math";
385
+ }
386
+ main(e) {
387
+ return e;
388
+ }
389
+ }
390
+ const he = "Returns the sum of a series of cells.";
391
+ class pe extends o {
392
+ constructor() {
393
+ super(...arguments), this.example = 'SUMIF(A1:A10,">20")', this.description = he, this.defs = [
394
+ { name: "range", description: "A condition range.", takesMatrix: !0, acceptedTypes: ["matrix"] },
395
+ f,
396
+ {
397
+ name: "sum_range",
398
+ description: "A range to be summarized.",
399
+ takesMatrix: !0,
400
+ acceptedTypes: ["matrix"],
401
+ optional: !0
402
+ }
403
+ ], this.category = "math";
404
+ }
405
+ main(e, t, n) {
406
+ const r = b(t), s = [], a = [];
407
+ l(
408
+ e,
409
+ (c) => {
410
+ s.push(c);
411
+ },
412
+ this.at
413
+ ), n && l(
414
+ n,
415
+ (c) => {
416
+ a.push(c);
417
+ },
418
+ this.at
419
+ );
420
+ let m = 0;
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);
424
+ }), m;
425
+ }
426
+ }
427
+ const le = "Returns the sum of a range depending on multiple criteria.";
428
+ class fe extends o {
429
+ constructor() {
430
+ super(...arguments), this.example = 'SUMIFS(A1:A10, B1:B10, ">20")', this.description = le, this.defs = [
431
+ { name: "sum_range", description: "The range to be summed.", takesMatrix: !0, acceptedTypes: ["matrix"] },
432
+ {
433
+ name: "range",
434
+ description: "First condition range.",
435
+ takesMatrix: !0,
436
+ acceptedTypes: ["matrix"],
437
+ variadic: !0
438
+ },
439
+ { ...f, name: "condition", variadic: !0 }
440
+ ], this.category = "math";
441
+ }
442
+ validate(e) {
443
+ const t = super.validate(e);
444
+ if ((t.length - 1) % 2 !== 0)
445
+ throw new u("#N/A", "SUMIFS requires sum_range and at least one range/condition pair.");
446
+ if (!(t[0] instanceof x))
447
+ throw new u("#VALUE!", "First argument of SUMIFS must be a range.");
448
+ const n = t[0].numRows, r = t[0].numCols, s = [], a = [];
449
+ for (let d = 1; d < t.length; d += 2) {
450
+ if (!(t[d] instanceof x))
451
+ throw new u("#VALUE!", `Argument ${d + 1} of SUMIFS must be a range.`);
452
+ if (t[d].numRows !== n || t[d].numCols !== r)
453
+ throw new u("#VALUE!", "Array arguments to SUMIFS are of different size.");
454
+ s.push(t[d]), a.push(b(t[d + 1]));
455
+ }
456
+ const m = t[0], c = M(s, a, this.at);
457
+ return [m, c];
458
+ }
459
+ main(e, t) {
460
+ let n = 0;
461
+ return l(
462
+ e,
463
+ (r, s) => {
464
+ if (s && t[s.y][s.x]) {
465
+ const a = w(r ?? 0, this.at);
466
+ typeof a == "number" && (n += a);
467
+ }
468
+ },
469
+ this.at
470
+ ), n;
471
+ }
472
+ }
473
+ const ge = "Returns the count of a series of cells.";
474
+ class xe extends o {
475
+ constructor() {
476
+ super(...arguments), this.example = 'COUNTIF(A1:A10,">20")', this.description = ge, this.defs = [
477
+ { name: "range", description: "Target range.", takesMatrix: !0, acceptedTypes: ["matrix"] },
478
+ { ...f }
479
+ ], this.category = "math";
480
+ }
481
+ main(e, t) {
482
+ const n = b(t);
483
+ let r = 0;
484
+ return l(
485
+ e,
486
+ (s) => {
487
+ y(s, n) && r++;
488
+ },
489
+ this.at
490
+ ), r;
491
+ }
492
+ }
493
+ const be = "Returns the count of a range depending on multiple criteria.";
494
+ class we extends o {
495
+ constructor() {
496
+ super(...arguments), this.example = 'COUNTIFS(A1:A10, ">20", B1:B10, "<5")', this.description = be, this.defs = [
497
+ { name: "range1", description: "First condition range.", takesMatrix: !0, acceptedTypes: ["matrix"] },
498
+ { ...f, name: "condition1" },
499
+ {
500
+ name: "range2",
501
+ description: "Additional condition range.",
502
+ takesMatrix: !0,
503
+ acceptedTypes: ["matrix"],
504
+ optional: !0,
505
+ variadic: !0
506
+ },
507
+ { ...f, name: "condition2", optional: !0, variadic: !0 }
508
+ ], this.category = "math";
509
+ }
510
+ validate(e) {
511
+ const t = super.validate(e);
512
+ if (t.length % 2 !== 0)
513
+ throw new u("#N/A", "COUNTIFS requires at least one range/condition pair.");
514
+ const n = t[0] instanceof x ? t[0] : null;
515
+ let r = 0, s = 0;
516
+ n && (r = n.numRows, s = n.numCols);
517
+ const a = [], m = [];
518
+ for (let d = 0; d < t.length; d += 2) {
519
+ if (!(t[d] instanceof x))
520
+ throw new u("#VALUE!", `Argument ${d + 1} of COUNTIFS must be a range.`);
521
+ if (t[d].numRows !== r || t[d].numCols !== s)
522
+ throw new u("#VALUE!", "Array arguments to COUNTIFS are of different size.");
523
+ a.push(t[d]), m.push(b(t[d + 1]));
524
+ }
525
+ return [M(a, m, this.at)];
526
+ }
527
+ main(e) {
528
+ let t = 0;
529
+ for (const n of e)
530
+ for (const r of n)
531
+ r && t++;
532
+ return t;
533
+ }
534
+ }
535
+ const ye = "Returns the factorial of a number.";
536
+ class Me extends o {
537
+ constructor() {
538
+ super(...arguments), this.example = "FACT(5)", this.description = ye, this.defs = [
539
+ {
540
+ name: "value",
541
+ description: "A non-negative integer whose factorial will be returned.",
542
+ acceptedTypes: ["number"]
543
+ }
544
+ ], this.category = "math";
545
+ }
546
+ main(e) {
547
+ if (e < 0)
548
+ throw new u("#NUM!", "FACT requires a non-negative integer.");
549
+ let t = 1;
550
+ for (let n = 2; n <= Math.floor(e); n++)
551
+ t *= n;
552
+ return t;
553
+ }
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 {
557
+ constructor() {
558
+ super(...arguments), this.example = "INT(8.9)", this.description = ve, this.defs = [
559
+ { name: "value", description: "The value to round down to the nearest integer.", acceptedTypes: ["number"] }
560
+ ], this.category = "math";
561
+ }
562
+ main(e) {
563
+ return Math.floor(e);
564
+ }
565
+ }
566
+ const Ae = "Returns TRUE if the value is even.";
567
+ class Re extends o {
568
+ constructor() {
569
+ super(...arguments), this.example = "ISEVEN(4)", this.description = Ae, this.defs = [
570
+ { name: "value", description: "The value to check for being even.", acceptedTypes: ["number"] }
571
+ ], this.category = "math";
572
+ }
573
+ main(e) {
574
+ return Math.floor(Math.abs(e)) % 2 === 0;
575
+ }
576
+ }
577
+ const Ne = "Returns TRUE if the value is odd.";
578
+ class Fe extends o {
579
+ constructor() {
580
+ super(...arguments), this.example = "ISODD(3)", this.description = Ne, this.defs = [
581
+ { name: "value", description: "The value to check for being odd.", acceptedTypes: ["number"] }
582
+ ], this.category = "math";
583
+ }
584
+ main(e) {
585
+ return Math.floor(Math.abs(e)) % 2 !== 0;
586
+ }
587
+ }
588
+ function Se(i, e) {
589
+ for (i = Math.abs(Math.floor(i)), e = Math.abs(Math.floor(e)); e; )
590
+ [i, e] = [e, i % e];
591
+ return i;
592
+ }
593
+ const Ue = "Returns the least common multiple of one or more integers.";
594
+ class Ee extends o {
595
+ constructor() {
596
+ super(...arguments), this.example = "LCM(4, 6)", this.description = Ue, this.defs = [
597
+ { name: "value", description: "Integers (must be >= 1).", acceptedTypes: ["number"], variadic: !0 }
598
+ ], this.category = "math";
599
+ }
600
+ validate(e) {
601
+ if (e.length === 0)
602
+ throw new u("#N/A", "LCM requires at least one argument.");
603
+ return e.map((t) => {
604
+ const n = Math.floor(h(t));
605
+ if (n < 1)
606
+ throw new u("#NUM!", "LCM arguments must be >= 1.");
607
+ return n;
608
+ });
609
+ }
610
+ main(...e) {
611
+ return e.reduce((t, n) => t * n / Se(t, n), 1);
612
+ }
613
+ }
614
+ const $e = "Rounds a number up to the nearest odd integer.";
615
+ class qe extends o {
616
+ constructor() {
617
+ super(...arguments), this.example = "ODD(2.3)", this.description = $e, this.defs = [
618
+ { name: "value", description: "The value to round up to the nearest odd integer.", acceptedTypes: ["number"] }
619
+ ], this.category = "math";
620
+ }
621
+ main(e) {
622
+ if (e === 0)
623
+ return 1;
624
+ const t = e > 0 ? 1 : -1;
625
+ let n = Math.ceil(Math.abs(e));
626
+ return n % 2 === 0 && n++, t * n;
627
+ }
628
+ }
629
+ const Ce = "Rounds a number up to the nearest even integer.";
630
+ class Ie extends o {
631
+ constructor() {
632
+ super(...arguments), this.example = "EVEN(3.1)", this.description = Ce, this.defs = [
633
+ { name: "value", description: "The value to round up to the nearest even integer.", acceptedTypes: ["number"] }
634
+ ], this.category = "math";
635
+ }
636
+ main(e) {
637
+ if (e === 0)
638
+ return 0;
639
+ const t = e > 0 ? 1 : -1;
640
+ let n = Math.ceil(Math.abs(e));
641
+ return n % 2 !== 0 && n++, t * n;
642
+ }
643
+ }
644
+ const ke = "Returns -1 if the value is negative, 1 if positive, and 0 if zero.";
645
+ class De extends o {
646
+ constructor() {
647
+ super(...arguments), this.example = "SIGN(-3)", this.description = ke, this.defs = [
648
+ { name: "value", description: "The number to check the sign of.", acceptedTypes: ["number"] }
649
+ ], this.category = "math";
650
+ }
651
+ main(e) {
652
+ return e > 0 ? 1 : e < 0 ? -1 : 0;
653
+ }
654
+ }
655
+ const Oe = "Returns the sum of the squares of a series of numbers or cells.";
656
+ class Le extends o {
657
+ constructor() {
658
+ super(...arguments), this.example = "SUMSQ(A1:A10, 3)", this.description = Oe, this.defs = [
659
+ {
660
+ name: "value",
661
+ description: "Numbers or ranges to square and sum.",
662
+ takesMatrix: !0,
663
+ acceptedTypes: ["number", "matrix"],
664
+ variadic: !0
665
+ }
666
+ ], this.category = "math";
667
+ }
668
+ main(...e) {
669
+ let t = 0;
670
+ for (const n of e)
671
+ l(
672
+ n,
673
+ (r) => {
674
+ const s = h(r, { ignore: !0 });
675
+ t += s * s;
676
+ },
677
+ this.at
678
+ );
679
+ return t;
680
+ }
681
+ }
682
+ const Pe = "Truncates a number to a certain number of significant digits by omitting less significant digits.";
683
+ class Ve extends o {
684
+ constructor() {
685
+ super(...arguments), this.example = "TRUNC(3.14159, 2)", this.description = Pe, this.defs = [
686
+ { name: "value", description: "The number to truncate.", acceptedTypes: ["number"] },
687
+ {
688
+ name: "places",
689
+ description: "The number of significant digits to keep. Defaults to 0.",
690
+ acceptedTypes: ["number"],
691
+ optional: !0
692
+ }
693
+ ], this.category = "math";
694
+ }
695
+ main(e, t = 0) {
696
+ const n = Math.floor(t), r = Math.pow(10, n);
697
+ return (e >= 0 ? Math.floor : Math.ceil)(e * r) / r;
698
+ }
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 {
702
+ constructor() {
703
+ super(...arguments), this.example = "BASE(255, 16)", this.description = Be, this.defs = [
704
+ { name: "value", description: "A non-negative integer to convert.", acceptedTypes: ["number"] },
705
+ { name: "base", description: "The base (radix) to convert into, between 2 and 36.", acceptedTypes: ["number"] },
706
+ {
707
+ name: "min_length",
708
+ description: "Minimum length of the result string (zero-padded).",
709
+ acceptedTypes: ["number"],
710
+ optional: !0
711
+ }
712
+ ], this.category = "math";
713
+ }
714
+ validate(e) {
715
+ if (e.length < 2 || e.length > 3)
716
+ throw new u("#N/A", "Number of arguments for BASE is incorrect.");
717
+ if (e[0] = Math.floor(h(e[0])), e[1] = Math.floor(h(e[1])), e[0] < 0)
718
+ throw new u("#NUM!", "BASE requires a non-negative integer as value.");
719
+ if (e[1] < 2 || e[1] > 36)
720
+ throw new u("#NUM!", "BASE requires a base between 2 and 36.");
721
+ if (e[2] != null && (e[2] = Math.floor(h(e[2])), e[2] < 0))
722
+ throw new u("#NUM!", "BASE min_length must be non-negative.");
723
+ return e;
724
+ }
725
+ main(e, t, n) {
726
+ const r = e.toString(t).toUpperCase();
727
+ return n != null && r.length < n ? r.padStart(n, "0") : r;
728
+ }
729
+ }
730
+ const ze = `Generates a sequence of numbers in a 2D array.
731
+ Returns a rows × cols array starting at start, incrementing by step.`;
732
+ class je extends o {
733
+ constructor() {
734
+ super(...arguments), this.autoSpilling = !0, this.example = "SEQUENCE(4, 3, 1, 1)", this.description = ze, this.defs = [
735
+ {
736
+ name: "rows",
737
+ description: "The number of rows to return.",
738
+ acceptedTypes: ["number"]
739
+ },
740
+ {
741
+ name: "columns",
742
+ description: "The number of columns to return. Defaults to 1.",
743
+ optional: !0,
744
+ acceptedTypes: ["number"]
745
+ },
746
+ {
747
+ name: "start",
748
+ description: "The starting value of the sequence. Defaults to 1.",
749
+ optional: !0,
750
+ acceptedTypes: ["number"]
751
+ },
752
+ {
753
+ name: "step",
754
+ description: "The increment between each value. Defaults to 1.",
755
+ optional: !0,
756
+ acceptedTypes: ["number"]
757
+ }
758
+ ], this.category = "math";
759
+ }
760
+ validate(e) {
761
+ if (e.length < 1 || e.length > 4)
762
+ throw new u("#N/A", "Number of arguments for SEQUENCE is incorrect.");
763
+ if (e[0] = Math.floor(h(e[0])), e[0] < 1)
764
+ throw new u("#VALUE!", "rows must be at least 1.");
765
+ if (e.length >= 2 && (e[1] = Math.floor(h(e[1])), e[1] < 1))
766
+ throw new u("#VALUE!", "columns must be at least 1.");
767
+ return e.length >= 3 && (e[2] = h(e[2])), e.length >= 4 && (e[3] = h(e[3])), e;
768
+ }
769
+ main(e, t = 1, n = 1, r = 1) {
770
+ const s = [];
771
+ let a = n;
772
+ for (let m = 0; m < e; m++) {
773
+ const c = [];
774
+ for (let d = 0; d < t; d++)
775
+ c.push(a), a += r;
776
+ s.push(c);
777
+ }
778
+ return s;
779
+ }
780
+ }
781
+ class g extends o {
782
+ constructor() {
783
+ super(...arguments), this.category = "math";
784
+ }
785
+ /** Convert a matrix argument to a 2D number array using eachMatrix. */
786
+ extractNumberMatrix(e, t) {
787
+ const n = [];
788
+ if (l(
789
+ e,
790
+ (r, { y: s, x: a }) => {
791
+ n[s] || (n[s] = []), n[s][a] = h(r);
792
+ },
793
+ this.at
794
+ ), n.length === 0)
795
+ throw new u("#VALUE!", `${t} must be a non-empty matrix.`);
796
+ return n;
797
+ }
798
+ /** Require the matrix to be square. Throws if not. */
799
+ requireSquare(e, t) {
800
+ const n = e.length;
801
+ if (e.some((r) => r.length !== n))
802
+ throw new u("#VALUE!", `${t} requires a square matrix.`);
803
+ }
804
+ }
805
+ const Ge = `Returns the matrix product of two matrices.
806
+ The number of columns in matrix1 must equal the number of rows in matrix2.`;
807
+ class Qe extends g {
808
+ constructor() {
809
+ super(...arguments), this.autoSpilling = !0, this.example = "MMULT(A1:B2, C1:D2)", this.description = Ge, this.defs = [
810
+ { name: "matrix1", description: "First matrix.", takesMatrix: !0, acceptedTypes: ["matrix"] },
811
+ { name: "matrix2", description: "Second matrix.", takesMatrix: !0, acceptedTypes: ["matrix"] }
812
+ ];
813
+ }
814
+ validate(e) {
815
+ if (e.length !== 2)
816
+ throw new u("#N/A", "MMULT requires exactly 2 arguments.");
817
+ const t = this.extractNumberMatrix(e[0], "matrix1"), n = this.extractNumberMatrix(e[1], "matrix2"), r = t[0].length, s = n.length;
818
+ if (r !== s)
819
+ throw new u(
820
+ "#VALUE!",
821
+ `MMULT: number of columns in matrix1 (${r}) must equal number of rows in matrix2 (${s}).`
822
+ );
823
+ return [t, n];
824
+ }
825
+ main(e, t) {
826
+ const n = e.length, r = e[0].length, s = t[0].length, a = [];
827
+ for (let m = 0; m < n; m++) {
828
+ a[m] = [];
829
+ for (let c = 0; c < s; c++) {
830
+ let d = 0;
831
+ for (let p = 0; p < r; p++)
832
+ d += e[m][p] * t[p][c];
833
+ a[m][c] = d;
834
+ }
835
+ }
836
+ return a;
837
+ }
838
+ }
839
+ const Xe = `Returns the transpose of a matrix.
840
+ Rows and columns of the input array are swapped.`;
841
+ class We extends g {
842
+ constructor() {
843
+ super(...arguments), this.autoSpilling = !0, this.example = "TRANSPOSE(A1:C3)", this.description = Xe, this.defs = [
844
+ { name: "matrix", description: "The matrix to transpose.", takesMatrix: !0, acceptedTypes: ["matrix"] }
845
+ ];
846
+ }
847
+ validate(e) {
848
+ if (e.length !== 1)
849
+ throw new u("#N/A", "TRANSPOSE requires exactly 1 argument.");
850
+ return [this.extractNumberMatrix(e[0], "matrix")];
851
+ }
852
+ main(e) {
853
+ const t = e.length, n = e[0].length, r = [];
854
+ for (let s = 0; s < n; s++) {
855
+ r[s] = [];
856
+ for (let a = 0; a < t; a++)
857
+ r[s][a] = e[a][s];
858
+ }
859
+ return r;
860
+ }
861
+ }
862
+ const Ye = `Returns the inverse of a square matrix.
863
+ The matrix must be square and non-singular (determinant ≠ 0).`;
864
+ class He extends g {
865
+ constructor() {
866
+ super(...arguments), this.autoSpilling = !0, this.example = "MINVERSE(A1:C3)", this.description = Ye, this.defs = [
867
+ { name: "matrix", description: "A square numeric matrix.", takesMatrix: !0, acceptedTypes: ["matrix"] }
868
+ ];
869
+ }
870
+ validate(e) {
871
+ if (e.length !== 1)
872
+ throw new u("#N/A", "MINVERSE requires exactly 1 argument.");
873
+ const t = this.extractNumberMatrix(e[0], "matrix");
874
+ this.requireSquare(t, "MINVERSE");
875
+ const n = this.invertMatrix(t);
876
+ if (n === null)
877
+ throw new u("#NUM!", "MINVERSE: matrix is singular and cannot be inverted.");
878
+ return [n];
879
+ }
880
+ main(e) {
881
+ return e;
882
+ }
883
+ invertMatrix(e) {
884
+ const t = e.length, n = e.map((r, s) => [...r, ...Array.from({ length: t }, (a, m) => s === m ? 1 : 0)]);
885
+ for (let r = 0; r < t; r++) {
886
+ let s = -1, a = 0;
887
+ for (let c = r; c < t; c++)
888
+ Math.abs(n[c][r]) > a && (a = Math.abs(n[c][r]), s = c);
889
+ if (s === -1 || Math.abs(n[s][r]) < 1e-10)
890
+ return null;
891
+ [n[r], n[s]] = [n[s], n[r]];
892
+ const m = n[r][r];
893
+ for (let c = 0; c < 2 * t; c++)
894
+ n[r][c] /= m;
895
+ for (let c = 0; c < t; c++) {
896
+ if (c === r)
897
+ continue;
898
+ const d = n[c][r];
899
+ for (let p = 0; p < 2 * t; p++)
900
+ n[c][p] -= d * n[r][p];
901
+ }
902
+ }
903
+ return n.map((r) => r.slice(t));
904
+ }
905
+ }
906
+ const Je = "Returns the determinant of a square matrix.";
907
+ class Ke extends g {
908
+ constructor() {
909
+ super(...arguments), this.example = "MDETERM(A1:C3)", this.description = Je, this.defs = [
910
+ { name: "matrix", description: "A square numeric matrix.", takesMatrix: !0, acceptedTypes: ["matrix"] }
911
+ ];
912
+ }
913
+ validate(e) {
914
+ if (e.length !== 1)
915
+ throw new u("#N/A", "MDETERM requires exactly 1 argument.");
916
+ const t = this.extractNumberMatrix(e[0], "matrix");
917
+ return this.requireSquare(t, "MDETERM"), [t];
918
+ }
919
+ main(e) {
920
+ return this.determinant(e);
921
+ }
922
+ determinant(e) {
923
+ const t = e.length, n = e.map((s) => [...s]);
924
+ let r = 1;
925
+ for (let s = 0; s < t; s++) {
926
+ let a = s;
927
+ for (let m = s + 1; m < t; m++)
928
+ Math.abs(n[m][s]) > Math.abs(n[a][s]) && (a = m);
929
+ if (a !== s && ([n[s], n[a]] = [n[a], n[s]], r *= -1), Math.abs(n[s][s]) < 1e-10)
930
+ return 0;
931
+ r *= n[s][s];
932
+ for (let m = s + 1; m < t; m++) {
933
+ const c = n[m][s] / n[s][s];
934
+ for (let d = s; d < t; d++)
935
+ n[m][d] -= c * n[s][d];
936
+ }
937
+ }
938
+ return r;
939
+ }
940
+ }
941
+ const Ze = `Returns the sum of the products of corresponding array elements.
942
+ All arrays must have the same dimensions.`;
943
+ class et extends g {
944
+ constructor() {
945
+ super(...arguments), this.example = "SUMPRODUCT(A1:A3, B1:B3)", this.description = Ze, this.defs = [
946
+ { name: "array1", description: "First array.", takesMatrix: !0, acceptedTypes: ["matrix"] },
947
+ { name: "array2", description: "Additional arrays.", takesMatrix: !0, acceptedTypes: ["matrix"], variadic: !0 }
948
+ ];
949
+ }
950
+ validate(e) {
951
+ if (e.length < 1)
952
+ throw new u("#N/A", "SUMPRODUCT requires at least 1 argument.");
953
+ const t = e.map((s, a) => this.extractNumberMatrix(s, `array${a + 1}`)), n = t[0].length, r = t[0][0].length;
954
+ for (let s = 1; s < t.length; s++)
955
+ if (t[s].length !== n || t[s][0].length !== r)
956
+ throw new u("#VALUE!", "SUMPRODUCT: all arrays must have the same dimensions.");
957
+ return [t];
958
+ }
959
+ main(e) {
960
+ const t = e[0].length, n = e[0][0].length;
961
+ let r = 0;
962
+ for (let s = 0; s < t; s++)
963
+ for (let a = 0; a < n; a++) {
964
+ let m = 1;
965
+ for (const c of e)
966
+ m *= c[s][a];
967
+ r += m;
968
+ }
969
+ return r;
970
+ }
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
1016
+ };
1017
+ export {
1018
+ nt as default,
1019
+ nt as mathFunctions
1020
+ };
1021
+ //# sourceMappingURL=index.js.map