UNPKG

esformatter-eol-last

Version:

Adds a newline to the end of esformatter output. Will not add newline is the output ends in a newline already.

12 lines (8 loc) 208 B
'use strict'; require('string.prototype.endswith'); exports.stringAfter = function(formattedString) { if (formattedString.endsWith('\n')) { return formattedString; } return formattedString + '\n'; };