Commit 8188c6d
committed
Rewrite library, tests, and examples
Changed:
- Replaced terribly underperformant—and too clever—throw/catch pattern with a fallback/middleware pattern.
- Replaced `FilterException`, `BadValueException`, and `TypeMismatchException` with single `FilterError`.
- Replaced `createFilterResolver()` with `createFilterMiddleware()` to use composite filter functions instead of iterating them for each attribute.
- Renamed `createFilterFunction()` with `createFilterCallable()` for a more versatile name.
- Renamed `createFilterArray()` with `createFilterList()` for a more generic name.
- Altered `filterList()` to expect a string instead of relying on a try/catch.
- Removed obsolete `createFilterChain()`.
- Added helper function `filterFallback()` to resolve the fallback argument with support for the middleware pattern.
- Integrated `filterFallback()` into `filterStringable()`, `filterToken()`, `filterValue()`, and `filterList()`.
- Renamed module file for `createOrderedAttributesComparator()`.
- Update benchmarks to reflect significant performance improvements.1 parent 4a37284 commit 8188c6d
File tree
40 files changed
+1085
-1084
lines changed- docs
- examples
- compose-attributes-expected-order
- filter-array-supported-token
- filter-array-validate-token
- src
- lib
- filter
- sort
- tests/functional
- lib
- filter
- sort
40 files changed
+1085
-1084
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
| 123 | + | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
| 127 | + | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
| 131 | + | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
11 | | - | |
12 | 11 | | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 15 | + | |
17 | 16 | | |
18 | | - | |
19 | | - | |
| 17 | + | |
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
24 | | - | |
| 22 | + | |
25 | 23 | | |
26 | 24 | | |
27 | | - | |
| 25 | + | |
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
31 | | - | |
| 29 | + | |
| 30 | + | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
| 35 | + | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 41 | + | |
| 42 | + | |
53 | 43 | | |
54 | | - | |
55 | | - | |
| 44 | + | |
| 45 | + | |
56 | 46 | | |
57 | | - | |
58 | | - | |
| 47 | + | |
| 48 | + | |
59 | 49 | | |
60 | | - | |
61 | | - | |
| 50 | + | |
| 51 | + | |
62 | 52 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 53 | + | |
| 54 | + | |
68 | 55 | | |
69 | | - | |
70 | | - | |
| 56 | + | |
| 57 | + | |
71 | 58 | | |
72 | | - | |
| 59 | + | |
| 60 | + | |
73 | 61 | | |
74 | | - | |
| 62 | + | |
| 63 | + | |
75 | 64 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 65 | + | |
| 66 | + | |
82 | 67 | | |
83 | 68 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 69 | + | |
100 | 70 | | |
101 | | - | |
| 71 | + | |
| 72 | + | |
102 | 73 | | |
103 | 74 | | |
104 | 75 | | |
105 | 76 | | |
106 | | - | |
107 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
108 | 80 | | |
109 | 81 | | |
110 | | - | |
| 82 | + | |
111 | 83 | | |
112 | 84 | | |
113 | 85 | | |
114 | 86 | | |
115 | 87 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 88 | + | |
161 | 89 | | |
162 | 90 | | |
163 | 91 | | |
164 | 92 | | |
165 | | - | |
| 93 | + | |
166 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
167 | 98 | | |
0 commit comments