Skip to content

Missing has() and hasIn() #41

Open
@crazycodr

Description

@crazycodr

Was looking for has today and couldn't find it. I can implement has and hasIn (Seems to be the exact same to me) using the Symfony Property Access component (SPAC after) but will have one slight difference from the lodash support because SPAC doesn't support one of the suggested approach in the lodash docs. Also, it will obviously require the addition of a small dependency. Are you ok with it?

References:

The differences would be:

var object = { 'a': { 'b': 2 } };
var other = _.create({ 'a': _.create({ 'b': 2 }) });
 
_.has(object, ['a', 'b']);
// => broken, SPAC cannot resolve paths using arrays of keys

I will wait for your approval to start work on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions