getTextRange(fromCharOrId, toCharOrId) {
    invariant(fromCharOrId, 'From char must be defined.')
    let fromMatched = false
    let chars = []
    let fromId = _.has(fromCharOrId, 'id') ? fromCharOrId.id : fromCharOrId
    let toId
    if(!_.isUndefined(toCharOrId)) {
      toId = _.has(toCharOrId, 'id') ? toCharOrId.id : toCharOrId
    }

    if(fromId === toId) {
      return chars
    }
    for (let i = 0; i < this.data.len(); i++) {
      if (!fromMatched && this.data.matches(i, fromId)) {
        // the fromId is exclusive
        fromMatched = true
        if(fromId === toId) {
          chars.push(this.getCharAt(i))
          return chars
        }
      } else if(toId && this.data.matches(i, toId)) {
        invariant(fromMatched, 'From id must precede To id.')
        chars.push(this.getCharAt(i))
        return chars
      } else if(fromMatched) {
        chars.push(this.getCharAt(i))
      }
    }
    return chars
  }
Gets all the chars from a given ID (exclusive) to a given ID (inclusive). The length of the returned
range is going to be `pos(toChar) - pos(fromChar)`.
@param {Char|string} fromCharOrId
@param {Char|string} [toCharOrId = last] If the to char does not exist, then to char is the last char.
@returns {Array}