Bump to v3.5.0.

This commit is contained in:
jdalton
2015-03-08 18:18:32 -07:00
parent 4881dda9d1
commit 06f6ffa303
29 changed files with 197 additions and 125 deletions

View File

@@ -29,7 +29,11 @@ function endsWith(string, target, position) {
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;
}

View File

@@ -26,7 +26,10 @@ var nativeMin = Math.min;
*/
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;
}

View File

@@ -60,7 +60,7 @@ function trunc(string, options, guard) {
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;