/* eslint-disable custom-rules/no-process-env */
/**
 * Utility to detect if running in a development environment.
 * Compatible with multiple dev servers (Vite, Webpack, etc.)
 *
 * This function safely checks the NODE_ENV in a way that's compatible
 * with tree-shaking and various build tools.
 */
export function isDevelopment() {
    // Check for Vite's __DEV__ global first (preferred for Vite)
    if (typeof __DEV__ !== 'undefined') {
        return __DEV__;
    }
    // Fallback to NODE_ENV for other environments
    // Using typeof check to avoid direct process.env reference issues
    if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV) {
        return process.env.NODE_ENV !== 'production';
    }
    // Default to false if we can't determine
    return false;
}
/**
 * Utility to get the current NODE_ENV value.
 * Compatible with multiple dev servers (Vite, Webpack, etc.)
 */
export function getNodeEnv() {
    // Check for common environment variable patterns
    if (typeof import.meta !== 'undefined' && import.meta.env && import.meta.env.MODE) {
        return import.meta.env.MODE;
    }
    if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV) {
        return process.env.NODE_ENV;
    }
    return 'production';
}
//# sourceMappingURL=env.js.map