Skip to content

Conversation

@lobsterkatie
Copy link
Member

In a number of places in our codebase, we have the pattern const something = Array.isArray(somethingElse) ? somethingElse : [ somethingElse ];, where we need something (which might already be an array) to be an array.

This introduces a utility function, arrayify, which does that work for us, mostly because I just got tired of typing it. (As a bonus, it's slightly shorter and therefore might save a few bytes on bundle size.)

@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.42 KB (-0.04% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 60.08 KB (-0.02% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 17.99 KB (-0.02% 🔽)
@sentry/browser - ES6 CDN Bundle (minified) 52.94 KB (-0.03% 🔽)
@sentry/browser - Webpack (gzipped + minified) 19.79 KB (-0.01% 🔽)
@sentry/browser - Webpack (minified) 64.33 KB (-0.02% 🔽)
@sentry/react - Webpack (gzipped + minified) 19.81 KB (-0.02% 🔽)
@sentry/nextjs Client - Webpack (gzipped + minified) 44.72 KB (-0.02% 🔽)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 25.91 KB (-0.01% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.28 KB (0%)

@lobsterkatie lobsterkatie requested a review from lforst September 1, 2022 05:39
@lobsterkatie lobsterkatie merged commit e6e89fd into master Sep 1, 2022
@lobsterkatie lobsterkatie deleted the kmclb-add-arrayify-util-function branch September 1, 2022 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants