"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.isCloudFunction = exports.formatTerraformArguments = void 0;
var isArray_1 = __importDefault(require("lodash/isArray"));
function formatTerraformArguments(args) {
    return args
        .map(function (arg) {
        if (!(0, isArray_1.default)(arg)) {
            return arg;
        }
        if (arg.length === 2) {
            return "".concat(arg[0], "=").concat(arg[1]);
        }
        return "".concat(arg[0], "=\"").concat(arg[1], "=").concat(arg[2], "\"");
    })
        .map(function (arg) { return "-".concat(arg); });
}
exports.formatTerraformArguments = formatTerraformArguments;
/**
 * Checks if the environment is a GCP or AWS cloud function
 */
var isCloudFunction = function () { return process.env.LAMBDA_TASK_ROOT || process.env.FUNCTION_TARGET; };
exports.isCloudFunction = isCloudFunction;
//# sourceMappingURL=infrastructure.js.map