Version 1
[yaffs-website] / node_modules / uncss / node_modules / lodash / internal / isHostObject.js
diff --git a/node_modules/uncss/node_modules/lodash/internal/isHostObject.js b/node_modules/uncss/node_modules/lodash/internal/isHostObject.js
new file mode 100644 (file)
index 0000000..e598c10
--- /dev/null
@@ -0,0 +1,20 @@
+/**
+ * Checks if `value` is a host object in IE < 9.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
+ */
+function isHostObject(value) {
+  // Many host objects are `Object` objects that can coerce to strings
+  // despite having improperly defined `toString` methods.
+  var result = false;
+  if (value != null && typeof value.toString != 'function') {
+    try {
+      result = !!(value + '');
+    } catch (e) {}
+  }
+  return result;
+}
+
+module.exports = isHostObject;