MCPcopy
hub / github.com/lodash/lodash / charsStartIndex

Function charsStartIndex

lodash.js:1074–1080  ·  view source on GitHub ↗

* Used by `_.trim` and `_.trimStart` to get the index of the first string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Retu

(strSymbols, chrSymbols)

Source from the content-addressed store, hash-verified

1072 * @returns {number} Returns the index of the first unmatched string symbol.
1073 */
1074 function charsStartIndex(strSymbols, chrSymbols) {
1075 var index = -1,
1076 length = strSymbols.length;
1077
1078 while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
1079 return index;
1080 }
1081
1082 /**
1083 * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol

Callers 2

trimFunction · 0.85
trimStartFunction · 0.85

Calls 1

baseIndexOfFunction · 0.85

Tested by

no test coverage detected