summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toIterable.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toIterable.js')
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toIterable.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toIterable.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toIterable.js
new file mode 100644
index 0000000000..ae63a33be2
--- /dev/null
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toIterable.js
@@ -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 is 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;