This PR allows for differing key positions in an object parameter to be considered the same. See issue #14
the default cache resolver simply does a JSON.stringify test against the old and new parameters. This does not take into account the position of the properties and can lead to false results (depending on your point of view).
Added a new boolean config option hashcache which uses a resolver that compares the parameters with object-hash
to use the new resolver, set the hashcache option to true
@Cacheable({hashcache:true})
2 extra tests were added: 1) to ensure the old cache resolver considers different key positions to be a different parameter, and 2) to test the new cache resolver considers different key positions to be the same parameter,
This PR allows for differing key positions in an object parameter to be considered the same. See issue #14
the default cache resolver simply does a JSON.stringify test against the old and new parameters. This does not take into account the position of the properties and can lead to false results (depending on your point of view).
Added a new boolean config option
hashcache
which uses a resolver that compares the parameters withobject-hash
to use the new resolver, set the hashcache option to true
@Cacheable({hashcache:true})
2 extra tests were added: 1) to ensure the old cache resolver considers different key positions to be a different parameter, and 2) to test the new cache resolver considers different key positions to be the same parameter,