mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-07 12:33:47 +08:00
R=alexrudenko@chromium.org Bug: None Change-Id: I1f8dcaa62c6d5e90f37c34db1fd8fb2ed1a7369c Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5666839 Reviewed-by: Alex Rudenko <alexrudenko@chromium.org> Commit-Queue: Alex Rudenko <alexrudenko@chromium.org> Auto-Submit: Simon Zünd <szuend@chromium.org>
19 lines
475 B
JavaScript
19 lines
475 B
JavaScript
"use strict";
|
|
|
|
/**
|
|
* Returns `true` when the argument is an iterable, `false` otherwise
|
|
*
|
|
* @alias module:samsam.isIterable
|
|
* @param {*} val - A value to examine
|
|
* @returns {boolean} Returns `true` when the argument is an iterable, `false` otherwise
|
|
*/
|
|
function isIterable(val) {
|
|
// checks for null and undefined
|
|
if (typeof val !== "object") {
|
|
return false;
|
|
}
|
|
return typeof val[Symbol.iterator] === "function";
|
|
}
|
|
|
|
module.exports = isIterable;
|