Skip to content

Commit

Permalink
[Refactor] use string.prototype.trimstart for the implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Mar 30, 2020
1 parent 045c5af commit b9cec55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
11 changes: 1 addition & 10 deletions implementation.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
'use strict';

var callBind = require('es-abstract/helpers/callBind');
var replace = callBind(String.prototype.replace);

/* eslint-disable no-control-regex */
var leftWhitespace = /^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*/;
/* eslint-enable no-control-regex */

module.exports = function trimLeft() {
return replace(this, leftWhitespace, '');
};
module.exports = require('string.prototype.trimstart/implementation');
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
],
"dependencies": {
"define-properties": "^1.1.3",
"es-abstract": "^1.17.5"
"es-abstract": "^1.17.5",
"string.prototype.trimstart": "^1.0.0"
},
"devDependencies": {
"@es-shims/api": "^2.1.2",
Expand Down

0 comments on commit b9cec55

Please sign in to comment.