Sign in
cobalt
/
cobalt
/
02dc75a3e28204929da5793da854c523d59e642c
/
.
/
src
/
third_party
/
devtools
/
node_modules
/
yargs
/
lib
/
obj-filter.js
blob: c344ac58cacadbedaa0d2c6efff3e461be189a1d [
file
] [
log
] [
blame
]
'use strict'
module
.
exports
=
function
objFilter
(
original
,
filter
)
{
const
obj
=
{}
filter
=
filter
||
((
k
,
v
)
=>
true
)
Object
.
keys
(
original
||
{}).
forEach
((
key
)
=>
{
if
(
filter
(
key
,
original
[
key
]))
{
obj
[
key
]
=
original
[
key
]
}
})
return
obj
}