{"size": 435, "ext": "js", "max_stars_repo_path": "lib/func/setGraph.js", "max_stars_repo_name": "patrick-nits/node-red-contrib-graphlib", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/func/setGraph.js", "max_issues_repo_name": "patrick-nits/node-red-contrib-graphlib", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/func/setGraph.js", "max_forks_repo_name": "patrick-nits/node-red-contrib-graphlib", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.1875, "max_line_length": 76, "alphanum_fraction": 0.6344827586}
module.exports = setGraph;

/**
 * Sets msg.graph to node.graph.
 *
 * @param {NodeRED Message} msg - The message to get the current graph from.
 * @throws Error if msg does not contain a graph in msg.graph.
 */
function setGraph(msg) {
    var node = this;
    if (typeof msg.graph.nodes === 'function') {
        node.graph = msg.graph;
    } else {
        throw "Cannot call graphlib function. No Graph in Message. " + msg;
    }
}