import { getLogger } from "../../util/logger.js";
import { getFunctionExpressionBody } from "../util.js";
export function toValueComputed(expression) {
    if (!("get" in expression) && "arguments" in expression) {
        const computedNode = expression.arguments[0];
        if (!computedNode ||
            (computedNode.type !== "ArrowFunctionExpression" &&
                computedNode.type !== "FunctionExpression")) {
            getLogger().warn(`Invalid computed node: ${computedNode}`);
            return "";
        }
        return getFunctionExpressionBody(computedNode);
    }
    else {
        const computedNode = expression.get("arguments")[0];
        if (!computedNode ||
            (!computedNode.isArrowFunctionExpression() &&
                !computedNode.isFunctionExpression())) {
            getLogger().warn(`Invalid computed node: ${computedNode}`);
            return "";
        }
        return getFunctionExpressionBody(computedNode);
    }
}
//# sourceMappingURL=to-value-computed.js.map