Code coverage report for master/rtrim.js

Statements: 100% (9 / 9)      Branches: 100% (4 / 4)      Functions: 100% (1 / 1)      Lines: 100% (8 / 8)      Ignored: none     

All files » master/ » rtrim.js
1 2 3 4 5 6 7 8 9 10 111 1 1   1 23 23 6 6    
var makeString = require('./helper/makeString');
var defaultToWhiteSpace = require('./helper/defaultToWhiteSpace');
var nativeTrimRight = String.prototype.trimRight;
 
module.exports = function rtrim(str, characters) {
  str = makeString(str);
  if (!characters && nativeTrimRight) return nativeTrimRight.call(str);
  characters = defaultToWhiteSpace(characters);
  return str.replace(new RegExp(characters + '+$'), '');
};