@gridsheet/functions 3.0.0-rc.5 → 3.0.0-rc.9

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 (255) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +75 -0
  3. package/dist/index.d.ts +2 -4
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +87 -88
  6. package/dist/index.js.map +1 -1
  7. package/dist/information/index.d.ts +1 -1
  8. package/dist/information/index.d.ts.map +1 -1
  9. package/dist/information/isblank.d.ts +1 -1
  10. package/dist/information/isblank.d.ts.map +1 -1
  11. package/dist/information/isdate.d.ts +1 -1
  12. package/dist/information/isdate.d.ts.map +1 -1
  13. package/dist/information/isemail.d.ts +1 -1
  14. package/dist/information/isemail.d.ts.map +1 -1
  15. package/dist/information/iserr.d.ts +2 -2
  16. package/dist/information/iserr.d.ts.map +1 -1
  17. package/dist/information/iserror.d.ts +2 -2
  18. package/dist/information/iserror.d.ts.map +1 -1
  19. package/dist/information/isformula.d.ts +1 -1
  20. package/dist/information/isformula.d.ts.map +1 -1
  21. package/dist/information/islogical.d.ts +1 -1
  22. package/dist/information/islogical.d.ts.map +1 -1
  23. package/dist/information/isna.d.ts +2 -2
  24. package/dist/information/isna.d.ts.map +1 -1
  25. package/dist/information/isnontext.d.ts +1 -1
  26. package/dist/information/isnontext.d.ts.map +1 -1
  27. package/dist/information/isref.d.ts +2 -2
  28. package/dist/information/isref.d.ts.map +1 -1
  29. package/dist/information/istext.d.ts +1 -1
  30. package/dist/information/istext.d.ts.map +1 -1
  31. package/dist/information/n.d.ts +2 -2
  32. package/dist/information/n.d.ts.map +1 -1
  33. package/dist/information/na.d.ts +1 -1
  34. package/dist/information/na.d.ts.map +1 -1
  35. package/dist/information/sheets.d.ts +1 -1
  36. package/dist/information/sheets.d.ts.map +1 -1
  37. package/dist/logical/ifna.d.ts +1 -1
  38. package/dist/logical/ifna.d.ts.map +1 -1
  39. package/dist/logical/ifs.d.ts +1 -1
  40. package/dist/logical/ifs.d.ts.map +1 -1
  41. package/dist/logical/index.d.ts +1 -1
  42. package/dist/logical/index.d.ts.map +1 -1
  43. package/dist/logical/xor.d.ts +1 -1
  44. package/dist/logical/xor.d.ts.map +1 -1
  45. package/dist/lookup/column.d.ts +1 -1
  46. package/dist/lookup/column.d.ts.map +1 -1
  47. package/dist/lookup/columns.d.ts +2 -2
  48. package/dist/lookup/columns.d.ts.map +1 -1
  49. package/dist/lookup/hlookup.d.ts +1 -1
  50. package/dist/lookup/hlookup.d.ts.map +1 -1
  51. package/dist/lookup/index.d.ts +1 -1
  52. package/dist/lookup/index.d.ts.map +1 -1
  53. package/dist/lookup/index.js +1 -1
  54. package/dist/lookup/index.js.map +1 -1
  55. package/dist/lookup/indexFn.d.ts +2 -2
  56. package/dist/lookup/indexFn.d.ts.map +1 -1
  57. package/dist/lookup/match.d.ts +1 -1
  58. package/dist/lookup/match.d.ts.map +1 -1
  59. package/dist/lookup/row.d.ts +1 -1
  60. package/dist/lookup/row.d.ts.map +1 -1
  61. package/dist/lookup/rows.d.ts +2 -2
  62. package/dist/lookup/rows.d.ts.map +1 -1
  63. package/dist/lookup/sheet.d.ts +2 -2
  64. package/dist/lookup/sheet.d.ts.map +1 -1
  65. package/dist/lookup/vlookup.d.ts +1 -1
  66. package/dist/lookup/vlookup.d.ts.map +1 -1
  67. package/dist/math/__matrix_base.d.ts +1 -1
  68. package/dist/math/__matrix_base.d.ts.map +1 -1
  69. package/dist/math/acos.d.ts +1 -1
  70. package/dist/math/acos.d.ts.map +1 -1
  71. package/dist/math/asin.d.ts +1 -1
  72. package/dist/math/asin.d.ts.map +1 -1
  73. package/dist/math/atan.d.ts +1 -1
  74. package/dist/math/atan.d.ts.map +1 -1
  75. package/dist/math/atan2.d.ts +1 -1
  76. package/dist/math/atan2.d.ts.map +1 -1
  77. package/dist/math/base.d.ts +1 -1
  78. package/dist/math/base.d.ts.map +1 -1
  79. package/dist/math/cos.d.ts +1 -1
  80. package/dist/math/cos.d.ts.map +1 -1
  81. package/dist/math/countif.d.ts +1 -1
  82. package/dist/math/countif.d.ts.map +1 -1
  83. package/dist/math/countifs.d.ts +1 -1
  84. package/dist/math/countifs.d.ts.map +1 -1
  85. package/dist/math/even.d.ts +1 -1
  86. package/dist/math/even.d.ts.map +1 -1
  87. package/dist/math/exp.d.ts +1 -1
  88. package/dist/math/exp.d.ts.map +1 -1
  89. package/dist/math/fact.d.ts +1 -1
  90. package/dist/math/fact.d.ts.map +1 -1
  91. package/dist/math/index.d.ts +1 -1
  92. package/dist/math/index.d.ts.map +1 -1
  93. package/dist/math/index.js +1 -1
  94. package/dist/math/index.js.map +1 -1
  95. package/dist/math/int.d.ts +1 -1
  96. package/dist/math/int.d.ts.map +1 -1
  97. package/dist/math/iseven.d.ts +1 -1
  98. package/dist/math/iseven.d.ts.map +1 -1
  99. package/dist/math/isodd.d.ts +1 -1
  100. package/dist/math/isodd.d.ts.map +1 -1
  101. package/dist/math/lcm.d.ts +1 -1
  102. package/dist/math/lcm.d.ts.map +1 -1
  103. package/dist/math/ln.d.ts +1 -1
  104. package/dist/math/ln.d.ts.map +1 -1
  105. package/dist/math/log.d.ts +1 -1
  106. package/dist/math/log.d.ts.map +1 -1
  107. package/dist/math/log10.d.ts +1 -1
  108. package/dist/math/log10.d.ts.map +1 -1
  109. package/dist/math/mdeterm.d.ts +1 -1
  110. package/dist/math/mdeterm.d.ts.map +1 -1
  111. package/dist/math/minverse.d.ts +1 -1
  112. package/dist/math/minverse.d.ts.map +1 -1
  113. package/dist/math/mmult.d.ts +1 -1
  114. package/dist/math/mmult.d.ts.map +1 -1
  115. package/dist/math/mod.d.ts +1 -1
  116. package/dist/math/mod.d.ts.map +1 -1
  117. package/dist/math/odd.d.ts +1 -1
  118. package/dist/math/odd.d.ts.map +1 -1
  119. package/dist/math/pi.d.ts +1 -1
  120. package/dist/math/pi.d.ts.map +1 -1
  121. package/dist/math/product.d.ts +1 -1
  122. package/dist/math/product.d.ts.map +1 -1
  123. package/dist/math/radians.d.ts +1 -1
  124. package/dist/math/radians.d.ts.map +1 -1
  125. package/dist/math/rand.d.ts +1 -1
  126. package/dist/math/rand.d.ts.map +1 -1
  127. package/dist/math/round.d.ts +1 -1
  128. package/dist/math/round.d.ts.map +1 -1
  129. package/dist/math/rounddown.d.ts +1 -1
  130. package/dist/math/rounddown.d.ts.map +1 -1
  131. package/dist/math/roundup.d.ts +1 -1
  132. package/dist/math/roundup.d.ts.map +1 -1
  133. package/dist/math/sequence.d.ts +1 -1
  134. package/dist/math/sequence.d.ts.map +1 -1
  135. package/dist/math/sign.d.ts +1 -1
  136. package/dist/math/sign.d.ts.map +1 -1
  137. package/dist/math/sin.d.ts +1 -1
  138. package/dist/math/sin.d.ts.map +1 -1
  139. package/dist/math/sqrt.d.ts +1 -1
  140. package/dist/math/sqrt.d.ts.map +1 -1
  141. package/dist/math/sumif.d.ts +1 -1
  142. package/dist/math/sumif.d.ts.map +1 -1
  143. package/dist/math/sumifs.d.ts +1 -1
  144. package/dist/math/sumifs.d.ts.map +1 -1
  145. package/dist/math/sumproduct.d.ts +1 -1
  146. package/dist/math/sumproduct.d.ts.map +1 -1
  147. package/dist/math/sumsq.d.ts +1 -1
  148. package/dist/math/sumsq.d.ts.map +1 -1
  149. package/dist/math/tan.d.ts +1 -1
  150. package/dist/math/tan.d.ts.map +1 -1
  151. package/dist/math/transpose.d.ts +1 -1
  152. package/dist/math/transpose.d.ts.map +1 -1
  153. package/dist/math/trunc.d.ts +1 -1
  154. package/dist/math/trunc.d.ts.map +1 -1
  155. package/dist/math/unaryPercent.d.ts +1 -1
  156. package/dist/math/unaryPercent.d.ts.map +1 -1
  157. package/dist/math/uplus.d.ts +1 -1
  158. package/dist/math/uplus.d.ts.map +1 -1
  159. package/dist/statistics/averageif.d.ts +1 -1
  160. package/dist/statistics/averageif.d.ts.map +1 -1
  161. package/dist/statistics/averageifs.d.ts +2 -2
  162. package/dist/statistics/averageifs.d.ts.map +1 -1
  163. package/dist/statistics/correl.d.ts +1 -1
  164. package/dist/statistics/correl.d.ts.map +1 -1
  165. package/dist/statistics/covariance_p.d.ts +1 -1
  166. package/dist/statistics/covariance_p.d.ts.map +1 -1
  167. package/dist/statistics/covariance_s.d.ts +1 -1
  168. package/dist/statistics/covariance_s.d.ts.map +1 -1
  169. package/dist/statistics/index.d.ts +1 -1
  170. package/dist/statistics/index.d.ts.map +1 -1
  171. package/dist/statistics/index.js +1 -1
  172. package/dist/statistics/index.js.map +1 -1
  173. package/dist/statistics/median.d.ts +1 -1
  174. package/dist/statistics/median.d.ts.map +1 -1
  175. package/dist/statistics/mode_sngl.d.ts +1 -1
  176. package/dist/statistics/mode_sngl.d.ts.map +1 -1
  177. package/dist/statistics/percentile_inc.d.ts +1 -1
  178. package/dist/statistics/percentile_inc.d.ts.map +1 -1
  179. package/dist/statistics/quartile_inc.d.ts +1 -1
  180. package/dist/statistics/quartile_inc.d.ts.map +1 -1
  181. package/dist/statistics/rank_eq.d.ts +1 -1
  182. package/dist/statistics/rank_eq.d.ts.map +1 -1
  183. package/dist/statistics/rsq.d.ts +1 -1
  184. package/dist/statistics/rsq.d.ts.map +1 -1
  185. package/dist/statistics/stdev_p.d.ts +1 -1
  186. package/dist/statistics/stdev_p.d.ts.map +1 -1
  187. package/dist/statistics/stdev_s.d.ts +1 -1
  188. package/dist/statistics/stdev_s.d.ts.map +1 -1
  189. package/dist/statistics/t_test.d.ts +1 -1
  190. package/dist/statistics/t_test.d.ts.map +1 -1
  191. package/dist/statistics/var_p.d.ts +1 -1
  192. package/dist/statistics/var_p.d.ts.map +1 -1
  193. package/dist/statistics/var_s.d.ts +1 -1
  194. package/dist/statistics/var_s.d.ts.map +1 -1
  195. package/dist/text/char.d.ts +1 -1
  196. package/dist/text/char.d.ts.map +1 -1
  197. package/dist/text/clean.d.ts +1 -1
  198. package/dist/text/clean.d.ts.map +1 -1
  199. package/dist/text/concatenate.d.ts +1 -1
  200. package/dist/text/concatenate.d.ts.map +1 -1
  201. package/dist/text/exact.d.ts +1 -1
  202. package/dist/text/exact.d.ts.map +1 -1
  203. package/dist/text/index.d.ts +1 -1
  204. package/dist/text/index.d.ts.map +1 -1
  205. package/dist/text/index.js +1 -1
  206. package/dist/text/index.js.map +1 -1
  207. package/dist/text/join.d.ts +1 -1
  208. package/dist/text/join.d.ts.map +1 -1
  209. package/dist/text/lenb.d.ts +1 -1
  210. package/dist/text/lenb.d.ts.map +1 -1
  211. package/dist/text/lower.d.ts +2 -2
  212. package/dist/text/lower.d.ts.map +1 -1
  213. package/dist/text/proper.d.ts +1 -1
  214. package/dist/text/proper.d.ts.map +1 -1
  215. package/dist/text/replace.d.ts +1 -1
  216. package/dist/text/replace.d.ts.map +1 -1
  217. package/dist/text/rept.d.ts +1 -1
  218. package/dist/text/rept.d.ts.map +1 -1
  219. package/dist/text/trim.d.ts +2 -2
  220. package/dist/text/trim.d.ts.map +1 -1
  221. package/dist/text/unichar.d.ts +1 -1
  222. package/dist/text/unichar.d.ts.map +1 -1
  223. package/dist/text/unicode.d.ts +1 -1
  224. package/dist/text/unicode.d.ts.map +1 -1
  225. package/dist/text/upper.d.ts +2 -2
  226. package/dist/text/upper.d.ts.map +1 -1
  227. package/dist/time/date.d.ts +1 -1
  228. package/dist/time/date.d.ts.map +1 -1
  229. package/dist/time/day.d.ts +2 -2
  230. package/dist/time/day.d.ts.map +1 -1
  231. package/dist/time/days.d.ts +1 -1
  232. package/dist/time/days.d.ts.map +1 -1
  233. package/dist/time/hour.d.ts +2 -2
  234. package/dist/time/hour.d.ts.map +1 -1
  235. package/dist/time/index.d.ts +1 -1
  236. package/dist/time/index.d.ts.map +1 -1
  237. package/dist/time/index.js +41 -53
  238. package/dist/time/index.js.map +1 -1
  239. package/dist/time/minute.d.ts +2 -2
  240. package/dist/time/minute.d.ts.map +1 -1
  241. package/dist/time/month.d.ts +2 -2
  242. package/dist/time/month.d.ts.map +1 -1
  243. package/dist/time/second.d.ts +2 -2
  244. package/dist/time/second.d.ts.map +1 -1
  245. package/dist/time/time.d.ts +2 -2
  246. package/dist/time/time.d.ts.map +1 -1
  247. package/dist/time/today.d.ts +1 -1
  248. package/dist/time/today.d.ts.map +1 -1
  249. package/dist/time/workday.d.ts +1 -1
  250. package/dist/time/workday.d.ts.map +1 -1
  251. package/dist/time/year.d.ts +2 -2
  252. package/dist/time/year.d.ts.map +1 -1
  253. package/package.json +9 -10
  254. package/dist/time/__utils.d.ts +0 -6
  255. package/dist/time/__utils.d.ts.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2020 righ
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # @gridsheet/functions
2
+
3
+ Extended formula functions for [@gridsheet/react-core](https://www.npmjs.com/package/@gridsheet/react-core).
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @gridsheet/functions
9
+ # or
10
+ pnpm add @gridsheet/functions
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ### `useSpellbook` — recommended
16
+
17
+ Drop-in replacement for `useBook` with all extended functions pre-loaded.
18
+
19
+ ```tsx
20
+ import { GridSheet } from '@gridsheet/react-core';
21
+ import { useSpellbook } from '@gridsheet/functions';
22
+
23
+ export default function App() {
24
+ const book = useSpellbook();
25
+ return <GridSheet book={book} />;
26
+ }
27
+ ```
28
+
29
+ Custom functions are merged on top of the built-ins:
30
+
31
+ ```tsx
32
+ const book = useSpellbook({
33
+ additionalFunctions: {
34
+ double: MyDoubleFunction,
35
+ },
36
+ });
37
+ ```
38
+
39
+ ### `createSpellbook` — for non-hook contexts
40
+
41
+ Same as `useSpellbook` but usable outside of React components (e.g. SSR, server-side initialization).
42
+
43
+ ```ts
44
+ import { createSpellbook } from '@gridsheet/functions';
45
+
46
+ const book = createSpellbook();
47
+ ```
48
+
49
+ ### `allFunctions` — manual registration
50
+
51
+ If you prefer to register functions yourself via `useBook` / `createBook`:
52
+
53
+ ```tsx
54
+ import { useBook } from '@gridsheet/react-core';
55
+ import { allFunctions } from '@gridsheet/functions';
56
+
57
+ const book = useBook({
58
+ additionalFunctions: allFunctions,
59
+ });
60
+ ```
61
+
62
+ Or import only the category you need:
63
+
64
+ ```ts
65
+ import { mathFunctions } from '@gridsheet/functions/math';
66
+ import { textFunctions } from '@gridsheet/functions/text';
67
+ import { lookupFunctions } from '@gridsheet/functions/lookup';
68
+ import { statisticsFunctions } from '@gridsheet/functions/statistics';
69
+ import { timeFunctions } from '@gridsheet/functions/time';
70
+ import { logicalFunctions } from '@gridsheet/functions/logical';
71
+ ```
72
+
73
+ ## License
74
+
75
+ Apache-2.0
package/dist/index.d.ts CHANGED
@@ -1,9 +1,7 @@
1
- import { FunctionMapping, RegistryProps } from '@gridsheet/react-core';
1
+ import { FunctionMapping, RegistryProps } from '@gridsheet/core';
2
2
  /** All extended functions combined into a single FunctionMapping. */
3
3
  export declare const allFunctions: FunctionMapping;
4
- /** useBook with all extended functions pre-loaded. User-supplied additionalFunctions are merged on top. */
5
- export declare const useSpellbook: ({ additionalFunctions, ...rest }?: RegistryProps) => import('@gridsheet/react-core').BookType;
6
4
  /** createBook with all extended functions pre-loaded. User-supplied additionalFunctions are merged on top. */
7
- export declare const createSpellbook: ({ additionalFunctions, ...rest }?: RegistryProps) => import('@gridsheet/react-core').BookType;
5
+ export declare const createSpellbook: ({ additionalFunctions, ...rest }?: RegistryProps) => any;
8
6
  export default allFunctions;
9
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAU5E,qEAAqE;AACrE,eAAO,MAAM,YAAY,EAAE,eAQ1B,CAAC;AAEF,2GAA2G;AAC3G,eAAO,MAAM,YAAY,GAAI,mCAAkC,aAAkB,6CACO,CAAC;AAEzF,8GAA8G;AAC9G,eAAO,MAAM,eAAe,GAAI,mCAAkC,aAAkB,6CACO,CAAC;AAE5F,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAUtE,qEAAqE;AACrE,eAAO,MAAM,YAAY,EAAE,eAQ1B,CAAC;AAEF,8GAA8G;AAC9G,eAAO,MAAM,eAAe,GAAI,mCAAkC,aAAkB,QACO,CAAC;AAE5F,eAAe,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { BaseFunction as r, FormulaError as s, ensureBoolean as u, Sheet as l, ensureNumber as d, useBook as p, createBook as h } from "@gridsheet/react-core";
2
- import { mathFunctions as m } from "./math/index.js";
3
- import { statisticsFunctions as f } from "./statistics/index.js";
4
- import { textFunctions as g } from "./text/index.js";
5
- import { lookupFunctions as T } from "./lookup/index.js";
6
- import { timeFunctions as y } from "./time/index.js";
7
- const x = `Returns TRUE if an odd number of the arguments are logically true.
1
+ import { BaseFunction as r, FormulaError as s, ensureBoolean as c, Sheet as u, ensureNumber as l, createBook as d } from "@gridsheet/core";
2
+ import { mathFunctions as p } from "./math/index.js";
3
+ import { statisticsFunctions as h } from "./statistics/index.js";
4
+ import { textFunctions as m } from "./text/index.js";
5
+ import { lookupFunctions as f } from "./lookup/index.js";
6
+ import { timeFunctions as g } from "./time/index.js";
7
+ const T = `Returns TRUE if an odd number of the arguments are logically true.
8
8
  Returns FALSE if an even number of the arguments are logically true.`;
9
- class A extends r {
9
+ class y extends r {
10
10
  constructor() {
11
- super(...arguments), this.example = "XOR(A1=1, A2=2)", this.description = x, this.defs = [
11
+ super(...arguments), this.example = "XOR(A1=1, A2=2)", this.description = T, this.defs = [
12
12
  { name: "expression", description: "Logical expressions to evaluate.", acceptedTypes: ["boolean"], variadic: !0 }
13
13
  ], this.category = "logical";
14
14
  }
@@ -16,9 +16,9 @@ class A extends r {
16
16
  return e.reduce((n, i) => n !== i, !1);
17
17
  }
18
18
  }
19
- const v = "Returns the first argument if it is not a #N/A error, otherwise returns the second argument.", a = class a extends r {
19
+ const x = "Returns the first argument if it is not a #N/A error, otherwise returns the second argument.", a = class a extends r {
20
20
  constructor() {
21
- super(...arguments), this.example = 'IFNA(A1, "N/A error occurred")', this.description = v, this.defs = [
21
+ super(...arguments), this.example = 'IFNA(A1, "N/A error occurred")', this.description = x, this.defs = [
22
22
  {
23
23
  name: "value",
24
24
  description: "The value to return if it is not a #N/A error.",
@@ -39,11 +39,11 @@ const v = "Returns the first argument if it is not a #N/A error, otherwise retur
39
39
  };
40
40
  a.__name = "IFNA";
41
41
  let o = a;
42
- const R = `Evaluates multiple conditions and returns the value corresponding to the first TRUE condition.
42
+ const A = `Evaluates multiple conditions and returns the value corresponding to the first TRUE condition.
43
43
  Arguments must be supplied in (condition, value) pairs.`;
44
- class E extends r {
44
+ class v extends r {
45
45
  constructor() {
46
- super(...arguments), this.example = 'IFS(A1>90, "A", A1>70, "B", A1>50, "C")', this.description = R, this.defs = [
46
+ super(...arguments), this.example = 'IFS(A1>90, "A", A1>70, "B", A1>50, "C")', this.description = A, this.defs = [
47
47
  { name: "condition", description: "Condition to evaluate.", acceptedTypes: ["boolean"], variadic: !0 },
48
48
  { name: "value", description: "Value to return if condition is TRUE.", acceptedTypes: ["any"], variadic: !0 }
49
49
  ], this.category = "logical";
@@ -54,7 +54,7 @@ class E extends r {
54
54
  if (e.length % 2 !== 0)
55
55
  throw new s("#N/A", "IFS requires an even number of arguments (condition, value) pairs.");
56
56
  for (let n = 0; n < e.length; n += 2)
57
- if (u(e[n]))
57
+ if (c(e[n]))
58
58
  return [e[n + 1]];
59
59
  throw new s("#N/A", "No condition in IFS was met.");
60
60
  }
@@ -62,14 +62,14 @@ class E extends r {
62
62
  return e;
63
63
  }
64
64
  }
65
- const F = {
66
- xor: A,
65
+ const R = {
66
+ xor: y,
67
67
  ifna: o,
68
- ifs: E
69
- }, N = "Returns TRUE if the referenced cell contains a formula.";
70
- class I extends r {
68
+ ifs: v
69
+ }, E = "Returns TRUE if the referenced cell contains a formula.";
70
+ class F extends r {
71
71
  constructor() {
72
- super(...arguments), this.example = "ISFORMULA(A1)", this.description = N, this.defs = [
72
+ super(...arguments), this.example = "ISFORMULA(A1)", this.description = E, this.defs = [
73
73
  {
74
74
  name: "reference",
75
75
  description: "The cell reference to check for a formula.",
@@ -84,10 +84,10 @@ class I extends r {
84
84
  return typeof i == "string" && i.startsWith("=");
85
85
  }
86
86
  }
87
- const S = "Returns TRUE if the referenced cell is empty.";
88
- class b extends r {
87
+ const N = "Returns TRUE if the referenced cell is empty.";
88
+ class I extends r {
89
89
  constructor() {
90
- super(...arguments), this.example = "ISBLANK(A1)", this.description = S, this.defs = [
90
+ super(...arguments), this.example = "ISBLANK(A1)", this.description = N, this.defs = [
91
91
  {
92
92
  name: "value",
93
93
  description: "A reference to a cell to check for emptiness.",
@@ -100,10 +100,10 @@ class b extends r {
100
100
  return e == null || e === "";
101
101
  }
102
102
  }
103
- const k = "Returns TRUE if the value is any error other than #N/A.";
104
- class U extends r {
103
+ const S = "Returns TRUE if the value is any error other than #N/A.";
104
+ class b extends r {
105
105
  constructor() {
106
- super(...arguments), this.example = "ISERR(A1)", this.description = k, this.defs = [
106
+ super(...arguments), this.example = "ISERR(A1)", this.description = S, this.defs = [
107
107
  {
108
108
  name: "value",
109
109
  description: "The value to check for a non-#N/A error.",
@@ -116,10 +116,10 @@ class U extends r {
116
116
  return e instanceof Error ? !0 : s.is(e) && e.code !== "#N/A";
117
117
  }
118
118
  }
119
- const $ = "Returns TRUE if the value is any error value.";
120
- class w extends r {
119
+ const k = "Returns TRUE if the value is any error value.";
120
+ class U extends r {
121
121
  constructor() {
122
- super(...arguments), this.example = "ISERROR(A1)", this.description = $, this.defs = [
122
+ super(...arguments), this.example = "ISERROR(A1)", this.description = k, this.defs = [
123
123
  {
124
124
  name: "value",
125
125
  description: "The value to check for an error.",
@@ -132,10 +132,10 @@ class w extends r {
132
132
  return s.is(e) || e instanceof Error;
133
133
  }
134
134
  }
135
- const L = "Returns TRUE if the value is TRUE or FALSE.";
136
- class B extends r {
135
+ const $ = "Returns TRUE if the value is TRUE or FALSE.";
136
+ class w extends r {
137
137
  constructor() {
138
- super(...arguments), this.example = "ISLOGICAL(TRUE)", this.description = L, this.defs = [
138
+ super(...arguments), this.example = "ISLOGICAL(TRUE)", this.description = $, this.defs = [
139
139
  {
140
140
  name: "value",
141
141
  description: "The value to check for being logical (TRUE or FALSE).",
@@ -148,10 +148,10 @@ class B extends r {
148
148
  return typeof e == "boolean";
149
149
  }
150
150
  }
151
- const M = "Returns TRUE if the value is the #N/A error value.";
152
- class O extends r {
151
+ const L = "Returns TRUE if the value is the #N/A error value.";
152
+ class B extends r {
153
153
  constructor() {
154
- super(...arguments), this.example = "ISNA(A1)", this.description = M, this.defs = [
154
+ super(...arguments), this.example = "ISNA(A1)", this.description = L, this.defs = [
155
155
  {
156
156
  name: "value",
157
157
  description: "The value to check for the #N/A error.",
@@ -164,10 +164,10 @@ class O extends r {
164
164
  return s.is(e) && e.code === "#N/A";
165
165
  }
166
166
  }
167
- const X = "Returns TRUE if the value is not a text string.";
168
- class C extends r {
167
+ const M = "Returns TRUE if the value is not a text string.";
168
+ class O extends r {
169
169
  constructor() {
170
- super(...arguments), this.example = "ISNONTEXT(A1)", this.description = X, this.defs = [
170
+ super(...arguments), this.example = "ISNONTEXT(A1)", this.description = M, this.defs = [
171
171
  {
172
172
  name: "value",
173
173
  description: "The value to check for being non-text.",
@@ -180,10 +180,10 @@ class C extends r {
180
180
  return typeof e != "string";
181
181
  }
182
182
  }
183
- const _ = "Returns TRUE if the value is a text string.";
184
- class D extends r {
183
+ const X = "Returns TRUE if the value is a text string.";
184
+ class C extends r {
185
185
  constructor() {
186
- super(...arguments), this.example = "ISTEXT(A1)", this.description = _, this.defs = [
186
+ super(...arguments), this.example = "ISTEXT(A1)", this.description = X, this.defs = [
187
187
  {
188
188
  name: "value",
189
189
  description: "The value to check for being text.",
@@ -196,10 +196,10 @@ class D extends r {
196
196
  return typeof e == "string";
197
197
  }
198
198
  }
199
- const q = "Returns TRUE if the value is a valid cell reference.";
200
- class G extends r {
199
+ const _ = "Returns TRUE if the value is a valid cell reference.";
200
+ class D extends r {
201
201
  constructor() {
202
- super(...arguments), this.example = "ISREF(A1)", this.description = q, this.defs = [
202
+ super(...arguments), this.example = "ISREF(A1)", this.description = _, this.defs = [
203
203
  {
204
204
  name: "value",
205
205
  description: "The value to check for being a cell reference.",
@@ -210,13 +210,13 @@ class G extends r {
210
210
  ], this.category = "information";
211
211
  }
212
212
  main(e) {
213
- return l.is(e);
213
+ return u.is(e);
214
214
  }
215
215
  }
216
- const j = "Returns the argument provided as a number.";
217
- class H extends r {
216
+ const q = "Returns the argument provided as a number.";
217
+ class G extends r {
218
218
  constructor() {
219
- super(...arguments), this.example = "N(A1)", this.description = j, this.defs = [
219
+ super(...arguments), this.example = "N(A1)", this.description = q, this.defs = [
220
220
  {
221
221
  name: "value",
222
222
  description: "The value to convert to a number.",
@@ -232,25 +232,25 @@ class H extends r {
232
232
  if (e == null || e === "")
233
233
  return 0;
234
234
  try {
235
- return d(e);
235
+ return l(e);
236
236
  } catch {
237
237
  return 0;
238
238
  }
239
239
  }
240
240
  }
241
- const K = 'Returns the error value #N/A, meaning "value not available".';
242
- class V extends r {
241
+ const j = 'Returns the error value #N/A, meaning "value not available".';
242
+ class H extends r {
243
243
  constructor() {
244
- super(...arguments), this.example = "NA()", this.description = K, this.defs = [], this.category = "information";
244
+ super(...arguments), this.example = "NA()", this.description = j, this.defs = [], this.category = "information";
245
245
  }
246
246
  main() {
247
247
  throw new s("#N/A", "N/A");
248
248
  }
249
249
  }
250
- const W = "Returns TRUE if the value is a date.";
251
- class Y extends r {
250
+ const K = "Returns TRUE if the value is a date.";
251
+ class V extends r {
252
252
  constructor() {
253
- super(...arguments), this.example = "ISDATE(A1)", this.description = W, this.defs = [
253
+ super(...arguments), this.example = "ISDATE(A1)", this.description = K, this.defs = [
254
254
  {
255
255
  name: "value",
256
256
  description: "The value to check for being a date.",
@@ -263,10 +263,10 @@ class Y extends r {
263
263
  return e instanceof Date && !isNaN(e.getTime());
264
264
  }
265
265
  }
266
- const z = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, J = "Returns TRUE if the value is a valid email address.";
267
- class P extends r {
266
+ const W = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Y = "Returns TRUE if the value is a valid email address.";
267
+ class z extends r {
268
268
  constructor() {
269
- super(...arguments), this.example = "ISEMAIL(A1)", this.description = J, this.defs = [
269
+ super(...arguments), this.example = "ISEMAIL(A1)", this.description = Y, this.defs = [
270
270
  {
271
271
  name: "value",
272
272
  description: "The value to check for being a valid email address.",
@@ -276,47 +276,46 @@ class P extends r {
276
276
  ], this.category = "information";
277
277
  }
278
278
  main(e) {
279
- return typeof e != "string" ? !1 : z.test(e);
279
+ return typeof e != "string" ? !1 : W.test(e);
280
280
  }
281
281
  }
282
- const Q = "Returns the total number of sheets in the spreadsheet.";
283
- class Z extends r {
282
+ const J = "Returns the total number of sheets in the spreadsheet.";
283
+ class P extends r {
284
284
  constructor() {
285
- super(...arguments), this.example = "SHEETS()", this.description = Q, this.defs = [], this.category = "information";
285
+ super(...arguments), this.example = "SHEETS()", this.description = J, this.defs = [], this.category = "information";
286
286
  }
287
287
  main() {
288
288
  const e = this.sheet.registry.sheetIdsByName, n = Object.keys(e).length;
289
289
  return n === 0 ? 1 : n;
290
290
  }
291
291
  }
292
- const ee = {
293
- isformula: I,
294
- isblank: b,
295
- iserr: U,
296
- iserror: w,
297
- islogical: B,
298
- isna: O,
299
- isnontext: C,
300
- istext: D,
301
- isref: G,
302
- n: H,
303
- na: V,
304
- isdate: Y,
305
- isemail: P,
306
- sheets: Z
307
- }, c = {
292
+ const Q = {
293
+ isformula: F,
294
+ isblank: I,
295
+ iserr: b,
296
+ iserror: U,
297
+ islogical: w,
298
+ isna: B,
299
+ isnontext: O,
300
+ istext: C,
301
+ isref: D,
302
+ n: G,
303
+ na: H,
304
+ isdate: V,
305
+ isemail: z,
306
+ sheets: P
307
+ }, Z = {
308
+ ...p,
309
+ ...h,
308
310
  ...m,
309
311
  ...f,
310
312
  ...g,
311
- ...T,
312
- ...y,
313
- ...F,
314
- ...ee
315
- }, ae = ({ additionalFunctions: t, ...e } = {}) => p({ ...e, additionalFunctions: { ...c, ...t } }), ce = ({ additionalFunctions: t, ...e } = {}) => h({ ...e, additionalFunctions: { ...c, ...t } });
313
+ ...R,
314
+ ...Q
315
+ }, oe = ({ additionalFunctions: t, ...e } = {}) => d({ ...e, additionalFunctions: { ...Z, ...t } });
316
316
  export {
317
- c as allFunctions,
318
- ce as createSpellbook,
319
- c as default,
320
- ae as useSpellbook
317
+ Z as allFunctions,
318
+ oe as createSpellbook,
319
+ Z as default
321
320
  };
322
321
  //# sourceMappingURL=index.js.map