@newdash/newdash
Version:
javascript/typescript utility library
22 lines (21 loc) • 852 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const baseIndexOf_1 = __importDefault(require("./baseIndexOf"));
/**
* Used by `trim` and `trimEnd` to get the index of the last 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} Returns the index of the last unmatched string symbol.
*/
function charsEndIndex(strSymbols, chrSymbols) {
let index = strSymbols.length;
while (index-- && (0, baseIndexOf_1.default)(chrSymbols, strSymbols[index], 0) > -1) { }
return index;
}
exports.default = charsEndIndex;