@orkestrel/rater 0.0.12 → 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 +12 -8
- package/dist/src/core/index.cjs +127 -127
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +256 -253
- package/dist/src/core/index.d.ts +256 -253
- package/dist/src/core/index.js +120 -120
- package/dist/src/core/index.js.map +1 -1
- package/package.json +20 -16
package/README.md
CHANGED
|
@@ -17,22 +17,26 @@ npm install @orkestrel/rater
|
|
|
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 {
|
|
26
|
+
import { buildLineDefinition, createRater } from '@orkestrel/rater'
|
|
27
|
+
import {
|
|
28
|
+
createFactorGroup,
|
|
29
|
+
createQuantitativeDefinition,
|
|
30
|
+
createStaticFactor,
|
|
31
|
+
} from '@orkestrel/reason'
|
|
28
32
|
|
|
29
33
|
const rater = createRater()
|
|
30
34
|
|
|
31
|
-
const base =
|
|
35
|
+
const base = buildLineDefinition(
|
|
32
36
|
'base',
|
|
33
37
|
'Base Amount',
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
createQuantitativeDefinition('base', 'Base', [
|
|
39
|
+
createFactorGroup('amount', 'sum', [createStaticFactor('flat', 100)]),
|
|
36
40
|
]),
|
|
37
41
|
)
|
|
38
42
|
|
|
@@ -53,7 +57,7 @@ through `rater.emitter` (`rate`).
|
|
|
53
57
|
|
|
54
58
|
For the full surface — `Rater`, `RatingResult`, worksheet types, validators,
|
|
55
59
|
factories, errors, and options — see
|
|
56
|
-
[`guides/
|
|
60
|
+
[`guides/rater.md`](guides/rater.md).
|
|
57
61
|
|
|
58
62
|
## Package
|
|
59
63
|
|