Commit dd30aad
refactor(core): Simplify core utility functions for smaller bundle
A collection of small, safe simplifications across core utilities:
- envelope.ts: Slim ITEM_TYPE_TO_DATA_CATEGORY_MAP by removing 7 self-mapping
entries (e.g. session→session). Use a fallback 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 prefix check.
- browser.ts: Inline allowedAttrs array literal directly in for-of loop.
- eventFilters.ts: Convert verbose DEFAULT_IGNORE_ERRORS string literals to
shorter regex patterns with equivalent matching behavior.
All changes are behavior-preserving. Combined saves ~80 bytes gzipped.
Co-Authored-By: Claude claude@anthropic.com1 parent 2b62357 commit dd30aad
File tree
5 files changed
+13
-27
lines changed- packages/core/src
- integrations
- utils
5 files changed
+13
-27
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 | + | |
209 | 210 | | |
210 | | - | |
211 | | - | |
212 | 211 | | |
213 | 212 | | |
214 | 213 | | |
215 | | - | |
216 | 214 | | |
217 | 215 | | |
218 | 216 | | |
219 | 217 | | |
220 | | - | |
221 | | - | |
222 | 218 | | |
223 | 219 | | |
224 | | - | |
225 | 220 | | |
226 | 221 | | |
227 | 222 | | |
228 | 223 | | |
229 | 224 | | |
230 | 225 | | |
231 | 226 | | |
232 | | - | |
| 227 | + | |
233 | 228 | | |
234 | 229 | | |
235 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
| 58 | + | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| |||
158 | 157 | | |
159 | 158 | | |
160 | 159 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 160 | + | |
170 | 161 | | |
| 162 | + | |
171 | 163 | | |
172 | 164 | | |
173 | 165 | | |
| |||
0 commit comments