mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Bump to v3.5.0.
This commit is contained in:
@@ -29,7 +29,11 @@ define(['../internal/baseToString'], function(baseToString) {
|
||||
target = (target + '');
|
||||
|
||||
var length = string.length;
|
||||
position = (typeof position == 'undefined' ? length : nativeMin(position < 0 ? 0 : (+position || 0), length)) - target.length;
|
||||
position = typeof position == 'undefined'
|
||||
? length
|
||||
: nativeMin(position < 0 ? 0 : (+position || 0), length);
|
||||
|
||||
position -= target.length;
|
||||
return position >= 0 && string.indexOf(target, position) == position;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,10 @@ define(['../internal/baseToString'], function(baseToString) {
|
||||
*/
|
||||
function startsWith(string, target, position) {
|
||||
string = baseToString(string);
|
||||
position = position == null ? 0 : nativeMin(position < 0 ? 0 : (+position || 0), string.length);
|
||||
position = position == null
|
||||
? 0
|
||||
: nativeMin(position < 0 ? 0 : (+position || 0), string.length);
|
||||
|
||||
return string.lastIndexOf(target, position) == position;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ define(['../internal/baseToString', '../internal/isIterateeCall', '../lang/isObj
|
||||
if (options != null) {
|
||||
if (isObject(options)) {
|
||||
var separator = 'separator' in options ? options.separator : separator;
|
||||
length = 'length' in options ? +options.length || 0 : length;
|
||||
length = 'length' in options ? (+options.length || 0) : length;
|
||||
omission = 'omission' in options ? baseToString(options.omission) : omission;
|
||||
} else {
|
||||
length = +options || 0;
|
||||
|
||||
Reference in New Issue
Block a user