Version 1
[yaffs-website] / node_modules / grunt-legacy-log / node_modules / lodash / internal / toIterable.js
diff --git a/node_modules/grunt-legacy-log/node_modules/lodash/internal/toIterable.js b/node_modules/grunt-legacy-log/node_modules/lodash/internal/toIterable.js
new file mode 100644 (file)
index 0000000..c0a5b28
--- /dev/null
@@ -0,0 +1,22 @@
+var isArrayLike = require('./isArrayLike'),
+    isObject = require('../lang/isObject'),
+    values = require('../object/values');
+
+/**
+ * Converts `value` to an array-like object if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Array|Object} Returns the array-like object.
+ */
+function toIterable(value) {
+  if (value == null) {
+    return [];
+  }
+  if (!isArrayLike(value)) {
+    return values(value);
+  }
+  return isObject(value) ? value : Object(value);
+}
+
+module.exports = toIterable;