Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

16 righe
315 B

  1. 'use strict';
  2. module.exports = function (x) {
  3. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  4. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  5. if (x[x.length - 1] === lf) {
  6. x = x.slice(0, x.length - 1);
  7. }
  8. if (x[x.length - 1] === cr) {
  9. x = x.slice(0, x.length - 1);
  10. }
  11. return x;
  12. };