@jxsuite/formulas 0.0.21 → 0.0.22

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jxsuite/formulas",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "Composite pure formulas for Jx, authored as declarative $expression JSON",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -25,9 +25,9 @@
25
25
  "test": "bun test --isolate"
26
26
  },
27
27
  "dependencies": {
28
- "@jxsuite/schema": "^3.0.0"
28
+ "@jxsuite/schema": "^4.0.0"
29
29
  },
30
30
  "devDependencies": {
31
- "@jxsuite/runtime": "^4.1.0"
31
+ "@jxsuite/runtime": "^5.0.0"
32
32
  }
33
33
  }
package/src/catalog.ts CHANGED
@@ -534,4 +534,4 @@ export const catalog: FormulaCatalogEntry[] = [
534
534
  },
535
535
  ],
536
536
  },
537
- ] as unknown as FormulaCatalogEntry[];
537
+ ];
package/src/index.ts CHANGED
@@ -17,13 +17,14 @@ export type { FormulaCatalogEntry } from "./catalog.ts";
17
17
 
18
18
  /** The catalog as named-formula state entries, keyed by formula name. */
19
19
  export function formulaEntries(): Record<string, JxExpressionDef> {
20
- const entries: Record<string, JxExpressionDef> = {};
21
- for (const formula of catalog) {
22
- entries[formula.name] = {
23
- $description: formula.description,
24
- $expression: formula.expression,
25
- parameters: formula.parameters,
26
- };
27
- }
28
- return entries;
20
+ return Object.fromEntries(
21
+ catalog.map((formula): [string, JxExpressionDef] => [
22
+ formula.name,
23
+ {
24
+ $description: formula.description,
25
+ $expression: formula.expression,
26
+ parameters: formula.parameters,
27
+ },
28
+ ]),
29
+ );
29
30
  }