src/IdentityDag.js
/**
    * 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                                              
    */
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
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 dfs(node, search) {
        if(node.label === search) return node
        else if(node.childrens && node.childrens.length > 0) {
            for(let i = 0; i < node.childrens.length; i++){
                let result = this.dfs(node.childrens[i], search)
                if(result) return result
            }
        }
        return null  
    }
static dfs ( node , search ) { if ( node . label === search ) return node else if ( node . childrens && node . childrens . length > 0 ) { for ( let i = 0 ; i < node . childrens . length ; i ++ ) { let result = this . dfs ( node . childrens [ i ] , search ) if ( result ) return result } } return null }
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
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