refactor(truncate-text): extract truncate logic to this.truncate()