/** * lodash 3.0.4 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.7.0 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseToString = require('lodash._basetostring'), charsLeftIndex = require('lodash._charsleftindex'), isIterateeCall = require('lodash._isiterateecall'), trimmedLeftIndex = require('lodash._trimmedleftindex'); /** * Removes leading whitespace or specified characters from `string`. * * @static * @memberOf _ * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. * @returns {string} Returns the trimmed string. * @example * * _.trimLeft(' abc '); * // => 'abc ' * * _.trimLeft('-_-abc-_-', '_-'); * // => 'abc-_-' */ function trimLeft(string, chars, guard) { var value = string; string = baseToString(string); if (!string) { return string; } if (guard ? isIterateeCall(value, chars, guard) : chars == null) { return string.slice(trimmedLeftIndex(string)); } return string.slice(charsLeftIndex(string, (chars + ''))); } module.exports = trimLeft;