src/IdentityDag.js
/**
    * Updates a node by applying a depth-first search
    *
    * @param   {Object}         node         tree's node that may contain the target node
    * @param   {String}         search       target node's label
    * @return  {Object}                      the desired node with its childrens if it exists                                              
    */
Updates a node by applying a depth-first search
@param   {Object}         node         tree's node that may contain the target node
@param   {String}         search       target node's label
@return  {Object}                      the desired node with its childrens if it exists
Updates a node by applying a depth - first search @param { Object } node tree ' s node that may contain the target node @param { String } search target node ' s label @return { Object } the desired node with its childrens if it exists
static updateNode(node, search, data, hash) {
        if(node.label === search && (!node.childrens || node.childrens.length === 0)) {
            node.data = data;
            node.hash = hash;
            return node
        }
        else if(node.childrens && node.childrens.length > 0) {
            for(let i = 0; i < node.childrens.length; i++){
                let result = this.updateNode(node.childrens[i], search, data)
                if(result) return renewNodeHash(node)
            }
        }
        return null  
    }
static updateNode ( node , search , data , hash ) { if ( node . label === search && ( ! node . childrens || node . childrens . length === 0 ) ) { node . data = data ; node . hash = hash ; return node } else if ( node . childrens && node . childrens . length > 0 ) { for ( let i = 0 ; i < node . childrens . length ; i ++ ) { let result = this . updateNode ( node . childrens [ i ] , search , data ) if ( result ) return renewNodeHash ( node ) } } return null }
Updates a node by applying a depth-first search
 @param   {Object}         node         tree's node that may contain the target node
 @param   {String}         search       target node's label
 @return  {Object}                      the desired node with its childrens if it exists
Updates a node by applying a depth - first search @param { Object } node tree ' s node that may contain the target node @param { String } search target node ' s label @return { Object } the desired node with its childrens if it exists