@infitx/decision 1.3.2 → 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.
Files changed (3) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/index.js +1 -1
  3. package/package.json +26 -23
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
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
+
10
+ ## [1.3.6](https://github.com/infitx-org/release-cd/compare/decision-v1.3.5...decision-v1.3.6) (2026-02-11)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * update dependencies for lodash and yaml to latest versions ([693ef9a](https://github.com/infitx-org/release-cd/commit/693ef9a27cc15775f2f4437aed489bd256abdeb9))
16
+
17
+ ## [1.3.5](https://github.com/infitx-org/release-cd/compare/decision-v1.3.4...decision-v1.3.5) (2026-02-10)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * update ci-publish script to use the correct command for publishing ([4520387](https://github.com/infitx-org/release-cd/commit/45203872d97dd40937a9bfb484adf6f95b913497))
23
+ * update ci-publish script to use the correct command for publishing ([cf3a49a](https://github.com/infitx-org/release-cd/commit/cf3a49a1c3682b7ed45de83f1f38ed5237f3cf88))
24
+
25
+ ## [1.3.4](https://github.com/infitx-org/release-cd/compare/decision-v1.3.3...decision-v1.3.4) (2026-02-10)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * update ci-publish script to use the correct command for publishing ([49ea1cb](https://github.com/infitx-org/release-cd/commit/49ea1cbc57d671c62c1bab43f3006b251c6bb725))
31
+
32
+ ## [1.3.3](https://github.com/infitx-org/release-cd/compare/decision-v1.3.2...decision-v1.3.3) (2026-02-10)
33
+
34
+
35
+ ### Bug Fixes
36
+
37
+ * update Jest configuration and dependencies for Allure integration ([059d3d9](https://github.com/infitx-org/release-cd/commit/059d3d9c5c6bdd00cd173f6de55629212d3aaa9a))
38
+
3
39
  ## [1.3.2](https://github.com/infitx-org/release-cd/compare/decision-v1.3.1...decision-v1.3.2) (2026-02-09)
4
40
 
5
41
 
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,25 +1,28 @@
1
1
  {
2
- "name": "@infitx/decision",
3
- "version": "1.3.2",
4
- "description": "Decision tables engine",
5
- "main": "index.js",
6
- "scripts": {
7
- "build": "true",
8
- "ci-unit": "JEST_JUNIT_OUTPUT_DIR=coverage jest --ci --reporters=default --reporters=jest-junit --outputFile=./coverage/junit.xml",
9
- "ci-publish": "npm publish --access public --provenance",
10
- "watch": "jest --watchAll"
11
- },
12
- "dependencies": {
13
- "@infitx/match": "workspace:*",
14
- "yaml": "^2.8.1"
15
- },
16
- "devDependencies": {
17
- "jest": "^30.2.0",
18
- "jest-junit": "^16.0.0"
19
- },
20
- "repository": {
21
- "url": "git+https://github.com/infitx-org/release-cd.git"
22
- },
23
- "author": "Kalin Krustev",
24
- "license": "Apache-2.0"
2
+ "name": "@infitx/decision",
3
+ "version": "1.4.0",
4
+ "description": "Decision tables engine",
5
+ "main": "index.js",
6
+ "dependencies": {
7
+ "yaml": "^2.8.2",
8
+ "@infitx/match": "1.5.0"
9
+ },
10
+ "devDependencies": {
11
+ "allure": "^3.1.0",
12
+ "allure-jest": "^3.4.5",
13
+ "jest": "^30.2.0",
14
+ "jest-environment-node": "^30.2.0",
15
+ "jest-junit": "^16.0.0"
16
+ },
17
+ "repository": {
18
+ "url": "git+https://github.com/infitx-org/release-cd.git"
19
+ },
20
+ "author": "Kalin Krustev",
21
+ "license": "Apache-2.0",
22
+ "scripts": {
23
+ "build": "true",
24
+ "ci-unit": "JEST_JUNIT_OUTPUT_DIR=coverage jest --ci --reporters=default --reporters=jest-junit --outputFile=./coverage/junit.xml",
25
+ "ci-publish": "node ../../common/scripts/install-run-rush-pnpm.js publish --access public --provenance",
26
+ "watch": "jest --watchAll"
27
+ }
25
28
  }