1
0
mirror of https://github.com/thangisme/notes.git synced 2024-06-20 22:45:26 +00:00
notes/node_modules/trim-newlines/index.js

14 lines
216 B
JavaScript
Raw Normal View History

2017-03-09 18:16:08 +00:00
'use strict';
var fn = module.exports = function (x) {
return fn.end(fn.start(x));
};
fn.start = function (x) {
return x.replace(/^[\r\n]+/, '');
};
fn.end = function (x) {
return x.replace(/[\r\n]+$/, '');
};