This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
TripSit_Suite/node_modules/@sinonjs/samsam/lib/create-matcher/is-iterable.js

17 lines
360 B
JavaScript
Raw Normal View History

"use strict";
var typeOf = require("@sinonjs/commons").typeOf;
/**
* Returns `true` for iterables
*
* @private
* @param {*} value A value to examine
* @returns {boolean} Returns `true` when `value` looks like an iterable
*/
function isIterable(value) {
return Boolean(value) && typeOf(value.forEach) === "function";
}
module.exports = isIterable;