string-trim-end.js 500 B

1234567891011
  1. 'use strict';
  2. var $trimEnd = require('../internals/string-trim').end;
  3. var forcedStringTrimMethod = require('../internals/string-trim-forced');
  4. // `String.prototype.{ trimEnd, trimRight }` method
  5. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  6. // https://tc39.es/ecma262/#String.prototype.trimright
  7. module.exports = forcedStringTrimMethod('trimEnd') ? function trimEnd() {
  8. return $trimEnd(this);
  9. // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe
  10. } : ''.trimEnd;