@orkestrel/qualifier 0.0.11 → 0.0.13
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/README.md +14 -10
- package/dist/src/core/index.cjs +315 -198
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +636 -420
- package/dist/src/core/index.d.ts +636 -420
- package/dist/src/core/index.js +307 -189
- package/dist/src/core/index.js.map +1 -1
- package/package.json +19 -16
package/README.md
CHANGED
|
@@ -17,22 +17,26 @@ npm install @orkestrel/qualifier
|
|
|
17
17
|
|
|
18
18
|
## Requirements
|
|
19
19
|
|
|
20
|
-
- Node.js >=
|
|
21
|
-
- ESM (`import`) and CommonJS (`require`)
|
|
20
|
+
- Node.js >= 22.12.0
|
|
21
|
+
- ESM (`import`) and CommonJS (`require`) through the `exports` field
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
|
|
29
|
-
const gates =
|
|
30
|
-
|
|
26
|
+
import { createQualificationDefinition, createQualifier, createRuling } from '@orkestrel/qualifier'
|
|
27
|
+
import { createAtom, createLogicalDefinition, createRule } from '@orkestrel/reason'
|
|
28
|
+
|
|
29
|
+
const gates = createLogicalDefinition('gates', 'Eligibility gates', [
|
|
30
|
+
createRule(
|
|
31
|
+
'licensed',
|
|
32
|
+
[createAtom('licensed', 'equals', false)],
|
|
33
|
+
createAtom('blocked', 'equals', true),
|
|
34
|
+
),
|
|
31
35
|
])
|
|
32
36
|
|
|
33
|
-
const definition =
|
|
37
|
+
const definition = createQualificationDefinition('standard', 'Standard eligibility', [gates], {
|
|
34
38
|
rulings: [
|
|
35
|
-
|
|
39
|
+
createRuling('license', 'gates', 'licensed', 'restriction', {
|
|
36
40
|
message: 'A license is required',
|
|
37
41
|
}),
|
|
38
42
|
],
|
|
@@ -55,7 +59,7 @@ overload. Every `qualify` call fires once through `qualifier.emitter` (`qualify`
|
|
|
55
59
|
|
|
56
60
|
For the full surface — `Qualifier`, `QualificationResult`, finding types, validators,
|
|
57
61
|
factories, errors, and options — see
|
|
58
|
-
[`guides/
|
|
62
|
+
[`guides/qualifier.md`](guides/qualifier.md).
|
|
59
63
|
|
|
60
64
|
## Package
|
|
61
65
|
|