mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
switched uses of 'typeof obj === object' to use _.isObject in order to promote proper handling of null values
This commit is contained in:
parent
de542320bf
commit
83ce9ffc22
3 changed files with 5 additions and 9 deletions
|
@ -43,11 +43,7 @@ define(function (require) {
|
|||
indexish = indexish.get('index');
|
||||
}
|
||||
|
||||
return Promise.cast(
|
||||
(typeof indexish === 'object')
|
||||
? indexish
|
||||
: indexPatterns.get(indexish)
|
||||
)
|
||||
return Promise.cast(_.isObject(indexish) ? indexish : indexPatterns.get(indexish))
|
||||
.then(function (indexPattern) {
|
||||
return indexPattern.fields;
|
||||
});
|
||||
|
|
|
@ -185,8 +185,8 @@ define(function (require) {
|
|||
|
||||
if (
|
||||
rowsPerTick === void 0
|
||||
&& typeof window.performance === 'object'
|
||||
&& typeof performance.now === 'function'
|
||||
&& window.performance
|
||||
&& typeof window.performance.now === 'function'
|
||||
) {
|
||||
timing = performance.now();
|
||||
rowsPerTick = 30;
|
||||
|
@ -366,7 +366,7 @@ define(function (require) {
|
|||
val = (val == null) ? '' : val;
|
||||
|
||||
// stringify array's and objects
|
||||
if (typeof val === 'object') val = JSON.stringify(val);
|
||||
if (_.isObject(val)) val = JSON.stringify(val);
|
||||
|
||||
// truncate
|
||||
if (typeof val === 'string' && val.length > $scope.maxLength) {
|
||||
|
|
|
@ -32,7 +32,7 @@ define(function (require) {
|
|||
_.keys(obj).forEach(function (key) {
|
||||
stack.push(key);
|
||||
if (typeof keepArrays && _.isArray(obj[key])) flatObj[stack.join(dot)] = obj[key];
|
||||
else if (typeof obj[key] === 'object') flattenObj(obj[key]);
|
||||
else if (_.isObject(obj[key])) flattenObj(obj[key]);
|
||||
else flatObj[stack.join(dot)] = obj[key];
|
||||
stack.pop();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue