-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
discussionThe conversation is the pointThe conversation is the pointenhancementNew feature or requestNew feature or request
Description
Task
Description
We have a magical term in our dataType constants: ANY.
Every type bucket is required to have an ANY subtype, which will then map to any type within that bucket. This is all documented, and so folks who are looking to write filters for payloads are expected to account for this.
There are two followup questions:
-
Should the value of this magic term be a constant itself, allowing folks to reference it in their code rather than hard coding the
".ANY" -
Should we have a root level
ANYas well, which would map to literally any payload type.
For example, here is some draft code of a payload filter by type:
filterPayloadsByType = (payloads, type) => payloads.filter(
(payload) => payload.type.test(
RegExp(`^${type.replace(/\.ANY$/, '.*')}$`,
))Relevant Resources / Research
None
Related Issues
None
Metadata
Metadata
Assignees
Labels
discussionThe conversation is the pointThe conversation is the pointenhancementNew feature or requestNew feature or request