es.string.trim-start.js 553 B

1234567891011121314151617
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var $trimStart = require('../internals/string-trim').start;
  4. var forcedStringTrimMethod = require('../internals/string-trim-forced');
  5. var FORCED = forcedStringTrimMethod('trimStart');
  6. var trimStart = FORCED ? function trimStart() {
  7. return $trimStart(this);
  8. } : ''.trimStart;
  9. // `String.prototype.{ trimStart, trimLeft }` methods
  10. // https://github.com/tc39/ecmascript-string-left-right-trim
  11. $({ target: 'String', proto: true, forced: FORCED }, {
  12. trimStart: trimStart,
  13. trimLeft: trimStart
  14. });