Should Map be Filterable?
Author: davetapleyCreated Nov 20, 2024Updated Nov 25, 2024
The Filterable used in ⬇️ doesn't seem to support Map?
As best I can tell it fails the _isobject check:
https://github.com/ramda/ramda/blob/980b3bf7712adb8ad8b5d9b2c6aca525cb3cf143/source/filter.js#L38-L40
Because: Object.prototype.toString.call(new Map()) === '[object Map]' !== [object Object]
Then fall through to this which fails because Map doesn't have .length:
https://github.com/ramda/ramda/blob/852e252041fbbd8e341d0d3dc7749c2b5bd692a7/source/internal/_filter.js#L1-L6
I'm not too sure of ramda internals, but could it use the iterable protocol instead of assuming listwith .length?
Source: ramda/ramda