"use strict";
const env_1 = require("../env");
const WIN32_1 = require("./WIN32");
// IMPORTANT: Do not use destructuring here - use direct assignment instead.
// tsgo has a bug that incorrectly transpiles destructured exports, resulting in
// `exports.SomeName = void 0;` which causes runtime errors.
// See: https://github.com/SocketDev/socket-packageurl-js/issues/3
const ObjectFreeze = Object.freeze;
const ObjectHasOwn = Object.hasOwn;
const { env } = process;
const DEBUG = (0, env_1.envAsString)(env['DEBUG']);
const HOME = (0, env_1.envAsString)(env['HOME']);
module.exports = ObjectFreeze({
    __proto__: null,
    // Windows-specific AppData folder for application data.
    APPDATA: (0, env_1.envAsString)(env['APPDATA']),
    // CI is always set to 'true' in a GitHub action.
    // https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables
    // Libraries like yocto-colors check for CI not by value but my existence,
    // e.g. `'CI' in process.env`.
    CI: ObjectHasOwn(env, 'CI'),
    // Terminal columns width.
    COLUMNS: (0, env_1.envAsString)(env['COLUMNS']),
    // Enable debug logging based on the 'debug' package.
    // https://socket.dev/npm/package/debug/overview/4.4.1
    DEBUG,
    // User home directory.
    HOME,
    // The absolute location of the %localappdata% folder on Windows used to store
    // user-specific, non-roaming application data, like temporary files, cached
    // data, and program settings, that are specific to the current machine and user.
    LOCALAPPDATA: (0, env_1.envAsString)(env['LOCALAPPDATA']),
    // Set the debug log level (notice, error, warn, info, verbose, http, silly).
    LOG_LEVEL: (0, env_1.envAsString)(env['LOG_LEVEL']),
    // .github/workflows/provenance.yml defines this.
    // https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-nodejs-packages
    NODE_AUTH_TOKEN: (0, env_1.envAsString)(env['NODE_AUTH_TOKEN']),
    // NODE_ENV is a recognized convention, but not a built-in Node.js feature.
    NODE_ENV: (0, env_1.envAsString)(env['NODE_ENV']).toLowerCase() === 'production'
        ? 'production'
        : 'development',
    // A space-separated list of command-line options. `options...` are interpreted
    // before command-line options, so command-line options will override or compound
    // after anything in `options...`. Node.js will exit with an error if an option
    // that is not allowed in the environment is used, such as `-p` or a script file.
    // https://nodejs.org/api/cli.html#node_optionsoptions
    NODE_OPTIONS: (0, env_1.envAsString)(env['NODE_OPTIONS']),
    // PRE_COMMIT is set to '1' by our 'test-pre-commit' script run by the
    // .husky/pre-commit hook.
    PRE_COMMIT: (0, env_1.envAsBoolean)(env['PRE_COMMIT']),
    // Enable debug logging in Socket CLI.
    SOCKET_CLI_DEBUG: !!DEBUG || (0, env_1.envAsBoolean)(env['SOCKET_CLI_DEBUG']),
    // Enable verbose build output.
    VERBOSE_BUILD: (0, env_1.envAsBoolean)(env['VERBOSE_BUILD']),
    // VITEST=true is set by the Vitest test runner.
    // https://vitest.dev/config/#configuring-vitest
    VITEST: (0, env_1.envAsBoolean)(env['VITEST']),
    // The location of the base directory on Linux and MacOS used to store
    // user-specific data files, defaulting to $HOME/.local/share if not set or empty.
    XDG_DATA_HOME: WIN32_1
        ? ''
        : (0, env_1.envAsString)(env['XDG_DATA_HOME']) || (HOME ? `${HOME}/.local/share` : ''),
});
//# sourceMappingURL=ENV.js.map