goliatone / gkeypath

Simple keypath module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add `is` function

goliatone opened this issue · comments

We want to be able to do:

let result = { entity: {id:'fwkd23', uuid: 'adfa-asdfawe'}};
KeyPath.is(result, 'entity.id', 'fwkd23');

Currently we would do that as follows:

KeyPath.get(result, 'entity.id', '') === 'fwkd23';

Maybe use equals?

KeyPath.equals(result, 'entity.id', 'fwkd23');