Commit 938ab2d
ref(core): Simplify core utility functions for smaller bundle (#19854)
## Summary
Small, safe simplifications across core utilities. Combined saves **~80
bytes gzipped**.
## Changes
- **envelope.ts**: Slim `ITEM_TYPE_TO_DATA_CATEGORY_MAP` by removing 7
self-mapping entries (e.g. `session: "session"`). Falls back to the type
name itself.
- **object.ts**: Replace `getOwnProperties` manual `for...in` +
`hasOwnProperty` loop with `Object.fromEntries(Object.entries(obj))`.
Use shorthand `value` in `addNonEnumerableProperty`.
- **baggage.ts**: Use `.startsWith()` instead of `.match(regex)` for
sentry prefix check.
- **browser.ts**: Inline `allowedAttrs` array literal directly in the
`for...of` loop.
- **eventFilters.ts**: Convert verbose `DEFAULT_IGNORE_ERRORS` string
literals to shorter regex patterns with equivalent matching behavior
(vv().getRestrictions, simulateEvent, solana, _AutofillCallbackHandler).
All changes are behavior-preserving.
Part of #19833.
Co-Authored-By: Claude claude@anthropic.com
---------
Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>1 parent 3bb4325 commit 938ab2d
File tree
5 files changed
+19
-26
lines changed- packages/core/src
- integrations
- utils
5 files changed
+19
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
| 120 | + | |
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
208 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
209 | 212 | | |
210 | | - | |
211 | | - | |
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
215 | | - | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
221 | | - | |
222 | 220 | | |
223 | 221 | | |
224 | | - | |
225 | 222 | | |
226 | 223 | | |
227 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
228 | 229 | | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
232 | | - | |
| 233 | + | |
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 161 | + | |
170 | 162 | | |
| 163 | + | |
171 | 164 | | |
172 | 165 | | |
173 | 166 | | |
| |||
0 commit comments