Last change
on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
636 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var baseIndexOf = require('./_baseIndexOf');
|
---|
| 2 |
|
---|
| 3 | /**
|
---|
| 4 | * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
|
---|
| 5 | * that is not found in the character symbols.
|
---|
| 6 | *
|
---|
| 7 | * @private
|
---|
| 8 | * @param {Array} strSymbols The string symbols to inspect.
|
---|
| 9 | * @param {Array} chrSymbols The character symbols to find.
|
---|
| 10 | * @returns {number} Returns the index of the first unmatched string symbol.
|
---|
| 11 | */
|
---|
| 12 | function charsStartIndex(strSymbols, chrSymbols) {
|
---|
| 13 | var index = -1,
|
---|
| 14 | length = strSymbols.length;
|
---|
| 15 |
|
---|
| 16 | while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
|
---|
| 17 | return index;
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | module.exports = charsStartIndex;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.