const FALSY_STRINGS = new Set(["", "0", "false"]);
const isTruthyEnvValue = (args) => {
    const { value } = args;
    if (value == null) {
        return false;
    }
    return !FALSY_STRINGS.has(value.toLowerCase());
};
export const isNonInteractiveEnvironment = (args) => {
    const stdin = args?.stdin ?? process.stdin;
    const env = args?.env ?? process.env;
    if (isTruthyEnvValue({ value: env.CI })) {
        return true;
    }
    if (stdin.isTTY !== true) {
        return true;
    }
    return false;
};
//# sourceMappingURL=nonInteractive.js.map