mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 00:57:48 +00:00
Add _.trunc tests for astrals as separators.
This commit is contained in:
@@ -11149,15 +11149,14 @@
|
||||
if (isRegExp(separator)) {
|
||||
if (string.slice(end).search(separator)) {
|
||||
var match,
|
||||
newEnd,
|
||||
substring = result;
|
||||
|
||||
if (!separator.global) {
|
||||
separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g');
|
||||
separator = RegExp(separator.source, baseToString(reFlags.exec(separator)) + 'g');
|
||||
}
|
||||
separator.lastIndex = 0;
|
||||
while ((match = separator.exec(substring))) {
|
||||
newEnd = match.index;
|
||||
var newEnd = match.index;
|
||||
}
|
||||
result = result.slice(0, newEnd == null ? end : newEnd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user