Blame view

node_modules/underscore.string/ltrim.js 424 Bytes
f7563de62   Palak Handa   first commit
1
2
3
4
5
6
7
8
9
10
  var makeString = require('./helper/makeString');
  var defaultToWhiteSpace = require('./helper/defaultToWhiteSpace');
  var nativeTrimLeft = String.prototype.trimLeft;
  
  module.exports = function ltrim(str, characters) {
    str = makeString(str);
    if (!characters && nativeTrimLeft) return nativeTrimLeft.call(str);
    characters = defaultToWhiteSpace(characters);
    return str.replace(new RegExp('^' + characters + '+'), '');
  };