moleculer icon indicating copy to clipboard operation
moleculer copied to clipboard

[lodash] Remove usage of _.pick

Open abdavid opened this issue 4 years ago • 0 comments

See #433 for context.

Describe the solution you'd like Remove usage of _.pick throughout Moleculer.

Describe alternatives you've considered Vanilla suggestion would be something like

const pick = (o, xs) => {
    if(!Array.isArray(xs))
         xs = [xs];
    return xs.reduce((acc,x) => {
       if(o.hasOwnProperty(x))
            acc[x] = o[x]
       return acc;       
    }, {})
}

Additional context https://github.com/moleculerjs/moleculer/search?q=.pick&unscoped_q=.pick

abdavid avatar May 22 '20 19:05 abdavid