claimNames method
Returns an Iterable of all the Claim Names of claims in the claim set.
The default is to consider all Claim Names (i.e. for both registered and
non-registered claims). If includeRegisteredClaims
is set to false,
registered claims are not included.
Implementation
Iterable<String> claimNames({bool includeRegisteredClaims = true}) {
if (includeRegisteredClaims) {
final populatedClaims = <String>[];
for (var name in registeredClaimNames) {
if (containsKey(name)) {
populatedClaims.add(name); // registered claim present, include name
}
}
// Include non-registered claims
populatedClaims.addAll(_otherClaims.keys);
return populatedClaims;
} else {
return _otherClaims.keys;
}
}