aboutsummaryrefslogtreecommitdiff
path: root/node_modules/lodash/_baseSample.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/lodash/_baseSample.js')
-rw-r--r--node_modules/lodash/_baseSample.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/node_modules/lodash/_baseSample.js b/node_modules/lodash/_baseSample.js
new file mode 100644
index 0000000..58582b9
--- /dev/null
+++ b/node_modules/lodash/_baseSample.js
@@ -0,0 +1,15 @@
+var arraySample = require('./_arraySample'),
+ values = require('./values');
+
+/**
+ * The base implementation of `_.sample`.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to sample.
+ * @returns {*} Returns the random element.
+ */
+function baseSample(collection) {
+ return arraySample(values(collection));
+}
+
+module.exports = baseSample;