Make resolved entity assertions iterable #114
Labels
enhancement
New feature or request
refactor
rlay-client-lib
issues pertaining to @rlay/rlay-client-lib
Milestone
Calling
.resolve
on an entity (Individual) leads to all (property and assert) assertions being fetched, decoded, and attached to the entity. However, if there is only assertion that has the same assertion property it will be attached like thisentity.customKeyAssertionName instanceof Object || instanceof {String|Boolean|Numeric|...}
and if there are two or more assertions that share the same assertion property it will be attached like thisentity.customkeyAssertionName instanceof Array
.This causes ugly boilerplate when trying to use the value and to fix that we need to make it always return an iterable object e.g. an array. That object may have some helper methods like
.getFirst
to make it easier to access when there is only a single assertionsThe text was updated successfully, but these errors were encountered: