You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add ability to override custom levels comparison (#1883)
* feat: add ability to override custom levels compare
* fix: use function instead of closure
* docs: update level comparison to docs
* test: update types tests for level comparison
* refactor: move default levels and sorting order to constants
* fix: made suggested changes in pr review
* fix: change enum annotation type
Copy file name to clipboardexpand all lines: docs/api.md
+26
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,32 @@ Additional levels can be added to the instance via the `customLevels` option.
65
65
* See [`customLevels` option](#opt-customlevels)
66
66
67
67
<aid=opt-customlevels></a>
68
+
69
+
#### `levelComparison` ("ASC", "DESC", Function)
70
+
71
+
Default: `ASC`
72
+
73
+
Use this option to customize levels order.
74
+
In order to be able to define custom levels ordering pass a function which will accept `current` and `expected` values and return `boolean` which shows should `current` level to be shown or not.
0 commit comments