string-trim-end.js 502 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-x/no-string-prototype-trimstart-trimend -- safe
  10. } : ''.trimEnd;