Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format comment containing process.env #6874

Merged
merged 2 commits into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wild-geckos-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/util': patch
---

Reformat a comment that causes compile errors in some build toolchains.
7 changes: 5 additions & 2 deletions packages/util/src/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ const getDefaultsFromGlobal = (): FirebaseDefaults | undefined =>

/**
* Attempt to read defaults from a JSON string provided to
* process.env.__FIREBASE_DEFAULTS__ or a JSON file whose path is in
* process.env.__FIREBASE_DEFAULTS_PATH__
* process(.)env(.)__FIREBASE_DEFAULTS__ or a JSON file whose path is in
* process(.)env(.)__FIREBASE_DEFAULTS_PATH__
* The dots are in parens because certain compilers (Vite?) cannot
* handle seeing that variable in comments.
* See https://github.com/firebase/firebase-js-sdk/issues/6838
*/
const getDefaultsFromEnvVariable = (): FirebaseDefaults | undefined => {
if (typeof process === 'undefined' || typeof process.env === 'undefined') {
Expand Down