Немного изменив более ранний question, мой конкретный пример использования ниже, где я передаю объект, какое лучшее решение в этом случае?
Product.prototype.list = function(body) {
    body.options = {
        hostname: endPoints.product,
        path: '/applications/' + body.entity.type,
        method: 'GET'
    };
    return remote.request(body)
        .then(function(result){
            body[body.entity.type] = result;
            return body;
        });
};
var body = {
    entity: {
        type: null
    }
};
body.entity.type = "coke";
product.list(body)
    .then(console.log); //will this have {coke: []} or {pepsi: []}
body.entity.type = "pepsi";
product.list(body)
    .then(console.log);
Он не работает, когда я использую ссылки на основе объектов, какое решение в этом случае?
