FLUID-6500: Improve usability of arrayToSetMembership and setMembershipToArray transforms

Metadata

Source
FLUID-6500
Type
Improvement
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Tony Atkins [RtF]
Reporter
Antranig Basman
Created
2020-05-18T09:26:59.251-0400
Updated
2024-07-22T10:35:10.860-0400
Versions
N/A
Fixed Versions
N/A
Component
  1. Model Transformation System

Description

These are a powerful set of transforms but their documentation is a little ropy and the configuration required is rather bureaucratic. They should be updated so that

i) They have some reasonable JSDoc comments in the implementation explaining their requirements, and that

ii) The requirement to fully list all participating fields in the "options" structure is relaxed.

In particular, they should be improved so that the output of the function call

fluid.transforms.arrayToSetMembership(["thing1", "thing2"])

applies sensible defaults to that it produces the result

{
    "thing1": true,
    "thing2": true
}

and similarly for the inverse call of setMembershipToArray

This implies that the use of the 3rd arg "transformer" should be eliminated - I think the use of resolverSetConfig is not going to produce any helpfully different results, and the argument "transformSpec" should be made wholly optional.

Comments