         nodes.push(mutation.removedNodes...)
     nodes
 
-  summarizeMutations = (mutations) ->
-    summarizeTextMutations(mutations)
+  getMutationSummary: ->
+    @getTextMutationSummary()
 
-  summarizeTextMutations = (mutations) ->
+  getTextMutationSummary: ->
     additions = []
     deletions = []
 
-    characterMutations = (mutation for mutation in mutations when mutation.type is "characterData")
+    characterMutations = @getMutationsByType("characterData")
+
     if characterMutations.length
       [startMutation, ..., endMutation] = characterMutations
       oldString = normalizeSpaces(startMutation.oldValue)


  didMutate: (mutations) =>
    clearTimeout(@debounce)

    @mutations ?= []
    @mutations.push(mutations...)

    @debounce = setTimeout =>
      significantMutations = @findSignificantMutations(@mutations)
      return unless significantMutations.length
      @delegate?.elementDidMutate?(summarizeMutations(significantMutations))
      @mutations = []
    , 1

  # Private

  findSignificantMutations: (mutations) ->
    mutation for mutation in mutations when @mutationIsSignificant(mutation)

    summary.textDeleted = deleted if deleted = deletions.join("")
    summary

  getMutationsByType: (type) ->
    mutation for mutation in @mutations when mutation.type is type

  getRemovedTextNodes: ->
    for mutation in @getMutationsByType("childList")
      for node in mutation.removedNodes when node.nodeType is Node.TEXT_NODE
        node

  stringDifference = (a, b) ->
    leftIndex = 0
