mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 08:37:49 +00:00
Move internal modules to “internal” folder.
This commit is contained in:
15
.internal/baseSample.js
Normal file
15
.internal/baseSample.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import arraySample from './.internal/arraySample.js';
|
||||
import values from './values.js';
|
||||
|
||||
/**
|
||||
* 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));
|
||||
}
|
||||
|
||||
export default baseSample;
|
||||
Reference in New Issue
Block a user