|
Last change
on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
423 bytes
|
| Rev | Line | |
|---|
| [a762898] | 1 | import { sample as sample$1 } from '../../array/sample.mjs';
|
|---|
| 2 | import { toArray } from '../_internal/toArray.mjs';
|
|---|
| 3 | import { isArrayLike } from '../predicate/isArrayLike.mjs';
|
|---|
| 4 |
|
|---|
| 5 | function sample(collection) {
|
|---|
| 6 | if (collection == null) {
|
|---|
| 7 | return undefined;
|
|---|
| 8 | }
|
|---|
| 9 | if (isArrayLike(collection)) {
|
|---|
| 10 | return sample$1(toArray(collection));
|
|---|
| 11 | }
|
|---|
| 12 | return sample$1(Object.values(collection));
|
|---|
| 13 | }
|
|---|
| 14 |
|
|---|
| 15 | export { sample };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.