src/promissory-arbiter.js
function addTopicLine (topic, ancestor) {
    var
      ancestorTopic = ancestor.topic,
      additionalTopics = [];

    if (ancestorTopic !== topic) {
      // All of the generations to add seeded by the youngest existing ancestor
      additionalTopics = reduce(
        appendPrefixedTopic, [ancestorTopic],
        topic.substr(ancestorTopic.length).replace(/^\./, '').split('.')
      );
    }

    // Add a node to the tree for each new topic
    return addFamilyLine(
      addChildTopic, map(createNode, additionalTopics.slice(1)), ancestor
    );
  }
function addTopicLine (topic, ancestor) {
    var
      ancestorTopic = ancestor.topic,
      additionalTopics = [];

    if (ancestorTopic !== topic) {
      // All of the generations to add seeded by the youngest existing ancestor
      additionalTopics = reduce(
        appendPrefixedTopic, [ancestorTopic],
        topic.substr(ancestorTopic.length).replace(/^\./, '').split('.')
      );
    }

    // Add a node to the tree for each new topic
    return addFamilyLine(
      addChildTopic, map(createNode, additionalTopics.slice(1)), ancestor
    );
  }
function addTopicLine ( topic , ancestor ) { var ancestorTopic = ancestor . topic , additionalTopics = [ ] ; if ( ancestorTopic !== topic ) { // All of the generations to add seeded by the youngest existing ancestor additionalTopics = reduce ( appendPrefixedTopic , [ ancestorTopic ] , topic . substr ( ancestorTopic . length ) . replace ( / ^\. / , '' ) . split ( '.' ) ) ; } // Add a node to the tree for each new topic return addFamilyLine ( addChildTopic , map ( createNode , additionalTopics . slice ( 1 ) ) , ancestor ) ; }
Takes a topic and an ancestor and adds all of the generations from the ancestor to the topic returning the topic that represents the node.
Takes a topic and an ancestor and adds all of the generations from the ancestor to the topic returning the topic that represents the node .