File: index.js

package info (click to toggle)
node-trim-newlines 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 100 kB
  • ctags: 2
  • sloc: makefile: 2; sh: 2
file content (13 lines) | stat: -rw-r--r-- 216 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
'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]+$/, '');
};