Commit 555b6f4
committed
fix(globs): order-insensitive cache key for array-valued options
`getGlobMatcher` built its cache key with `JSON.stringify(value)` per
top-level option key. For scalar values that's fine, but `ignore` is an
array, and `JSON.stringify(['a', 'b'])` !== `JSON.stringify(['b', 'a'])`.
Equivalent matchers that differed only in ignore-list order hit
different keys, re-compiled picomatch, and evicted each other under the
100-entry LRU cap — especially painful for callers assembling ignore
lists from Set iteration order or config-merge output.
Sort array option values element-wise before stringifying.1 parent 0432022 commit 555b6f4
2 files changed
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
149 | 153 | | |
150 | 154 | | |
151 | 155 | | |
152 | 156 | | |
153 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
154 | 162 | | |
155 | 163 | | |
156 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
110 | 123 | | |
111 | 124 | | |
112 | 125 | | |
| |||
0 commit comments