Skip to content

Commit 8883307

Browse files
committed
【update】1) util增加判断是否为对象的方法
1 parent 1c1b380 commit 8883307

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/openlayers/core/Util.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,15 @@ export class Util {
290290
static isString(str) {
291291
return (typeof str === 'string') && str.constructor === String;
292292
}
293+
/**
294+
* @function ol.supermap.Util.isObject
295+
* @description 是否为对象
296+
* @param {any} obj - 需要判断的内容
297+
* @returns {boolean}
298+
*/
299+
static isObject(obj) {
300+
return Object.prototype.toString.call(obj) === '[object Object]';
301+
}
293302

294303
/**
295304
* @function ol.supermap.Util.trim

0 commit comments

Comments
 (0)