Closed nev21 closed 1 month ago
Changing this will introduce downstream consumption breakages, will need to stage the signature change. For now the workaround will be to just cast the value to any as the callback is called when the value is not a string.
Actually, as this is using for..in
this only returns string keys, so I'm not going to change this. If / when needed it would be better to introduce a different function which would look over all enumerable properties and not just strings. Likewise for objKeys
The signature for the callback of the objForeachKey() specifies that the key is always a string, when it's not, it may be a string, symbol or number.
So the "type" of prop is really a PropertyKey (string, number or symbol)
The signature should reflect the true nature of key type and not specify that it's always a string (even if most of the time the enumerable type for the object may be)