This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
TripSit_Suite/node_modules/trim-trailing-lines/index.js
2020-11-01 22:46:04 +00:00

18 lines
298 B
JavaScript

'use strict'
module.exports = trimTrailingLines
var line = '\n'
// Remove final newline characters from `value`.
function trimTrailingLines(value) {
var val = String(value)
var index = val.length
while (val.charAt(--index) === line) {
// Empty
}
return val.slice(0, index + 1)
}