diff options
Diffstat (limited to 'node_modules/locutus/php/var/is_object.js')
-rw-r--r-- | node_modules/locutus/php/var/is_object.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/node_modules/locutus/php/var/is_object.js b/node_modules/locutus/php/var/is_object.js new file mode 100644 index 0000000..2b29c92 --- /dev/null +++ b/node_modules/locutus/php/var/is_object.js @@ -0,0 +1,23 @@ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +module.exports = function is_object(mixedVar) { + // eslint-disable-line camelcase + // discuss at: http://locutus.io/php/is_object/ + // original by: Kevin van Zonneveld (http://kvz.io) + // improved by: Legaev Andrey + // improved by: Michael White (http://getsprink.com) + // example 1: is_object('23') + // returns 1: false + // example 2: is_object({foo: 'bar'}) + // returns 2: true + // example 3: is_object(null) + // returns 3: false + + if (Object.prototype.toString.call(mixedVar) === '[object Array]') { + return false; + } + return mixedVar !== null && (typeof mixedVar === 'undefined' ? 'undefined' : _typeof(mixedVar)) === 'object'; +}; +//# sourceMappingURL=is_object.js.map
\ No newline at end of file |