inspect-js

inspect-js/which-collection

Which kind of Collection (Map, Set, WeakMap, WeakSet) is this JavaScript value? Works cross-realm, without `instanceof`, and despite Symbol.toStringTag.

JavaScript
9
2
MIT License

`which-collection` is a JavaScript utility library that identifies whether a given value is a `Map`, `Set`, `WeakMap`, or `WeakSet`, returning `false` for all other types. It's designed to work cross-realm and without relying on `instanceof` or `Symbol.toStringTag`, making it reliable for complex JavaScript environments. This tool is ideal for developers working with JavaScript collections who need robust type detection in cross-realm scenarios.

Total donated
Undistributed
Share with your subscribers: