Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

development.ts

15 lines480 Bytes

1// Bundlers inline `process.env.NODE_ENV` even where `process` does not exist,
2// so it is read directly; without either, warnings stay off.
3export function shouldWarnInDevelopment(disableEnvVar: string): boolean {
4 try {
5 if (process.env.NODE_ENV === `production`) return false
6 } catch {
7 return false
8 }
9 // A page may supply a `process` shim without `env`; nothing disabled it.
10 try {
11 return process.env[disableEnvVar] !== `1`
12 } catch {
13 return true
14 }