dastal
Version:
Data Structures & Algorithms implementations
26 lines • 1.03 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.isCollection = void 0;
__exportStar(require("./collection"), exports);
/**
* Check if a value is a {@link Collection}.
*
* @param obj - The value to check.
*
* @returns - `true` if obj is a Collection, `false` otherwise.
*/
function isCollection(obj) {
return (obj != null && typeof obj['size'] === 'number' && typeof obj[Symbol.iterator] === 'function');
}
exports.isCollection = isCollection;
//# sourceMappingURL=index.js.map