jonschlinkert / cache-base

Basic object store with methods like get/set/extend/omit
MIT License
56 stars 19 forks source link

more real `.has` method? #2

Closed tunnckoCore closed 6 years ago

tunnckoCore commented 8 years ago

Before was using has-value(s), now is just typeof val !== undefined

also add hasOwn and union methods?

jonschlinkert commented 8 years ago

this approach passed all of the tests of the other .has method, since it was effectively doing the same thing (at least in non-edge-cases).

add hasOwn and union methods?

I was just thinking the same thing about union today - I just refactored base-data and could have used it. we can add union but let me think about .hasOwn. Honestly I almost always use .get because I can get the same answer and use the resulting value if I need it, instead of doing two lookups (.has then .get)

tunnckoCore commented 8 years ago

Honestly I almost always use .get

Mm yea, me too. But it's logical to have. I think it can be in help for some users that don't got the things as we got it.

tunnckoCore commented 8 years ago

@jonschlinkert ping about the hasOwn and has.