@infitx/decision 1.3.6 → 1.4.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.4.0](https://github.com/infitx-org/release-cd/compare/decision-v1.3.6...decision-v1.4.0) (2026-02-18)
4
+
5
+
6
+ ### Features
7
+
8
+ * allow triggering by rule name / index ([4f2eacd](https://github.com/infitx-org/release-cd/commit/4f2eacd1a03b8c8a9ca63dbb5335f64f081b7d4c))
9
+
3
10
  ## [1.3.6](https://github.com/infitx-org/release-cd/compare/decision-v1.3.5...decision-v1.3.6) (2026-02-11)
4
11
 
5
12
 
package/index.js CHANGED
@@ -21,7 +21,7 @@ module.exports = function decision(config) {
21
21
  const decisions = all ? [] : null;
22
22
  for (const index in rules) {
23
23
  const { rule = index, when, then } = rules[index];
24
- if (match(fact, when)) {
24
+ if (['string', 'number'].includes(typeof fact) ? rule === fact : match(fact, when)) {
25
25
  if (all) {
26
26
  Object.entries(typeof then === 'function' ? then(fact) : then).forEach(([decision, value]) => decisions.push({ rule, decision, ...value }));
27
27
  } else {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@infitx/decision",
3
- "version": "1.3.6",
3
+ "version": "1.4.0",
4
4
  "description": "Decision tables engine",
5
5
  "main": "index.js",
6
6
  "dependencies": {
7
7
  "yaml": "^2.8.2",
8
- "@infitx/match": "1.4.4"
8
+ "@infitx/match": "1.5.0"
9
9
  },
10
10
  "devDependencies": {
11
11
  "allure": "^3.1.0",