Files
react-native-devtools-frontend/node_modules/@sinonjs/samsam/lib/is-iterable.js
T
Simon Zünd a578545017 [deps] Update 'sinon' and '@types/sinon'
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>
2024-07-02 06:22:54 +00:00

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;