mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
Fix object coercion.
This commit is contained in:
@@ -17,8 +17,10 @@
|
||||
* // => [5, 10]
|
||||
*/
|
||||
function filterObject(object, predicate) {
|
||||
object = Object(object)
|
||||
const result = []
|
||||
Object.keys(Object(object)).forEach((key) => {
|
||||
|
||||
Object.keys(object).forEach((key) => {
|
||||
const value = object[key]
|
||||
if (predicate(value, key, object)) {
|
||||
result.push(value)
|
||||
|
||||
Reference in New Issue
Block a user