mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
Tweak options detection in _.trunc.
This commit is contained in:
15
lodash.js
15
lodash.js
@@ -9876,13 +9876,14 @@
|
||||
var length = DEFAULT_TRUNC_LENGTH,
|
||||
omission = DEFAULT_TRUNC_OMISSION;
|
||||
|
||||
if (isObject(options)) {
|
||||
var separator = 'separator' in options ? options.separator : separator;
|
||||
length = 'length' in options ? +options.length || 0 : length;
|
||||
omission = 'omission' in options ? (options.omission + '') : omission;
|
||||
}
|
||||
else if (options != null) {
|
||||
length = +options || 0;
|
||||
if (options != null) {
|
||||
if (isObject(options)) {
|
||||
var separator = 'separator' in options ? options.separator : separator;
|
||||
length = 'length' in options ? +options.length || 0 : length;
|
||||
omission = 'omission' in options ? (options.omission + '') : omission;
|
||||
} else {
|
||||
length = +options || 0;
|
||||
}
|
||||
}
|
||||
string = toString(string);
|
||||
if (length >= string.length) {
|
||||
|
||||
Reference in New Issue
Block a user