0f2d48b52fc5676e07f6596f24f289e9f72d20d2
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / trim-trailing-lines / index.js
1 'use strict'
2
3 module.exports = trimTrailingLines
4
5 var line = '\n'
6
7 // Remove final newline characters from `value`.
8 function trimTrailingLines(value) {
9   var val = String(value)
10   var index = val.length
11
12   while (val.charAt(--index) === line) {
13     // Empty
14   }
15
16   return val.slice(0, index + 1)
17 }