source: frontend/node_modules/strip-final-newline/index.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 368 bytes
Line 
1'use strict';
2
3module.exports = input => {
4 const LF = typeof input === 'string' ? '\n' : '\n'.charCodeAt();
5 const CR = typeof input === 'string' ? '\r' : '\r'.charCodeAt();
6
7 if (input[input.length - 1] === LF) {
8 input = input.slice(0, input.length - 1);
9 }
10
11 if (input[input.length - 1] === CR) {
12 input = input.slice(0, input.length - 1);
13 }
14
15 return input;
16};
Note: See TracBrowser for help on using the repository browser.