Sha256: ee2c00fe1c8df7307e9b87a73a1a1e6b5dd428a784c869123eece474c3f9eac7

Contents?: true

Size: 423 Bytes

Versions: 19

Compression:

Stored size: 423 Bytes

Contents

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 + '+$'), '');
};

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ela-4.1.6 node_modules/underscore.string/rtrim.js
ela-4.1.5 node_modules/underscore.string/rtrim.js
ela-4.1.4 node_modules/underscore.string/rtrim.js
ela-4.1.3 node_modules/underscore.string/rtrim.js
ela-4.1.2 node_modules/underscore.string/rtrim.js
ela-4.1.1 node_modules/underscore.string/rtrim.js
ela-4.1.0 node_modules/underscore.string/rtrim.js
ela-4.0.0 node_modules/underscore.string/rtrim.js
ela-3.4.3 node_modules/underscore.string/rtrim.js
ela-3.4.2 node_modules/underscore.string/rtrim.js
ela-3.4.0 node_modules/underscore.string/rtrim.js
ela-3.3.1 node_modules/underscore.string/rtrim.js
ela-3.3.0 node_modules/underscore.string/rtrim.js
ela-3.2.0 node_modules/underscore.string/rtrim.js
ela-3.1.1 node_modules/underscore.string/rtrim.js
ela-3.1.0 node_modules/underscore.string/rtrim.js
ela-3.0.0 node_modules/underscore.string/rtrim.js
ela-2.0.0 node_modules/underscore.string/rtrim.js
ela-1.1.0 node_modules/underscore.string/rtrim.js