mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
Bump to v3.0.0.
This commit is contained in:
27
lodash._charsleftindex/index.js
Normal file
27
lodash._charsleftindex/index.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* lodash 3.0.0 (Custom Build) <https://lodash.com/>
|
||||
* Build: `lodash modern modularize exports="npm" -o ./`
|
||||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
||||
* Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE>
|
||||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
* Available under MIT license <https://lodash.com/license>
|
||||
*/
|
||||
|
||||
/**
|
||||
* Used by `_.trim` and `_.trimLeft` to get the index of the first character
|
||||
* of `string` that is not found in `chars`.
|
||||
*
|
||||
* @private
|
||||
* @param {string} string The string to inspect.
|
||||
* @param {string} chars The characters to find.
|
||||
* @returns {number} Returns the index of the first character not found in `chars`.
|
||||
*/
|
||||
function charsLeftIndex(string, chars) {
|
||||
var index = -1,
|
||||
length = string.length;
|
||||
|
||||
while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}
|
||||
return index;
|
||||
}
|
||||
|
||||
module.exports = charsLeftIndex;
|
||||
Reference in New Issue
Block a user