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

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 (254) hide show
  1. package/README.md +75 -0
  2. package/dist/index.d.ts +2 -4
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +87 -88
  5. package/dist/index.js.map +1 -1
  6. package/dist/information/index.d.ts +1 -1
  7. package/dist/information/index.d.ts.map +1 -1
  8. package/dist/information/isblank.d.ts +1 -1
  9. package/dist/information/isblank.d.ts.map +1 -1
  10. package/dist/information/isdate.d.ts +1 -1
  11. package/dist/information/isdate.d.ts.map +1 -1
  12. package/dist/information/isemail.d.ts +1 -1
  13. package/dist/information/isemail.d.ts.map +1 -1
  14. package/dist/information/iserr.d.ts +2 -2
  15. package/dist/information/iserr.d.ts.map +1 -1
  16. package/dist/information/iserror.d.ts +2 -2
  17. package/dist/information/iserror.d.ts.map +1 -1
  18. package/dist/information/isformula.d.ts +1 -1
  19. package/dist/information/isformula.d.ts.map +1 -1
  20. package/dist/information/islogical.d.ts +1 -1
  21. package/dist/information/islogical.d.ts.map +1 -1
  22. package/dist/information/isna.d.ts +2 -2
  23. package/dist/information/isna.d.ts.map +1 -1
  24. package/dist/information/isnontext.d.ts +1 -1
  25. package/dist/information/isnontext.d.ts.map +1 -1
  26. package/dist/information/isref.d.ts +2 -2
  27. package/dist/information/isref.d.ts.map +1 -1
  28. package/dist/information/istext.d.ts +1 -1
  29. package/dist/information/istext.d.ts.map +1 -1
  30. package/dist/information/n.d.ts +2 -2
  31. package/dist/information/n.d.ts.map +1 -1
  32. package/dist/information/na.d.ts +1 -1
  33. package/dist/information/na.d.ts.map +1 -1
  34. package/dist/information/sheets.d.ts +1 -1
  35. package/dist/information/sheets.d.ts.map +1 -1
  36. package/dist/logical/ifna.d.ts +1 -1
  37. package/dist/logical/ifna.d.ts.map +1 -1
  38. package/dist/logical/ifs.d.ts +1 -1
  39. package/dist/logical/ifs.d.ts.map +1 -1
  40. package/dist/logical/index.d.ts +1 -1
  41. package/dist/logical/index.d.ts.map +1 -1
  42. package/dist/logical/xor.d.ts +1 -1
  43. package/dist/logical/xor.d.ts.map +1 -1
  44. package/dist/lookup/column.d.ts +1 -1
  45. package/dist/lookup/column.d.ts.map +1 -1
  46. package/dist/lookup/columns.d.ts +2 -2
  47. package/dist/lookup/columns.d.ts.map +1 -1
  48. package/dist/lookup/hlookup.d.ts +1 -1
  49. package/dist/lookup/hlookup.d.ts.map +1 -1
  50. package/dist/lookup/index.d.ts +1 -1
  51. package/dist/lookup/index.d.ts.map +1 -1
  52. package/dist/lookup/index.js +1 -1
  53. package/dist/lookup/index.js.map +1 -1
  54. package/dist/lookup/indexFn.d.ts +2 -2
  55. package/dist/lookup/indexFn.d.ts.map +1 -1
  56. package/dist/lookup/match.d.ts +1 -1
  57. package/dist/lookup/match.d.ts.map +1 -1
  58. package/dist/lookup/row.d.ts +1 -1
  59. package/dist/lookup/row.d.ts.map +1 -1
  60. package/dist/lookup/rows.d.ts +2 -2
  61. package/dist/lookup/rows.d.ts.map +1 -1
  62. package/dist/lookup/sheet.d.ts +2 -2
  63. package/dist/lookup/sheet.d.ts.map +1 -1
  64. package/dist/lookup/vlookup.d.ts +1 -1
  65. package/dist/lookup/vlookup.d.ts.map +1 -1
  66. package/dist/math/__matrix_base.d.ts +1 -1
  67. package/dist/math/__matrix_base.d.ts.map +1 -1
  68. package/dist/math/acos.d.ts +1 -1
  69. package/dist/math/acos.d.ts.map +1 -1
  70. package/dist/math/asin.d.ts +1 -1
  71. package/dist/math/asin.d.ts.map +1 -1
  72. package/dist/math/atan.d.ts +1 -1
  73. package/dist/math/atan.d.ts.map +1 -1
  74. package/dist/math/atan2.d.ts +1 -1
  75. package/dist/math/atan2.d.ts.map +1 -1
  76. package/dist/math/base.d.ts +1 -1
  77. package/dist/math/base.d.ts.map +1 -1
  78. package/dist/math/cos.d.ts +1 -1
  79. package/dist/math/cos.d.ts.map +1 -1
  80. package/dist/math/countif.d.ts +1 -1
  81. package/dist/math/countif.d.ts.map +1 -1
  82. package/dist/math/countifs.d.ts +1 -1
  83. package/dist/math/countifs.d.ts.map +1 -1
  84. package/dist/math/even.d.ts +1 -1
  85. package/dist/math/even.d.ts.map +1 -1
  86. package/dist/math/exp.d.ts +1 -1
  87. package/dist/math/exp.d.ts.map +1 -1
  88. package/dist/math/fact.d.ts +1 -1
  89. package/dist/math/fact.d.ts.map +1 -1
  90. package/dist/math/index.d.ts +1 -1
  91. package/dist/math/index.d.ts.map +1 -1
  92. package/dist/math/index.js +1 -1
  93. package/dist/math/index.js.map +1 -1
  94. package/dist/math/int.d.ts +1 -1
  95. package/dist/math/int.d.ts.map +1 -1
  96. package/dist/math/iseven.d.ts +1 -1
  97. package/dist/math/iseven.d.ts.map +1 -1
  98. package/dist/math/isodd.d.ts +1 -1
  99. package/dist/math/isodd.d.ts.map +1 -1
  100. package/dist/math/lcm.d.ts +1 -1
  101. package/dist/math/lcm.d.ts.map +1 -1
  102. package/dist/math/ln.d.ts +1 -1
  103. package/dist/math/ln.d.ts.map +1 -1
  104. package/dist/math/log.d.ts +1 -1
  105. package/dist/math/log.d.ts.map +1 -1
  106. package/dist/math/log10.d.ts +1 -1
  107. package/dist/math/log10.d.ts.map +1 -1
  108. package/dist/math/mdeterm.d.ts +1 -1
  109. package/dist/math/mdeterm.d.ts.map +1 -1
  110. package/dist/math/minverse.d.ts +1 -1
  111. package/dist/math/minverse.d.ts.map +1 -1
  112. package/dist/math/mmult.d.ts +1 -1
  113. package/dist/math/mmult.d.ts.map +1 -1
  114. package/dist/math/mod.d.ts +1 -1
  115. package/dist/math/mod.d.ts.map +1 -1
  116. package/dist/math/odd.d.ts +1 -1
  117. package/dist/math/odd.d.ts.map +1 -1
  118. package/dist/math/pi.d.ts +1 -1
  119. package/dist/math/pi.d.ts.map +1 -1
  120. package/dist/math/product.d.ts +1 -1
  121. package/dist/math/product.d.ts.map +1 -1
  122. package/dist/math/radians.d.ts +1 -1
  123. package/dist/math/radians.d.ts.map +1 -1
  124. package/dist/math/rand.d.ts +1 -1
  125. package/dist/math/rand.d.ts.map +1 -1
  126. package/dist/math/round.d.ts +1 -1
  127. package/dist/math/round.d.ts.map +1 -1
  128. package/dist/math/rounddown.d.ts +1 -1
  129. package/dist/math/rounddown.d.ts.map +1 -1
  130. package/dist/math/roundup.d.ts +1 -1
  131. package/dist/math/roundup.d.ts.map +1 -1
  132. package/dist/math/sequence.d.ts +1 -1
  133. package/dist/math/sequence.d.ts.map +1 -1
  134. package/dist/math/sign.d.ts +1 -1
  135. package/dist/math/sign.d.ts.map +1 -1
  136. package/dist/math/sin.d.ts +1 -1
  137. package/dist/math/sin.d.ts.map +1 -1
  138. package/dist/math/sqrt.d.ts +1 -1
  139. package/dist/math/sqrt.d.ts.map +1 -1
  140. package/dist/math/sumif.d.ts +1 -1
  141. package/dist/math/sumif.d.ts.map +1 -1
  142. package/dist/math/sumifs.d.ts +1 -1
  143. package/dist/math/sumifs.d.ts.map +1 -1
  144. package/dist/math/sumproduct.d.ts +1 -1
  145. package/dist/math/sumproduct.d.ts.map +1 -1
  146. package/dist/math/sumsq.d.ts +1 -1
  147. package/dist/math/sumsq.d.ts.map +1 -1
  148. package/dist/math/tan.d.ts +1 -1
  149. package/dist/math/tan.d.ts.map +1 -1
  150. package/dist/math/transpose.d.ts +1 -1
  151. package/dist/math/transpose.d.ts.map +1 -1
  152. package/dist/math/trunc.d.ts +1 -1
  153. package/dist/math/trunc.d.ts.map +1 -1
  154. package/dist/math/unaryPercent.d.ts +1 -1
  155. package/dist/math/unaryPercent.d.ts.map +1 -1
  156. package/dist/math/uplus.d.ts +1 -1
  157. package/dist/math/uplus.d.ts.map +1 -1
  158. package/dist/statistics/averageif.d.ts +1 -1
  159. package/dist/statistics/averageif.d.ts.map +1 -1
  160. package/dist/statistics/averageifs.d.ts +2 -2
  161. package/dist/statistics/averageifs.d.ts.map +1 -1
  162. package/dist/statistics/correl.d.ts +1 -1
  163. package/dist/statistics/correl.d.ts.map +1 -1
  164. package/dist/statistics/covariance_p.d.ts +1 -1
  165. package/dist/statistics/covariance_p.d.ts.map +1 -1
  166. package/dist/statistics/covariance_s.d.ts +1 -1
  167. package/dist/statistics/covariance_s.d.ts.map +1 -1
  168. package/dist/statistics/index.d.ts +1 -1
  169. package/dist/statistics/index.d.ts.map +1 -1
  170. package/dist/statistics/index.js +1 -1
  171. package/dist/statistics/index.js.map +1 -1
  172. package/dist/statistics/median.d.ts +1 -1
  173. package/dist/statistics/median.d.ts.map +1 -1
  174. package/dist/statistics/mode_sngl.d.ts +1 -1
  175. package/dist/statistics/mode_sngl.d.ts.map +1 -1
  176. package/dist/statistics/percentile_inc.d.ts +1 -1
  177. package/dist/statistics/percentile_inc.d.ts.map +1 -1
  178. package/dist/statistics/quartile_inc.d.ts +1 -1
  179. package/dist/statistics/quartile_inc.d.ts.map +1 -1
  180. package/dist/statistics/rank_eq.d.ts +1 -1
  181. package/dist/statistics/rank_eq.d.ts.map +1 -1
  182. package/dist/statistics/rsq.d.ts +1 -1
  183. package/dist/statistics/rsq.d.ts.map +1 -1
  184. package/dist/statistics/stdev_p.d.ts +1 -1
  185. package/dist/statistics/stdev_p.d.ts.map +1 -1
  186. package/dist/statistics/stdev_s.d.ts +1 -1
  187. package/dist/statistics/stdev_s.d.ts.map +1 -1
  188. package/dist/statistics/t_test.d.ts +1 -1
  189. package/dist/statistics/t_test.d.ts.map +1 -1
  190. package/dist/statistics/var_p.d.ts +1 -1
  191. package/dist/statistics/var_p.d.ts.map +1 -1
  192. package/dist/statistics/var_s.d.ts +1 -1
  193. package/dist/statistics/var_s.d.ts.map +1 -1
  194. package/dist/text/char.d.ts +1 -1
  195. package/dist/text/char.d.ts.map +1 -1
  196. package/dist/text/clean.d.ts +1 -1
  197. package/dist/text/clean.d.ts.map +1 -1
  198. package/dist/text/concatenate.d.ts +1 -1
  199. package/dist/text/concatenate.d.ts.map +1 -1
  200. package/dist/text/exact.d.ts +1 -1
  201. package/dist/text/exact.d.ts.map +1 -1
  202. package/dist/text/index.d.ts +1 -1
  203. package/dist/text/index.d.ts.map +1 -1
  204. package/dist/text/index.js +1 -1
  205. package/dist/text/index.js.map +1 -1
  206. package/dist/text/join.d.ts +1 -1
  207. package/dist/text/join.d.ts.map +1 -1
  208. package/dist/text/lenb.d.ts +1 -1
  209. package/dist/text/lenb.d.ts.map +1 -1
  210. package/dist/text/lower.d.ts +2 -2
  211. package/dist/text/lower.d.ts.map +1 -1
  212. package/dist/text/proper.d.ts +1 -1
  213. package/dist/text/proper.d.ts.map +1 -1
  214. package/dist/text/replace.d.ts +1 -1
  215. package/dist/text/replace.d.ts.map +1 -1
  216. package/dist/text/rept.d.ts +1 -1
  217. package/dist/text/rept.d.ts.map +1 -1
  218. package/dist/text/trim.d.ts +2 -2
  219. package/dist/text/trim.d.ts.map +1 -1
  220. package/dist/text/unichar.d.ts +1 -1
  221. package/dist/text/unichar.d.ts.map +1 -1
  222. package/dist/text/unicode.d.ts +1 -1
  223. package/dist/text/unicode.d.ts.map +1 -1
  224. package/dist/text/upper.d.ts +2 -2
  225. package/dist/text/upper.d.ts.map +1 -1
  226. package/dist/time/date.d.ts +1 -1
  227. package/dist/time/date.d.ts.map +1 -1
  228. package/dist/time/day.d.ts +2 -2
  229. package/dist/time/day.d.ts.map +1 -1
  230. package/dist/time/days.d.ts +1 -1
  231. package/dist/time/days.d.ts.map +1 -1
  232. package/dist/time/hour.d.ts +2 -2
  233. package/dist/time/hour.d.ts.map +1 -1
  234. package/dist/time/index.d.ts +1 -1
  235. package/dist/time/index.d.ts.map +1 -1
  236. package/dist/time/index.js +41 -53
  237. package/dist/time/index.js.map +1 -1
  238. package/dist/time/minute.d.ts +2 -2
  239. package/dist/time/minute.d.ts.map +1 -1
  240. package/dist/time/month.d.ts +2 -2
  241. package/dist/time/month.d.ts.map +1 -1
  242. package/dist/time/second.d.ts +2 -2
  243. package/dist/time/second.d.ts.map +1 -1
  244. package/dist/time/time.d.ts +2 -2
  245. package/dist/time/time.d.ts.map +1 -1
  246. package/dist/time/today.d.ts +1 -1
  247. package/dist/time/today.d.ts.map +1 -1
  248. package/dist/time/workday.d.ts +1 -1
  249. package/dist/time/workday.d.ts.map +1 -1
  250. package/dist/time/year.d.ts +2 -2
  251. package/dist/time/year.d.ts.map +1 -1
  252. package/package.json +3 -3
  253. package/dist/time/__utils.d.ts +0 -6
  254. package/dist/time/__utils.d.ts.map +0 -1
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
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/logical/xor.ts","../src/logical/ifna.ts","../src/logical/ifs.ts","../src/logical/index.ts","../src/information/isformula.ts","../src/information/isblank.ts","../src/information/iserr.ts","../src/information/iserror.ts","../src/information/islogical.ts","../src/information/isna.ts","../src/information/isnontext.ts","../src/information/istext.ts","../src/information/isref.ts","../src/information/n.ts","../src/information/na.ts","../src/information/isdate.ts","../src/information/isemail.ts","../src/information/sheets.ts","../src/information/index.ts","../src/index.ts"],"sourcesContent":["import { FormulaError } from '@gridsheet/react-core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport { ensureBoolean } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns TRUE if an odd number of the arguments are logically true.\nReturns FALSE if an even number of the arguments are logically true.`;\n\nexport class XorFunction extends BaseFunction {\n example = 'XOR(A1=1, A2=2)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'expression', description: 'Logical expressions to evaluate.', acceptedTypes: ['boolean'], variadic: true },\n ];\n category: FunctionCategory = 'logical';\n\n protected main(...values: boolean[]) {\n // XOR is true when an odd number of arguments are true\n return values.reduce((acc, val) => acc !== val, false as boolean);\n }\n}\n","import { BaseFunction, FormulaError } from '@gridsheet/react-core';\nimport { type FunctionArgumentDefinition } from '@gridsheet/react-core';\n\nconst description = `Returns the first argument if it is not a #N/A error, otherwise returns the second argument.`;\n\nexport class IfnaFunction extends BaseFunction {\n static __name = 'IFNA';\n example = 'IFNA(A1, \"N/A error occurred\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to return if it is not a #N/A error.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n {\n name: 'value_if_na',\n description: 'The value to return if the first argument is a #N/A error.',\n optional: true,\n acceptedTypes: ['any'],\n },\n ];\n\n category = 'logical' as const;\n\n protected main(value: any, valueIfNa?: any) {\n if (FormulaError.is(value) && value.code === '#N/A') {\n return valueIfNa;\n }\n return value;\n }\n}\n","import { BaseFunction, FormulaError } from '@gridsheet/react-core';\nimport { type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport { ensureBoolean } from '@gridsheet/react-core';\n\nconst description = `Evaluates multiple conditions and returns the value corresponding to the first TRUE condition.\nArguments must be supplied in (condition, value) pairs.`;\n\nexport class IfsFunction extends BaseFunction {\n example = 'IFS(A1>90, \"A\", A1>70, \"B\", A1>50, \"C\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'condition', description: 'Condition to evaluate.', acceptedTypes: ['boolean'], variadic: true },\n { name: 'value', description: 'Value to return if condition is TRUE.', acceptedTypes: ['any'], variadic: true },\n ];\n category = 'logical' as const;\n\n protected validate(args: any[]): any[] {\n if (args.length < 2) {\n throw new FormulaError('#N/A', 'IFS requires at least one condition-value pair.');\n }\n if (args.length % 2 !== 0) {\n throw new FormulaError('#N/A', 'IFS requires an even number of arguments (condition, value) pairs.');\n }\n for (let i = 0; i < args.length; i += 2) {\n if (ensureBoolean(args[i])) {\n return [args[i + 1]];\n }\n }\n throw new FormulaError('#N/A', 'No condition in IFS was met.');\n }\n\n protected main(result: any) {\n return result;\n }\n}\n","import type { FunctionMapping } from '@gridsheet/react-core';\nimport { XorFunction } from './xor';\nimport { IfnaFunction } from './ifna';\nimport { IfsFunction } from './ifs';\n\nexport const logicalFunctions: FunctionMapping = {\n xor: XorFunction,\n ifna: IfnaFunction,\n ifs: IfsFunction,\n};\n\nexport default logicalFunctions;\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport { Sheet } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns TRUE if the referenced cell contains a formula.`;\n\nexport class IsformulaFunction extends BaseFunction {\n example = 'ISFORMULA(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'reference',\n description: 'The cell reference to check for a formula.',\n acceptedTypes: ['reference'],\n takesMatrix: true,\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(ref: Sheet) {\n const cell = ref.getCell({ y: ref.top, x: ref.left }, { resolution: 'SYSTEM' });\n const raw = cell?.value;\n return typeof raw === 'string' && raw.startsWith('=');\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns TRUE if the referenced cell is empty.`;\n\nexport class IsblankFunction extends BaseFunction {\n example = 'ISBLANK(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'A reference to a cell to check for emptiness.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return value === null || value === undefined || value === '';\n }\n}\n","import { BaseFunction, FormulaError } from '@gridsheet/react-core';\nimport type { FunctionArgumentDefinition, FunctionProps } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\nimport { Sheet } from '@gridsheet/react-core';\n\nconst description = `Returns TRUE if the value is any error other than #N/A.`;\n\nexport class IserrFunction extends BaseFunction {\n example = 'ISERR(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for a non-#N/A error.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n if (value instanceof Error) {\n return true;\n }\n return FormulaError.is(value) && value.code !== '#N/A';\n }\n}\n","import { BaseFunction, FormulaError } from '@gridsheet/react-core';\nimport type { FunctionArgumentDefinition, FunctionProps } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns TRUE if the value is any error value.`;\n\nexport class IserrorFunction extends BaseFunction {\n example = 'ISERROR(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for an error.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return FormulaError.is(value) || value instanceof Error;\n }\n}\n","import { FormulaError } from '@gridsheet/react-core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns TRUE if the value is TRUE or FALSE.`;\n\nexport class IslogicalFunction extends BaseFunction {\n example = 'ISLOGICAL(TRUE)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for being logical (TRUE or FALSE).',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return typeof value === 'boolean';\n }\n}\n","import { BaseFunction, FormulaError } from '@gridsheet/react-core';\nimport type { FunctionArgumentDefinition, FunctionProps } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\nimport { Sheet } from '@gridsheet/react-core';\n\nconst description = `Returns TRUE if the value is the #N/A error value.`;\n\nexport class IsnaFunction extends BaseFunction {\n example = 'ISNA(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for the #N/A error.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return FormulaError.is(value) && value.code === '#N/A';\n }\n}\n","import { FormulaError } from '@gridsheet/react-core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns TRUE if the value is not a text string.`;\n\nexport class IsnontextFunction extends BaseFunction {\n example = 'ISNONTEXT(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for being non-text.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return typeof value !== 'string';\n }\n}\n","import { FormulaError } from '@gridsheet/react-core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns TRUE if the value is a text string.`;\n\nexport class IstextFunction extends BaseFunction {\n example = 'ISTEXT(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for being text.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return typeof value === 'string';\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport { Sheet } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns TRUE if the value is a valid cell reference.`;\n\nexport class IsrefFunction extends BaseFunction {\n example = 'ISREF(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for being a cell reference.',\n acceptedTypes: ['any'],\n takesMatrix: true,\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return Sheet.is(value);\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport { ensureNumber } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns the argument provided as a number.`;\n\nexport class NFunction extends BaseFunction {\n example = 'N(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to convert to a number.',\n acceptedTypes: ['any'],\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n if (typeof value === 'boolean') {\n return value ? 1 : 0;\n }\n if (value instanceof Date) {\n return value.getTime();\n }\n if (value === null || value === undefined || value === '') {\n return 0;\n }\n try {\n return ensureNumber(value);\n } catch {\n return 0;\n }\n }\n}\n","import { FormulaError } from '@gridsheet/react-core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns the error value #N/A, meaning \"value not available\".`;\n\nexport class NaFunction extends BaseFunction {\n example = 'NA()';\n description = description;\n defs: FunctionArgumentDefinition[] = [];\n category: FunctionCategory = 'information';\n\n protected main() {\n throw new FormulaError('#N/A', 'N/A');\n }\n}\n","import { FormulaError } from '@gridsheet/react-core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns TRUE if the value is a date.`;\n\nexport class IsdateFunction extends BaseFunction {\n example = 'ISDATE(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for being a date.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return value instanceof Date && !isNaN(value.getTime());\n }\n}\n","import { FormulaError } from '@gridsheet/react-core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst EMAIL_REGEX = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\nconst description = `Returns TRUE if the value is a valid email address.`;\n\nexport class IsemailFunction extends BaseFunction {\n example = 'ISEMAIL(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for being a valid email address.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n if (typeof value !== 'string') {\n return false;\n }\n return EMAIL_REGEX.test(value);\n }\n}\n","import { FormulaError } from '@gridsheet/react-core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/react-core';\nimport type { FunctionCategory } from '@gridsheet/react-core';\n\nconst description = `Returns the total number of sheets in the spreadsheet.`;\n\nexport class SheetsFunction extends BaseFunction {\n example = 'SHEETS()';\n description = description;\n defs: FunctionArgumentDefinition[] = [];\n category: FunctionCategory = 'information';\n\n protected main() {\n const sheetIdsByName = this.sheet.registry.sheetIdsByName;\n const count = Object.keys(sheetIdsByName).length;\n // If wire has no registered sheets (e.g. standalone sheet), return 1\n return count === 0 ? 1 : count;\n }\n}\n","import type { FunctionMapping } from '@gridsheet/react-core';\nimport { IsformulaFunction } from './isformula';\nimport { IsblankFunction } from './isblank';\nimport { IserrFunction } from './iserr';\nimport { IserrorFunction } from './iserror';\nimport { IslogicalFunction } from './islogical';\nimport { IsnaFunction } from './isna';\nimport { IsnontextFunction } from './isnontext';\nimport { IstextFunction } from './istext';\nimport { IsrefFunction } from './isref';\nimport { NFunction } from './n';\nimport { NaFunction } from './na';\nimport { IsdateFunction } from './isdate';\nimport { IsemailFunction } from './isemail';\nimport { SheetsFunction } from './sheets';\n\nexport const informationFunctions: FunctionMapping = {\n isformula: IsformulaFunction,\n isblank: IsblankFunction,\n iserr: IserrFunction,\n iserror: IserrorFunction,\n islogical: IslogicalFunction,\n isna: IsnaFunction,\n isnontext: IsnontextFunction,\n istext: IstextFunction,\n isref: IsrefFunction,\n n: NFunction,\n na: NaFunction,\n isdate: IsdateFunction,\n isemail: IsemailFunction,\n sheets: SheetsFunction,\n};\n\nexport default informationFunctions;\n","import type { FunctionMapping, RegistryProps } from '@gridsheet/react-core';\nimport { useBook, createBook } from '@gridsheet/react-core';\nimport { mathFunctions } from './math';\nimport { statisticsFunctions } from './statistics';\nimport { textFunctions } from './text';\nimport { lookupFunctions } from './lookup';\nimport { timeFunctions } from './time';\nimport { logicalFunctions } from './logical';\nimport { informationFunctions } from './information';\n\n/** All extended functions combined into a single FunctionMapping. */\nexport const allFunctions: FunctionMapping = {\n ...mathFunctions,\n ...statisticsFunctions,\n ...textFunctions,\n ...lookupFunctions,\n ...timeFunctions,\n ...logicalFunctions,\n ...informationFunctions,\n};\n\n/** useBook with all extended functions pre-loaded. User-supplied additionalFunctions are merged on top. */\nexport const useSpellbook = ({ additionalFunctions, ...rest }: RegistryProps = {}) =>\n useBook({ ...rest, additionalFunctions: { ...allFunctions, ...additionalFunctions } });\n\n/** createBook with all extended functions pre-loaded. User-supplied additionalFunctions are merged on top. */\nexport const createSpellbook = ({ additionalFunctions, ...rest }: RegistryProps = {}) =>\n createBook({ ...rest, additionalFunctions: { ...allFunctions, ...additionalFunctions } });\n\nexport default allFunctions;\n"],"names":["description","XorFunction","BaseFunction","values","acc","val","_IfnaFunction","value","valueIfNa","FormulaError","IfnaFunction","IfsFunction","args","i","ensureBoolean","result","logicalFunctions","IsformulaFunction","ref","cell","raw","IsblankFunction","IserrFunction","IserrorFunction","IslogicalFunction","IsnaFunction","IsnontextFunction","IstextFunction","IsrefFunction","Sheet","NFunction","ensureNumber","NaFunction","IsdateFunction","EMAIL_REGEX","IsemailFunction","SheetsFunction","sheetIdsByName","count","informationFunctions","allFunctions","mathFunctions","statisticsFunctions","textFunctions","lookupFunctions","timeFunctions","useSpellbook","additionalFunctions","rest","useBook","createSpellbook","createBook"],"mappings":";;;;;;AAKA,MAAMA,IAAc;AAAA;AAGb,MAAMC,UAAoBC,EAAa;AAAA,EAAvC,cAAA;AAAA,UAAA,GAAA,SAAA,GACK,KAAA,UA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A,EACX,QAAQC;AAAA,EACR,OAAOC;AAAA,EACP,GAAGE;AAAA,EACH,IAAIE;AAAA,EACJ,QAAQC;AAAA,EACR,SAASE;AAAA,EACT,QAAQC;AACV,GCpBaI,IAAgC;AAAA,EAC3C,GAAGC;AAAA,EACH,GAAGC;AAAA,EACH,GAAGC;AAAA,EACH,GAAGC;AAAA,EACH,GAAGC;AAAA,EACH,GAAG7B;AAAA,EACH,GAAGuB;AACL,GAGaO,KAAe,CAAC,EAAE,qBAAAC,GAAqB,GAAGC,EAAK,IAAmB,CAAA,MAC7EC,EAAQ,EAAE,GAAGD,GAAM,qBAAqB,EAAE,GAAGR,GAAc,GAAGO,EAAA,EAAuB,CAAA,GAG1EG,KAAkB,CAAC,EAAE,qBAAAH,GAAqB,GAAGC,EAAK,IAAmB,CAAA,MAChFG,EAAW,EAAE,GAAGH,GAAM,qBAAqB,EAAE,GAAGR,GAAc,GAAGO,EAAA,EAAuB,CAAA;"}
1
+ {"version":3,"file":"index.js","sources":["../src/logical/xor.ts","../src/logical/ifna.ts","../src/logical/ifs.ts","../src/logical/index.ts","../src/information/isformula.ts","../src/information/isblank.ts","../src/information/iserr.ts","../src/information/iserror.ts","../src/information/islogical.ts","../src/information/isna.ts","../src/information/isnontext.ts","../src/information/istext.ts","../src/information/isref.ts","../src/information/n.ts","../src/information/na.ts","../src/information/isdate.ts","../src/information/isemail.ts","../src/information/sheets.ts","../src/information/index.ts","../src/index.ts"],"sourcesContent":["import { FormulaError } from '@gridsheet/core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport { ensureBoolean } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns TRUE if an odd number of the arguments are logically true.\nReturns FALSE if an even number of the arguments are logically true.`;\n\nexport class XorFunction extends BaseFunction {\n example = 'XOR(A1=1, A2=2)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'expression', description: 'Logical expressions to evaluate.', acceptedTypes: ['boolean'], variadic: true },\n ];\n category: FunctionCategory = 'logical';\n\n protected main(...values: boolean[]) {\n // XOR is true when an odd number of arguments are true\n return values.reduce((acc, val) => acc !== val, false as boolean);\n }\n}\n","import { BaseFunction, FormulaError } from '@gridsheet/core';\nimport { type FunctionArgumentDefinition } from '@gridsheet/core';\n\nconst description = `Returns the first argument if it is not a #N/A error, otherwise returns the second argument.`;\n\nexport class IfnaFunction extends BaseFunction {\n static __name = 'IFNA';\n example = 'IFNA(A1, \"N/A error occurred\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to return if it is not a #N/A error.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n {\n name: 'value_if_na',\n description: 'The value to return if the first argument is a #N/A error.',\n optional: true,\n acceptedTypes: ['any'],\n },\n ];\n\n category = 'logical' as const;\n\n protected main(value: any, valueIfNa?: any) {\n if (FormulaError.is(value) && value.code === '#N/A') {\n return valueIfNa;\n }\n return value;\n }\n}\n","import { BaseFunction, FormulaError } from '@gridsheet/core';\nimport { type FunctionArgumentDefinition } from '@gridsheet/core';\nimport { ensureBoolean } from '@gridsheet/core';\n\nconst description = `Evaluates multiple conditions and returns the value corresponding to the first TRUE condition.\nArguments must be supplied in (condition, value) pairs.`;\n\nexport class IfsFunction extends BaseFunction {\n example = 'IFS(A1>90, \"A\", A1>70, \"B\", A1>50, \"C\")';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n { name: 'condition', description: 'Condition to evaluate.', acceptedTypes: ['boolean'], variadic: true },\n { name: 'value', description: 'Value to return if condition is TRUE.', acceptedTypes: ['any'], variadic: true },\n ];\n category = 'logical' as const;\n\n protected validate(args: any[]): any[] {\n if (args.length < 2) {\n throw new FormulaError('#N/A', 'IFS requires at least one condition-value pair.');\n }\n if (args.length % 2 !== 0) {\n throw new FormulaError('#N/A', 'IFS requires an even number of arguments (condition, value) pairs.');\n }\n for (let i = 0; i < args.length; i += 2) {\n if (ensureBoolean(args[i])) {\n return [args[i + 1]];\n }\n }\n throw new FormulaError('#N/A', 'No condition in IFS was met.');\n }\n\n protected main(result: any) {\n return result;\n }\n}\n","import type { FunctionMapping } from '@gridsheet/core';\nimport { XorFunction } from './xor';\nimport { IfnaFunction } from './ifna';\nimport { IfsFunction } from './ifs';\n\nexport const logicalFunctions: FunctionMapping = {\n xor: XorFunction,\n ifna: IfnaFunction,\n ifs: IfsFunction,\n};\n\nexport default logicalFunctions;\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport { Sheet } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns TRUE if the referenced cell contains a formula.`;\n\nexport class IsformulaFunction extends BaseFunction {\n example = 'ISFORMULA(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'reference',\n description: 'The cell reference to check for a formula.',\n acceptedTypes: ['reference'],\n takesMatrix: true,\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(ref: Sheet) {\n const cell = ref.getCell({ y: ref.top, x: ref.left }, { resolution: 'SYSTEM' });\n const raw = cell?.value;\n return typeof raw === 'string' && raw.startsWith('=');\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns TRUE if the referenced cell is empty.`;\n\nexport class IsblankFunction extends BaseFunction {\n example = 'ISBLANK(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'A reference to a cell to check for emptiness.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return value === null || value === undefined || value === '';\n }\n}\n","import { BaseFunction, FormulaError } from '@gridsheet/core';\nimport type { FunctionArgumentDefinition, FunctionProps } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\nimport { Sheet } from '@gridsheet/core';\n\nconst description = `Returns TRUE if the value is any error other than #N/A.`;\n\nexport class IserrFunction extends BaseFunction {\n example = 'ISERR(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for a non-#N/A error.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n if (value instanceof Error) {\n return true;\n }\n return FormulaError.is(value) && value.code !== '#N/A';\n }\n}\n","import { BaseFunction, FormulaError } from '@gridsheet/core';\nimport type { FunctionArgumentDefinition, FunctionProps } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns TRUE if the value is any error value.`;\n\nexport class IserrorFunction extends BaseFunction {\n example = 'ISERROR(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for an error.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return FormulaError.is(value) || value instanceof Error;\n }\n}\n","import { FormulaError } from '@gridsheet/core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns TRUE if the value is TRUE or FALSE.`;\n\nexport class IslogicalFunction extends BaseFunction {\n example = 'ISLOGICAL(TRUE)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for being logical (TRUE or FALSE).',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return typeof value === 'boolean';\n }\n}\n","import { BaseFunction, FormulaError } from '@gridsheet/core';\nimport type { FunctionArgumentDefinition, FunctionProps } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\nimport { Sheet } from '@gridsheet/core';\n\nconst description = `Returns TRUE if the value is the #N/A error value.`;\n\nexport class IsnaFunction extends BaseFunction {\n example = 'ISNA(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for the #N/A error.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return FormulaError.is(value) && value.code === '#N/A';\n }\n}\n","import { FormulaError } from '@gridsheet/core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns TRUE if the value is not a text string.`;\n\nexport class IsnontextFunction extends BaseFunction {\n example = 'ISNONTEXT(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for being non-text.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return typeof value !== 'string';\n }\n}\n","import { FormulaError } from '@gridsheet/core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns TRUE if the value is a text string.`;\n\nexport class IstextFunction extends BaseFunction {\n example = 'ISTEXT(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for being text.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return typeof value === 'string';\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport { Sheet } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns TRUE if the value is a valid cell reference.`;\n\nexport class IsrefFunction extends BaseFunction {\n example = 'ISREF(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for being a cell reference.',\n acceptedTypes: ['any'],\n takesMatrix: true,\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return Sheet.is(value);\n }\n}\n","import { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport { ensureNumber } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns the argument provided as a number.`;\n\nexport class NFunction extends BaseFunction {\n example = 'N(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to convert to a number.',\n acceptedTypes: ['any'],\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n if (typeof value === 'boolean') {\n return value ? 1 : 0;\n }\n if (value instanceof Date) {\n return value.getTime();\n }\n if (value === null || value === undefined || value === '') {\n return 0;\n }\n try {\n return ensureNumber(value);\n } catch {\n return 0;\n }\n }\n}\n","import { FormulaError } from '@gridsheet/core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns the error value #N/A, meaning \"value not available\".`;\n\nexport class NaFunction extends BaseFunction {\n example = 'NA()';\n description = description;\n defs: FunctionArgumentDefinition[] = [];\n category: FunctionCategory = 'information';\n\n protected main() {\n throw new FormulaError('#N/A', 'N/A');\n }\n}\n","import { FormulaError } from '@gridsheet/core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns TRUE if the value is a date.`;\n\nexport class IsdateFunction extends BaseFunction {\n example = 'ISDATE(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for being a date.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n return value instanceof Date && !isNaN(value.getTime());\n }\n}\n","import { FormulaError } from '@gridsheet/core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst EMAIL_REGEX = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\nconst description = `Returns TRUE if the value is a valid email address.`;\n\nexport class IsemailFunction extends BaseFunction {\n example = 'ISEMAIL(A1)';\n description = description;\n defs: FunctionArgumentDefinition[] = [\n {\n name: 'value',\n description: 'The value to check for being a valid email address.',\n acceptedTypes: ['any'],\n errorTolerant: true,\n },\n ];\n category: FunctionCategory = 'information';\n\n protected main(value: any) {\n if (typeof value !== 'string') {\n return false;\n }\n return EMAIL_REGEX.test(value);\n }\n}\n","import { FormulaError } from '@gridsheet/core';\nimport { BaseFunction, type FunctionArgumentDefinition } from '@gridsheet/core';\nimport type { FunctionCategory } from '@gridsheet/core';\n\nconst description = `Returns the total number of sheets in the spreadsheet.`;\n\nexport class SheetsFunction extends BaseFunction {\n example = 'SHEETS()';\n description = description;\n defs: FunctionArgumentDefinition[] = [];\n category: FunctionCategory = 'information';\n\n protected main() {\n const sheetIdsByName = this.sheet.registry.sheetIdsByName;\n const count = Object.keys(sheetIdsByName).length;\n // If wire has no registered sheets (e.g. standalone sheet), return 1\n return count === 0 ? 1 : count;\n }\n}\n","import type { FunctionMapping } from '@gridsheet/core';\nimport { IsformulaFunction } from './isformula';\nimport { IsblankFunction } from './isblank';\nimport { IserrFunction } from './iserr';\nimport { IserrorFunction } from './iserror';\nimport { IslogicalFunction } from './islogical';\nimport { IsnaFunction } from './isna';\nimport { IsnontextFunction } from './isnontext';\nimport { IstextFunction } from './istext';\nimport { IsrefFunction } from './isref';\nimport { NFunction } from './n';\nimport { NaFunction } from './na';\nimport { IsdateFunction } from './isdate';\nimport { IsemailFunction } from './isemail';\nimport { SheetsFunction } from './sheets';\n\nexport const informationFunctions: FunctionMapping = {\n isformula: IsformulaFunction,\n isblank: IsblankFunction,\n iserr: IserrFunction,\n iserror: IserrorFunction,\n islogical: IslogicalFunction,\n isna: IsnaFunction,\n isnontext: IsnontextFunction,\n istext: IstextFunction,\n isref: IsrefFunction,\n n: NFunction,\n na: NaFunction,\n isdate: IsdateFunction,\n isemail: IsemailFunction,\n sheets: SheetsFunction,\n};\n\nexport default informationFunctions;\n","import type { FunctionMapping, RegistryProps } from '@gridsheet/core';\nimport { createBook } from '@gridsheet/core';\nimport { mathFunctions } from './math';\nimport { statisticsFunctions } from './statistics';\nimport { textFunctions } from './text';\nimport { lookupFunctions } from './lookup';\nimport { timeFunctions } from './time';\nimport { logicalFunctions } from './logical';\nimport { informationFunctions } from './information';\n\n/** All extended functions combined into a single FunctionMapping. */\nexport const allFunctions: FunctionMapping = {\n ...mathFunctions,\n ...statisticsFunctions,\n ...textFunctions,\n ...lookupFunctions,\n ...timeFunctions,\n ...logicalFunctions,\n ...informationFunctions,\n};\n\n/** createBook with all extended functions pre-loaded. User-supplied additionalFunctions are merged on top. */\nexport const createSpellbook = ({ additionalFunctions, ...rest }: RegistryProps = {}) =>\n createBook({ ...rest, additionalFunctions: { ...allFunctions, ...additionalFunctions } });\n\nexport default allFunctions;\n"],"names":["description","XorFunction","BaseFunction","values","acc","val","_IfnaFunction","value","valueIfNa","FormulaError","IfnaFunction","IfsFunction","args","i","ensureBoolean","result","logicalFunctions","IsformulaFunction","ref","cell","raw","IsblankFunction","IserrFunction","IserrorFunction","IslogicalFunction","IsnaFunction","IsnontextFunction","IstextFunction","IsrefFunction","Sheet","NFunction","ensureNumber","NaFunction","IsdateFunction","EMAIL_REGEX","IsemailFunction","SheetsFunction","sheetIdsByName","count","informationFunctions","allFunctions","mathFunctions","statisticsFunctions","textFunctions","lookupFunctions","timeFunctions","createSpellbook","additionalFunctions","rest","createBook"],"mappings":";;;;;;AAKA,MAAMA,IAAc;AAAA;AAGb,MAAMC,UAAoBC,EAAa;AAAA,EAAvC,cAAA;AAAA,UAAA,GAAA,SAAA,GACK,KAAA,UAAA,mBACI,KAAA,cAAAF,GACuB,KAAA,OAAA;AAAA,MACnC,EAAE,MAAM,cAAc,aAAa,oCAAoC,eAAe,CAAC,SAAS,GAAG,UAAU,GAAK;AAAA,IACpH,GAC6B,KAAA,WAAA;AAAA,EAAA;AAAA,EAEnB,QAAQG,GAAmB;AAEnC,WAAOA,EAAO,OAAO,CAAC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,EACH,GAAGC;AAAA,EACH,GAAG7B;AAAA,EACH,GAAGuB;AACL,GAGaO,KAAkB,CAAC,EAAE,qBAAAC,GAAqB,GAAGC,EAAK,IAAmB,CAAA,MAChFC,EAAW,EAAE,GAAGD,GAAM,qBAAqB,EAAE,GAAGR,GAAc,GAAGO,EAAA,EAAuB,CAAA;"}
@@ -1,4 +1,4 @@
1
- import { FunctionMapping } from '@gridsheet/react-core';
1
+ import { FunctionMapping } from '@gridsheet/core';
2
2
  export declare const informationFunctions: FunctionMapping;
3
3
  export default informationFunctions;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/information/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAgB7D,eAAO,MAAM,oBAAoB,EAAE,eAelC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/information/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAgBvD,eAAO,MAAM,oBAAoB,EAAE,eAelC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class IsblankFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"isblank.d.ts","sourceRoot":"","sources":["../../src/information/isblank.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,SAAiB;IACxB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAOhC;IACF,QAAQ,EAAE,gBAAgB,CAAiB;IAE3C,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG;CAG1B"}
1
+ {"version":3,"file":"isblank.d.ts","sourceRoot":"","sources":["../../src/information/isblank.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,SAAiB;IACxB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAOhC;IACF,QAAQ,EAAE,gBAAgB,CAAiB;IAE3C,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG;CAG1B"}
@@ -1,4 +1,4 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class IsdateFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"isdate.d.ts","sourceRoot":"","sources":["../../src/information/isdate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,qBAAa,cAAe,SAAQ,YAAY;IAC9C,OAAO,SAAgB;IACvB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAOhC;IACF,QAAQ,EAAE,gBAAgB,CAAiB;IAE3C,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG;CAG1B"}
1
+ {"version":3,"file":"isdate.d.ts","sourceRoot":"","sources":["../../src/information/isdate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,qBAAa,cAAe,SAAQ,YAAY;IAC9C,OAAO,SAAgB;IACvB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAOhC;IACF,QAAQ,EAAE,gBAAgB,CAAiB;IAE3C,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG;CAG1B"}
@@ -1,4 +1,4 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class IsemailFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"isemail.d.ts","sourceRoot":"","sources":["../../src/information/isemail.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAM9D,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,SAAiB;IACxB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAOhC;IACF,QAAQ,EAAE,gBAAgB,CAAiB;IAE3C,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG;CAM1B"}
1
+ {"version":3,"file":"isemail.d.ts","sourceRoot":"","sources":["../../src/information/isemail.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAMxD,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,SAAiB;IACxB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAOhC;IACF,QAAQ,EAAE,gBAAgB,CAAiB;IAE3C,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG;CAM1B"}
@@ -1,9 +1,9 @@
1
- import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/react-core';
1
+ import { BaseFunction, FunctionArgumentDefinition, FunctionCategory } from '@gridsheet/core';
2
2
  export declare class IserrFunction extends BaseFunction {
3
3
  example: string;
4
4
  description: string;
5
5
  defs: FunctionArgumentDefinition[];
6
6
  category: FunctionCategory;
7
- protected main(value: any): boolean;
7
+ protected main(value: any): any;
8
8
  }
9
9
  //# sourceMappingURL=iserr.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"iserr.d.ts","sourceRoot":"","sources":["../../src/information/iserr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAgB,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,0BAA0B,EAAiB,MAAM,uBAAuB,CAAC;AACvF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAK9D,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,SAAe;IACtB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAOhC;IACF,QAAQ,EAAE,gBAAgB,CAAiB;IAE3C,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG;CAM1B"}
1
+ {"version":3,"file":"iserr.d.ts","sourceRoot":"","sources":["../../src/information/iserr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAgB,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,0BAA0B,EAAiB,MAAM,iBAAiB,CAAC;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKxD,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,SAAe;IACtB,WAAW,SAAe;IAC1B,IAAI,EAAE,0BAA0B,EAAE,CAOhC;IACF,QAAQ,EAAE,gBAAgB,CAAiB;IAE3C,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG;CAM1B"}