helpyourneighbour/node_modules/@sinonjs/samsam/lib/is-iterable.js
BibaBot bfd432d094
Some checks are pending
Docker Test / test (push) Waiting to run
Add comprehensive tests for role middleware and fix package dependencies
2026-03-16 20:07:22 +00:00

18 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;