string-trim-start.js 516 B

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