lib/builders/create.js
function findProtectedNode(builder, path, callback) {
  var zk = builder.client.zk;
  var pathAndNode = utils.pathAndNode(path);
  zk.getChildren(pathAndNode.path, afterCheck);

  function afterCheck(err, children) {
    if (err && err.getCode() === Exception.NO_NODE) {
      callback();
    }
    else if (err) {
      callback(err);
    }
    else if (children.length) {
      var result = findNode(children, pathAndNode.path, builder.protectedId);
      callback(null, result);
    }
    else {
      callback();
    }
  }
}
function findProtectedNode(builder, path, callback) {
  var zk = builder.client.zk;
  var pathAndNode = utils.pathAndNode(path);
  zk.getChildren(pathAndNode.path, afterCheck);

  function afterCheck(err, children) {
    if (err && err.getCode() === Exception.NO_NODE) {
      callback();
    }
    else if (err) {
      callback(err);
    }
    else if (children.length) {
      var result = findNode(children, pathAndNode.path, builder.protectedId);
      callback(null, result);
    }
    else {
      callback();
    }
  }
}
function findProtectedNode ( builder , path , callback ) { var zk = builder . client . zk ; var pathAndNode = utils . pathAndNode ( path ) ; zk . getChildren ( pathAndNode . path , afterCheck ) ; function afterCheck ( err , children ) { if ( err && err . getCode ( ) === Exception . NO_NODE ) { callback ( ) ; } else if ( err ) { callback ( err ) ; } else if ( children . length ) { var result = findNode ( children , pathAndNode . path , builder . protectedId ) ; callback ( null , result ) ; } else { callback ( ) ; } } }
Try to find protected node with same `protectedId`.

@param {CreateBuilder} builder Builder instance
@param {String} path Desired path
@param {Function} callback Callback function: <code>(err, nodePath)</code>
Try to find protected node with same protectedId .