@infitx/match 1.5.2 → 1.5.4
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 +14 -0
- package/index.d.ts +26 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.5.4](https://github.com/infitx-org/release-cd/compare/match-v1.5.3...match-v1.5.4) (2026-03-14)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* update build workflow and add allure configuration files ([169bdb8](https://github.com/infitx-org/release-cd/commit/169bdb80a48041b40dcd2a54206c76bd2fe8d900))
|
|
9
|
+
|
|
10
|
+
## [1.5.3](https://github.com/infitx-org/release-cd/compare/match-v1.5.2...match-v1.5.3) (2026-03-02)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* publish definitions ([b0534e0](https://github.com/infitx-org/release-cd/commit/b0534e05cf2fa5b9f7baee07c109bb3775dd38cd))
|
|
16
|
+
|
|
3
17
|
## [1.5.2](https://github.com/infitx-org/release-cd/compare/match-v1.5.1...match-v1.5.2) (2026-02-26)
|
|
4
18
|
|
|
5
19
|
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matches a fact value against a rule value with support for pattern matching,
|
|
3
|
+
* JSON pointers, time intervals, ranges, and complex object comparisons.
|
|
4
|
+
*
|
|
5
|
+
* @param factValue - The actual value to match against
|
|
6
|
+
* @param ruleValue - The expected pattern/rule to match
|
|
7
|
+
* @param referenceTime - Reference timestamp for time-based comparisons (default: Date.now())
|
|
8
|
+
* @param rootFact - Root fact object for JSON pointer resolution
|
|
9
|
+
* @returns true if factValue matches ruleValue, false otherwise
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* match({ a: 1 }, { a: 1 }); // true
|
|
14
|
+
* match({ a: 1, b: 2 }, { a: 1 }); // true (partial match)
|
|
15
|
+
* match({ age: 25 }, { age: { min: 18, max: 65 } }); // true (range match)
|
|
16
|
+
* match({ date: '2024-01-01' }, { date: { $lte: 'now-1d' } }); // time comparison
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare function match(
|
|
20
|
+
factValue: object,
|
|
21
|
+
ruleValue: object,
|
|
22
|
+
referenceTime?: number,
|
|
23
|
+
rootFact?: object
|
|
24
|
+
): boolean;
|
|
25
|
+
|
|
26
|
+
export = match;
|